LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File nextepc.spec of Package nextepc (Project home:mnhauke:nextepc)

#
# spec file for package osmo-bsc
#
# Copyright (c) 2018, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define nextepc_user  nextepc
%define nextepc_group nextepc

Name:           nextepc
Version:        0.3.9
Release:        0
Summary:        Open Source based 3GPP EPC (metapackage)
License:        AGPL-3.0-only
Group:          Productivity/Telephony/Servers
URL:            http://nextepc.org
#Git-Clone:     https://github.com/acetcom/nextepc.git
Source:         https://github.com/acetcom/nextepc/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        nextepc-tmpfile
Source2:        nextepc-metapackage
Patch1:         0001-fix-the-compiler-error-in-the-mongo-c-driver-1.11.patch
Patch2:         0002-fix-the-compile-error-for-GCC-8.1.patch
Source99:       nextepc-rpmlintrc
BuildRequires:  automake
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  libgcrypt-devel
BuildRequires:  libtool
BuildRequires:  lksctp-tools-devel
BuildRequires:  pkgconfig
BuildRequires:  snappy-devel
BuildRequires:  pkgconfig(gnutls)
BuildRequires:  pkgconfig(libcrypto)
BuildRequires:  pkgconfig(libidn)
BuildRequires:  pkgconfig(libmongoc-1.0) >= 1.3.1
BuildRequires:  pkgconfig(libsasl2)
BuildRequires:  pkgconfig(libssl)
BuildRequires:  pkgconfig(yaml-0.1) >= 0.1.4
BuildRequires:  pkgconfig(zlib)
Requires:       nextepc-core = %{version}
Requires:       nextepc-mme = %{version}
Requires:       nextepc-sgw = %{version}
Requires:       nextepc-pgw = %{version}
Requires:       nextepc-pcrf = %{version}
Requires:       nextepc-hss = %{version}
%{?systemd_requires}

%description
NextEPC is a C-language Open Source implementation of the 3GPP Evolved
Packet Core, i.e. the core network of an LTE network.

This is a metapackage that depends on all the nextepc parts.
(MME, SGW, PGW, HSS, PCRF)

%package -n nextepc-core
Summary:        Open Source based 3GPP EPC (Shared Files)
Group:          Productivity/Telephony/Servers
Requires:       logrotate
Requires(pre):  pwdutils

%description -n nextepc-core
NextEPC is a C-language Open Source implementation of the 3GPP Evolved
Packet Core, i.e. the core network of an LTE network.

This package contains some core libraries/plugins required by the other
binary packages such as nextepc-{mme,sgw,pgw,pcrf,hss}.

%package -n nextepc-mme
Summary:        Open Source based 3GPP EPC MME (Mobility Management Entity)
Group:          Productivity/Telephony/Servers
Requires:       nextepc-core = %{version}

%description -n nextepc-mme
NextEPC is a C-language Open Source implementation of the 3GPP Evolved
Packet Core, i.e. the core network of an LTE network.

This package provides the MME (Mobility Management Engine), which
terminates the S1 interfaces from the eNodeBs cells in the cellular
network, and interfaces via S11 to the SGW as well as via S6a to the
HSS.

%package -n nextepc-sgw
Summary:        Open Source based 3GPP EPC SGW (Serving Gateway)
Group:          Productivity/Telephony/Servers
Requires:       nextepc-core = %{version}

%description -n nextepc-sgw
NextEPC is a C-language Open Source implementation of the 3GPP Evolved
Packet Core, i.e. the core network of an LTE network.

This package provides the SGW (Serving Gateway) which is situated
between the MME and PGW.  It implements the S11 interface to the MME,
and the S5 interface to the PGW.

%package -n nextepc-pgw
Summary:        Open Source based 3GPP EPC PGW (Packet Data Network Gateway)
Group:          Productivity/Telephony/Servers
Requires:       nextepc-core = %{version}

%description -n nextepc-pgw
NextEPC is a C-language Open Source implementation of the 3GPP Evolved
Packet Core, i.e. the core network of an LTE network.

