blob: d6a807899ab1abe45929724b39ac8c1182702178 [file] [log] [blame]
Oliver Smith1465bab2020-05-14 11:52:28 +02001#
2# spec file for package osmo-sgsn
3#
4# Copyright (c) 2017, Martin Hauke <mardnh@gmx.de>
5#
6# All modifications and additions to the file contributed by third parties
7# remain the property of their copyright owners, unless otherwise agreed
8# upon. The license for this file, and modifications and additions to the
9# file, is the same license as for the pristine package itself (unless the
10# license for the pristine package is not an Open Source License, in which
11# case the license is the MIT License). An "Open Source License" is a
12# license that conforms to the Open Source Definition (Version 1.9)
13# published by the Open Source Initiative.
14
Oliver Smith1465bab2020-05-14 11:52:28 +020015## Disable LTO for now since it breaks compilation of the tests
16## https://osmocom.org/issues/4116
17%define _lto_cflags %{nil}
18
19%define with_iu 1
20Name: osmo-sgsn
Oliver Smitha40ccf62020-05-14 11:53:18 +020021Version: @VERSION@
Oliver Smith1465bab2020-05-14 11:52:28 +020022Release: 0
23Summary: Osmocom's SGSN for 2G and 3G packet-switched mobile networks
24License: AGPL-3.0-or-later AND GPL-2.0-or-later
25Group: Productivity/Telephony/Servers
Oliver Smitha40ccf62020-05-14 11:53:18 +020026URL: https://osmocom.org/projects/osmosgsn
Oliver Smith1465bab2020-05-14 11:52:28 +020027Source: %{name}-%{version}.tar.xz
28BuildRequires: autoconf
29BuildRequires: automake
30BuildRequires: libtool
31BuildRequires: pkgconfig
Oliver Smitha40ccf62020-05-14 11:53:18 +020032%if 0%{?suse_version}
Oliver Smith1465bab2020-05-14 11:52:28 +020033BuildRequires: systemd-rpm-macros
Oliver Smitha40ccf62020-05-14 11:53:18 +020034%endif
Oliver Smith1465bab2020-05-14 11:52:28 +020035BuildRequires: pkgconfig(libcares)
36BuildRequires: pkgconfig(libcrypto) >= 0.9.5
37BuildRequires: pkgconfig(libgtp) >= 1.4.0
38BuildRequires: pkgconfig(libosmo-gsup-client) >= 1.0.0
39BuildRequires: pkgconfig(libosmo-netif) >= 0.4.0
40BuildRequires: pkgconfig(libosmoabis) >= 0.6.0
41BuildRequires: pkgconfig(libosmocore) >= 1.2.0
42BuildRequires: pkgconfig(libosmoctrl) >= 1.2.0
43BuildRequires: pkgconfig(libosmogb) >= 1.2.0
44BuildRequires: pkgconfig(libosmogsm) >= 1.2.0
45BuildRequires: pkgconfig(libosmovty) >= 1.2.0
46%{?systemd_requires}
47%if %{with_iu}
48BuildRequires: pkgconfig(libasn1c)
49BuildRequires: pkgconfig(libosmo-ranap) >= 0.4.0
50BuildRequires: pkgconfig(libosmo-sigtran) >= 1.0.0
51%endif
52
53%description
54OsmoSGSN is Osmocom's Serving GPRS Support Node for 2G and 3G
55packet-switched mobile networks.
56
57%package -n osmo-gtphub
58Summary: Osmocom GTP Hub: Proxy for GTP traffic between multiple SGSNs and GGSNs
59Group: Productivity/Telephony/Servers
60
61%description -n osmo-gtphub
62Osmocom GTP Hub: Proxy for GTP traffic between multiple SGSNs and GGSNs.
63
64%package -n osmo-gbproxy
65Summary: Osmocom GPRS Gb Interface Proxy
66Group: Productivity/Telephony/Servers
67
68%description -n osmo-gbproxy
69The purpose of the Gb proxy is to aggregate the Gb links of multiple
70BSS's and present them in one Gb link to the SGSN.
71
72%prep
73%setup -q
74
75%build
76echo "%{version}" >.tarball-version
77autoreconf -fi
78%configure \
79%if %{with_iu}
80 --enable-iu \
81%endif
82 --docdir=%{_docdir}/%{name} \
83 --with-systemdsystemunitdir=%{_unitdir}
84make %{?_smp_mflags}
85
86%install
87%make_install
88
Oliver Smitha40ccf62020-05-14 11:53:18 +020089%if 0%{?suse_version}
Oliver Smith1465bab2020-05-14 11:52:28 +020090%preun %service_del_preun %{name}.service
91%postun %service_del_postun %{name}.service
92%pre %service_add_pre %{name}.service
93%post %service_add_post %{name}.service
94%preun -n osmo-gtphub %service_del_preun osmo-gtphub.service
95%postun -n osmo-gtphub %service_del_postun osmo-gtphub.service
96%pre -n osmo-gtphub %service_add_pre osmo-gtphub.service
97%post -n osmo-gtphub %service_add_post osmo-gtphub.service
98%preun -n osmo-gbproxy %service_del_preun osmo-gbproxy.service
99%postun -n osmo-gbproxy %service_del_postun osmo-gbproxy.service
100%pre -n osmo-gbproxy %service_add_pre osmo-gbproxy.service
101%post -n osmo-gbproxy %service_add_post osmo-gbproxy.service
Oliver Smitha40ccf62020-05-14 11:53:18 +0200102%endif
Oliver Smith1465bab2020-05-14 11:52:28 +0200103
104%check
105make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
106
107%files
108%doc AUTHORS README
109%dir %{_docdir}/%{name}/examples
110%dir %{_docdir}/%{name}/examples/osmo-sgsn
111%exclude %{_docdir}/%{name}/examples/osmo-gtphub
112%exclude %{_docdir}/%{name}/examples/osmo-gbproxy
113%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
114%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn.cfg
115%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
116%{_bindir}/osmo-sgsn
117%dir %{_sysconfdir}/osmocom
Harald Welte7dd85f42020-06-22 15:20:33 +0200118%config(noreplace) %{_sysconfdir}/osmocom/osmo-sgsn.cfg
Oliver Smith1465bab2020-05-14 11:52:28 +0200119%{_unitdir}/%{name}.service
120
121%files -n osmo-gtphub
122%dir %{_docdir}/%{name}/examples
123%dir %{_docdir}/%{name}/examples/osmo-gtphub
124%{_docdir}/%{name}/examples/osmo-gtphub/osmo-gtphub-1iface.cfg
125%{_docdir}/%{name}/examples/osmo-gtphub/osmo-gtphub.cfg
126%{_bindir}/osmo-gtphub
127%dir %{_sysconfdir}/osmocom
Harald Welte7dd85f42020-06-22 15:20:33 +0200128%config(noreplace) %{_sysconfdir}/osmocom/osmo-gtphub.cfg
Oliver Smith1465bab2020-05-14 11:52:28 +0200129%{_unitdir}/osmo-gtphub.service
130
131%files -n osmo-gbproxy
132%dir %{_docdir}/%{name}/examples
133%dir %{_docdir}/%{name}/examples/osmo-gbproxy
134%{_docdir}/%{name}/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg
135%{_docdir}/%{name}/examples/osmo-gbproxy/osmo-gbproxy.cfg
136%{_bindir}/osmo-gbproxy
137%dir %{_sysconfdir}/osmocom
Harald Welte7dd85f42020-06-22 15:20:33 +0200138%config(noreplace) %{_sysconfdir}/osmocom/osmo-gbproxy.cfg
Oliver Smith1465bab2020-05-14 11:52:28 +0200139%{_unitdir}/osmo-gbproxy.service
140
141%changelog