Name: open5gs Version: 2.7.5 Release: 1.dcbw%{?dist} Summary: Implementation for 5G Core and EPC License: AGPL v3.0 URL: https://open5gs.org BuildRequires: git gcc-c++ meson cmake mongo-c-driver-devel python3 ninja-build glibc-headers BuildRequires: pkgconf-pkg-config gnutls-devel libtalloc-devel libcurl-devel libyaml-devel openssl-devel BuildRequires: lksctp-tools-devel libnghttp2-devel libmicrohttpd-devel libtins-devel freeDiameter-devel BuildRequires: nodejs-npm nodejs-devel BuildRequires: systemd-devel %{?sysusers_requires_compat} Requires: mongodb-org Source0: %{name}-%{version}.tar.bz2 Source1: open5gs.conf Source2: open5gs-nolock.conf Source3: open5gs-subprojects.tar.gz Source4: open5gs-webui.service Source5: node_modules.tgz Source6: package-lock.json Source7: package.json %description Open5GS is a C-language Open Source implementation for 5G Core and EPC, i.e. the core network of LTE/NR network. %package webui Summary: Web UI for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: nodejs mongodb-org %description webui Web UI for %{name}. %prep %autosetup -p1 tar xzf %{SOURCE3} -C subprojects/ %build %global optflags %(echo %optflags | sed 's|-Wp,-D_GLIBCXX_ASSERTIONS||g') # no rpath find . -name 'meson.build' -exec sed -i '/install_rpath/d' {} + # modern glibc sed -i '/sys\/sysctl.h/d' lib/ipfw/*.c # external freeDiameter sed -i 's|^freeDiameter|#freeDiameter|' lib/diameter/common/meson.build sed -i 's|^libfdcore_dep = |#libfdcore_dep|' lib/diameter/common/meson.build sed -i "/^#libfdcore_dep/i libfdcore_dep = [cc.find_library(['libfdcore'], dirs : ['%{_libdir}'])]" lib/diameter/common/meson.build sed -i "/^#libfdcore_dep/a libfdcore_dep += cc.find_library(['libfdproto'], dirs : ['%{_libdir}'])" lib/diameter/common/meson.build sed -i "/^#libfdcore_dep/a libfdcore_dep += cc.find_library(['libgnutls'], dirs : ['%{_libdir}'])" lib/diameter/common/meson.build sed -i '1 i #include ' src/upf/arp-nd.cpp export CFLAGS='%{optflags} -I/usr/include/uClibc/' %meson %meson_build pushd webui/ tar -xvf %{SOURCE5} cp %{SOURCE6} %{SOURCE7} . npm install || true cat /builddir/.npm/_logs/* npm run build popd %install %meson_install %if 0%{?fedora} >= 42 install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf %else install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf %endif install -d %{buildroot}/%{_sysconfdir}/open5gs install -d %{buildroot}/%{_sysconfdir}/freeDiameter install -d %{buildroot}/%{_unitdir} install -d %{buildroot}%{_localstatedir}/log/open5gs install -d %{buildroot}/%{_sysconfdir}/logrotate.d install -m 0644 redhat-linux-build/configs/logrotate/open5gs %{buildroot}%{_sysconfdir}/logrotate.d/ # install -m 0644 redhat-linux-build/configs/open5gs/hss.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/freeDiameter/hss.conf %{buildroot}/%{_sysconfdir}/freeDiameter/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-hssd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/mme.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/freeDiameter/mme.conf %{buildroot}/%{_sysconfdir}/freeDiameter/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-mmed.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/sgwc.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-sgwcd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/sgwu.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-sgwud.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/amf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-amfd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/upf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-upfd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/nrf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-nrfd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/ausf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-ausfd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/udm.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-udmd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/udr.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-udrd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/udr.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-udrd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/bsf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-bsfd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/pcrf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/freeDiameter/pcrf.conf %{buildroot}/%{_sysconfdir}/freeDiameter/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-pcrfd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/smf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/freeDiameter/smf.conf %{buildroot}/%{_sysconfdir}/freeDiameter/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-smfd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/nssf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-nssfd.service %{buildroot}/%{_unitdir}/ # install -m 0644 redhat-linux-build/configs/open5gs/pcf.yaml %{buildroot}/%{_sysconfdir}/open5gs/ install -m 0644 redhat-linux-build/configs/systemd/open5gs-pcfd.service %{buildroot}/%{_unitdir}/ # webui mkdir -p %{buildroot}/usr/lib/node_modules mv webui %{buildroot}/usr/lib/node_modules/%{name} install -m 0644 %{SOURCE4} %{buildroot}/%{_unitdir}/ %ldconfig_scriptlets %pre %sysusers_create_compat %{SOURCE1} %post %systemd_post open5gs-hssd.service %systemd_post open5gs-mmed.service %systemd_post open5gs-sgwcd.service %systemd_post open5gs-sgwud.service %systemd_post open5gs-amfd.service %systemd_post open5gs-upfd.service %systemd_post open5gs-nrfd.service %systemd_post open5gs-ausfd.service %systemd_post open5gs-udmd.service %systemd_post open5gs-udrd.service %systemd_post open5gs-bsfd.service %systemd_post open5gs-pcrfd.service %systemd_post open5gs-smfd.service %systemd_post open5gs-nssfd.service %systemd_post open5gs-pcfd.service %post webui %systemd_post open5gs-webui.service %preun %systemd_preun open5gs-hssd.service %systemd_preun open5gs-mmed.service %systemd_preun open5gs-sgwcd.service %systemd_preun open5gs-sgwud.service %systemd_preun open5gs-amfd.service %systemd_preun open5gs-upfd.service %systemd_preun open5gs-nrfd.service %systemd_preun open5gs-ausfd.service %systemd_preun open5gs-udmd.service %systemd_preun open5gs-udrd.service %systemd_preun open5gs-bsfd.service %systemd_preun open5gs-pcrfd.service %systemd_preun open5gs-smfd.service %systemd_preun open5gs-nssfd.service %systemd_preun open5gs-pcfd.service %preun webui %systemd_preun open5gs-webui.service %postun %systemd_postun open5gs-hssd.service %systemd_postun open5gs-mmed.service %systemd_postun open5gs-sgwcd.service %systemd_postun open5gs-sgwud.service %systemd_postun open5gs-amfd.service %systemd_postun open5gs-upfd.service %systemd_postun open5gs-nrfd.service %systemd_postun open5gs-ausfd.service %systemd_postun open5gs-udmd.service %systemd_postun open5gs-udrd.service %systemd_postun open5gs-bsfd.service %systemd_postun open5gs-pcrfd.service %systemd_postun open5gs-smfd.service %systemd_postun open5gs-nssfd.service %systemd_postun open5gs-pcfd.service %postun webui %systemd_postun open5gs-webui.service %files %doc README.md %license LICENSE %{_bindir}/* %{_libdir}/*.so* %dir %{_sysconfdir}/open5gs %dir %{_sysconfdir}/freeDiameter %config(noreplace) %{_sysconfdir}/freeDiameter/*.conf %config(noreplace) %{_sysconfdir}/open5gs/*.yaml %dir %{_localstatedir}/log/open5gs %{_unitdir}/open5gs-hssd.service %{_unitdir}/open5gs-mmed.service %{_unitdir}/open5gs-sgwcd.service %{_unitdir}/open5gs-sgwud.service %{_unitdir}/open5gs-amfd.service %{_unitdir}/open5gs-upfd.service %{_unitdir}/open5gs-nrfd.service %{_unitdir}/open5gs-ausfd.service %{_unitdir}/open5gs-udmd.service %{_unitdir}/open5gs-udrd.service %{_unitdir}/open5gs-bsfd.service %{_unitdir}/open5gs-pcrfd.service %{_unitdir}/open5gs-smfd.service %{_unitdir}/open5gs-nssfd.service %{_unitdir}/open5gs-pcfd.service %{_sysusersdir}/%{name}.conf %config(noreplace) %{_sysconfdir}/logrotate.d/open5gs %ghost %dir %{_rundir}/open5gs-mmed %ghost %dir %{_rundir}/open5gs-sgwcd %ghost %dir %{_rundir}/open5gs-smfd %ghost %dir %{_rundir}/open5gs-amfd %ghost %dir %{_rundir}/open5gs-sgwud %ghost %dir %{_rundir}/open5gs-upfd %ghost %dir %{_rundir}/open5gs-hssd %ghost %dir %{_rundir}/open5gs-pcrfd %ghost %dir %{_rundir}/open5gs-nrfd %ghost %dir %{_rundir}/open5gs-ausfd %ghost %dir %{_rundir}/open5gs-udmd %ghost %dir %{_rundir}/open5gs-udrd %files webui /usr/lib/node_modules/%{name} %{_unitdir}/open5gs-webui.service %changelog * Sun Jun 8 2025 Dan Williams - 2.7.5 - Update to 2.7.5 * Fri Oct 02 2020 Cristian Balint - git update releases