%global pkgvers 0 %global scdate0 20240131 %global schash0 ec29b0c1ff79cebcbe66caa6d6b90778261c42b8 %global branch0 master %global source0 https://github.com/srsran/srsRAN_4G.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} %define use_gui 0 Name: srsran_4g Version: 23.11 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: 4G/5G software radio suite developed by SRS License: AGPL-3+ LGPL-2.1 BSD-3-clause MIT LGPL-2.1 URL: https://github.com/srsran/srsRAN_4G BuildRequires: git cmake gcc-c++ pkgconf-pkg-config BuildRequires: boost-devel boost-program-options libconfig-devel BuildRequires: fftw-devel mbedtls-devel lksctp-tools-devel uhd-devel BuildRequires: zeromq-devel SoapySDR-devel bladerf-devel pcsc-lite-devel BuildRequires: libdwarf-devel elfutils-devel binutils-devel %if %{use_gui} BuildRequires: srsgui-devel %endif %undefine _hardened_build %undefine _annotated_build %global __cmake_in_source_build 1 %description A 4G/5G software radio suite developed by SRS. %package devel Summary: Development library of %{name} Requires: %{name} = %{version}-%{release} %description devel Development %{name} library %package examples Summary: Examples of %{name} Requires: %{name} = %{version}-%{release} %description examples Examples %{name} library %package static Summary: Development library of %{name} Requires: %{name} = %{version}-%{release} %description static Development %{name} library %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller # error sed -i '/Add -Werror/,/endif/d' CMakeLists.txt # c++17 sed -i 's|-std=c++14|-std=c++17|' CMakeLists.txt # failing test builds sed -i 's|rrc_nr_test_helpers rrc|rrc_nr_test_helpers OBJECT rrc|' srsgnb/src/stack/rrc/test/CMakeLists.txt sed -i 's|sched_nr_test_suite sched|sched_nr_test_suite OBJECT sched|' srsgnb/src/stack/mac/test/CMakeLists.txt sed -i 's|test_helpers test_helpers.cc|test_helpers OBJECT test_helpers.cc|' srsenb/test/rrc/CMakeLists.txt # gcc13 sed -i '1i #include ' lib/include/srsran/radio/channel_mapping.h %build %global optflags %(echo %optflags -Wno-error=unused-value | sed 's|-Wp,-D_GLIBCXX_ASSERTIONS||g') mkdir -p build pushd build %cmake .. -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DLIBDWARF_INCLUDE_DIR=%{_includedir}/libdwarf-0 \ -DBUILD_STATIC=OFF \ -DBUILD_TESTING=ON \ -DENABLE_ALL_TESTS=ON \ -DENABLE_SKIQ=OFF \ -DGCC_ARCH=generic \ -DBUILD_WITH_LTO=ON \ %if %{use_gui} -DENABLE_GUI=ON \ %else -DENABLE_GUI=OFF \ %endif -DUSE_LTE_RATES=ON \ -DAUTO_DETECT_ISA=ON \ %ifarch x86_64 -DENABLE_AVX=ON \ -DENABLE_AVX2=ON \ -DENABLE_AVX512=ON \ -DENABLE_FMA=ON \ %endif -DUSE_MKL=OFF make %{?_smp_mflags} popd %install pushd build make install DESTDIR=%{buildroot} popd # cfg files mkdir -p %{buildroot}/%{_sysconfdir} ln -sf %{_datadir}/srsran %{buildroot}/%{_sysconfdir}/%{name} # examples install -pm755 build/lib/src/radio/test/benchmark_radio %{buildroot}%{_bindir}/ for f in $(find build/lib/examples -exec file {} \; | grep ELF | grep executable | cut -d':' -f1) do install -pm755 $f %{buildroot}%{_bindir}/ done %check export LD_LIBRARY_PATH=%{buildroot}%{_libdir} pushd build time make test || true popd %files %doc README.md %license LICENSE %{_bindir}/srs* %{_libdir}/*.so* %{_datadir}/srsran %{_sysconfdir}/%{name} %files devel %{_includedir}/* %{_libdir}/*.so %files examples %exclude %{_bindir}/srs* %{_bindir}/* %files static %{_libdir}/*.a %changelog * Mon Aug 24 2020 Cristian Balint - github update releases