This package provides the PGW or PDN-GW (Packet Data Network Gateway)
element of the EPC, i.e. the gateway between the EPC and the external
packet data network, such as the public Internet.  It implements the S5
interface towards the S-GW, the SGi interface towards the Internet,
and the S7 interface towards the PCRF.

%package -n nextepc-pcrf
Summary:        Open Source based 3GPP EPC PCRF (Policy and Charging Rules Function)
Group:          Productivity/Telephony/Servers
Requires:       nextepc-core = %{version}

%description -n nextepc-pcrf
NextEPC is a C-language Open Source implementation of the 3GPP Evolved
Packet Core, i.e. the core network of an LTE network.

This package contains the PCRF (Policy and Charging Rules Function),
which controls the service quality (QoS) of individual connections and
how to account/charge related traffic.  It implements the Gx interface
towards the PGW using the DIAMETER protocol.

%package -n nextepc-hss
Summary:        Open Source based 3GPP EPC HSS (Home Subscriber Server)
Group:          Productivity/Telephony/Servers
Requires:       nextepc-core = %{version}

%description -n nextepc-hss
NextEPC is a C-language Open Source implementation of the 3GPP Evolved
Packet Core, i.e. the core network of an LTE network.

This package provides the HSS (Home Subscriber Server) element of the
EPC, i.e. the central database of mobile network subscribers, with
their IMSI, MSISDN, cryptographic key materials, service subscription
information, etc.  It implements the S6a interface towards the MME
using the DIAMETER protocol.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
cp %{_sourcedir}/nextepc-metapackage README-metapackage

%build
autoreconf -fi
%configure
make V=1 %{?_smp_mflags}

%install
%make_install
install -d %{buildroot}/%{_sysconfdir}/logrotate.d
install -m 0644 support/logrotate/nextepc %{buildroot}%{_sysconfdir}/logrotate.d/nextepc
#
install -d %{buildroot}/%{_unitdir}
install -m 0644 support/systemd/nextepc-hssd.service %{buildroot}/%{_unitdir}/nextepc-hssd.service
install -m 0644 support/systemd/nextepc-mmed.service %{buildroot}/%{_unitdir}/nextepc-mmed.service
install -m 0644 support/systemd/nextepc-pcrfd.service %{buildroot}/%{_unitdir}/nextepc-pcrfd.service
install -m 0644 support/systemd/nextepc-pgwd.service %{buildroot}/%{_unitdir}/nextepc-pgwd.service
install -m 0644 support/systemd/nextepc-sgwd.service %{buildroot}/%{_unitdir}/nextepc-sgwd.service
#
install -d %{buildroot}%{_localstatedir}/log/nextepc
#
find "%{buildroot}/%{_libdir}" -type f -name "*.la" -delete -print
#
install -d -m 0755 %{buildroot}%{_tmpfilesdir}/
install -D -p -m 0644 %{_sourcedir}/nextepc-tmpfile %{buildroot}%{_tmpfilesdir}/nextepc.conf

%pre -n nextepc-core
# Create nextepc user/group
getent group %{nextepc_group} >/dev/null || /usr/sbin/groupadd -r %{nextepc_group}
getent passwd %{nextepc_user} >/dev/null || /usr/sbin/useradd  -g %{nextepc_group} -s /bin/false -r -c "%{nextepc_user}" -d /run/nextepc/ %{nextepc_user}
%post -n nextepc-core
%tmpfiles_create %{_tmpfilesdir}/nextepc.conf

%pre    -n nextepc-hss %service_add_pre    nextepc-hssd.service
%post   -n nextepc-hss %service_add_post   nextepc-hssd.service
%preun  -n nextepc-hss %service_del_preun  nextepc-hssd.service
%postun -n nextepc-hss %service_del_postun nextepc-hssd.service

%pre    -n nextepc-mme %service_add_pre    nextepc-mmed.service
%post   -n nextepc-mme %service_add_post   nextepc-mmed.service
%preun  -n nextepc-mme %service_del_preun  nextepc-mmed.service
%postun -n nextepc-mme %service_del_postun nextepc-mmed.service

%pre    -n nextepc-pcrf %service_add_pre    nextepc-pcrfd.service
%post   -n nextepc-pcrf %service_add_post   nextepc-pcrfd.service
%preun  -n nextepc-pcrf %service_del_preun  nextepc-pcrfd.service
%postun -n nextepc-pcrf %service_del_postun nextepc-pcrfd.service

%pre    -n nextepc-pgw %service_add_pre    nextepc-pgwd.service
%post   -n nextepc-pgw %service_add_post   nextepc-pgwd.service
%preun  -n nextepc-pgw %service_del_preun  nextepc-pgwd.service
%postun -n nextepc-pgw %service_del_postun nextepc-pgwd.service

%pre    -n nextepc-sgw %service_add_pre    nextepc-sgwd.service
%post   -n nextepc-sgw %service_add_post   nextepc-sgwd.service
%preun  -n nextepc-sgw %service_del_preun  nextepc-sgwd.service
%postun -n nextepc-sgw %service_del_postun nextepc-sgwd.service

%files
%doc README-metapackage

%files -n nextepc-core
%license LICENSE
%doc README.md
%dir %{_sysconfdir}/nextepc
%dir %{_sysconfdir}/nextepc/freeDiameter
%dir %{_sysconfdir}/nextepc/test
%config %{_sysconfdir}/nextepc/nextepc.conf
%config %{_sysconfdir}/nextepc/freeDiameter/cacert.pem
%config %{_sysconfdir}/nextepc/test/sample.conf
%config %{_sysconfdir}/nextepc/test/sample-volte.conf
%config %{_sysconfdir}/logrotate.d/nextepc
%{_bindir}/nextepc-epcd
%{_bindir}/testcore
%{_bindir}/testepc
%{_bindir}/testvolte
%{_libdir}/nextepc
%dir %{_localstatedir}/log/nextepc
%{_tmpfilesdir}/nextepc.conf
%ghost %dir /run/nextepc-epcd
%ghost %dir /run/nextepc-hssd
%ghost %dir /run/nextepc-mmed
%ghost %dir /run/nextepc-pcrfd
%ghost %dir /run/nextepc-pgwd
%ghost %dir /run/nextepc-sgwd
%attr(0750,%{nextepc_user},%{nextepc_group}) %{_var}/log/nextepc

%files -n nextepc-mme
%config %{_sysconfdir}/nextepc/freeDiameter/mme.conf
%config %{_sysconfdir}/nextepc/freeDiameter/mme.cert.pem
%config %{_sysconfdir}/nextepc/freeDiameter/mme.key.pem
%config %{_sysconfdir}/nextepc/mme.conf
%{_bindir}/nextepc-mmed
%{_unitdir}/nextepc-mmed.service

%files -n nextepc-sgw
%config %{_sysconfdir}/nextepc/sgw.conf
%{_bindir}/nextepc-sgwd
%{_unitdir}/nextepc-sgwd.service

%files -n nextepc-pgw
%config %{_sysconfdir}/nextepc/freeDiameter/pgw.conf
%config %{_sysconfdir}/nextepc/freeDiameter/pgw.cert.pem
%config %{_sysconfdir}/nextepc/freeDiameter/pgw.key.pem
%config %{_sysconfdir}/nextepc/pgw.conf
%{_bindir}/nextepc-pgwd
%{_unitdir}/nextepc-pgwd.service

%files -n nextepc-pcrf
%config %{_sysconfdir}/nextepc/freeDiameter/pcrf.conf
%config %{_sysconfdir}/nextepc/freeDiameter/pcrf.cert.pem
%config %{_sysconfdir}/nextepc/freeDiameter/pcrf.key.pem
%config %{_sysconfdir}/nextepc/pcrf.conf
%{_bindir}/nextepc-pcrfd
%{_unitdir}/nextepc-pcrfd.service

%files -n nextepc-hss
%config %{_sysconfdir}/nextepc/freeDiameter/hss.conf
%config %{_sysconfdir}/nextepc/freeDiameter/hss.cert.pem
%config %{_sysconfdir}/nextepc/freeDiameter/hss.key.pem
%config %{_sysconfdir}/nextepc/hss.conf
%{_bindir}/nextepc-hssd
%{_unitdir}/nextepc-hssd.service

%changelog