blob: bc74688dac31160bc3bb5133293edf88eafa9641 [file] [log] [blame]
Oliver Smith482bb072020-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 Smith482bb072020-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 Smithbd6d6772020-05-14 11:53:18 +020021Version: @VERSION@
Oliver Smith482bb072020-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 Smithbd6d6772020-05-14 11:53:18 +020026URL: https://osmocom.org/projects/osmosgsn
Oliver Smith482bb072020-05-14 11:52:28 +020027Source: %{name}-%{version}.tar.xz
28BuildRequires: autoconf
29BuildRequires: automake
30BuildRequires: libtool
31BuildRequires: pkgconfig
Oliver Smithbd6d6772020-05-14 11:53:18 +020032%if 0%{?suse_version}
Oliver Smith482bb072020-05-14 11:52:28 +020033BuildRequires: systemd-rpm-macros
Oliver Smithbd6d6772020-05-14 11:53:18 +020034%endif
Oliver Smith482bb072020-05-14 11:52:28 +020035BuildRequires: pkgconfig(libcares)
36BuildRequires: pkgconfig(libcrypto) >= 0.9.5
Pau Espin Pedrol328ed942022-06-29 11:45:09 +020037BuildRequires: pkgconfig(libgtp) >= 1.9.0
38BuildRequires: pkgconfig(libosmo-gsup-client) >= 1.5.0
39BuildRequires: pkgconfig(libosmo-netif) >= 1.2.0
40BuildRequires: pkgconfig(libosmoabis) >= 1.3.0
41BuildRequires: pkgconfig(libosmocore) >= 1.7.0
42BuildRequires: pkgconfig(libosmoctrl) >= 1.7.0
43BuildRequires: pkgconfig(libosmogb) >= 1.7.0
44BuildRequires: pkgconfig(libosmogsm) >= 1.7.0
45BuildRequires: pkgconfig(libosmovty) >= 1.7.0
Oliver Smith482bb072020-05-14 11:52:28 +020046%{?systemd_requires}
47%if %{with_iu}
48BuildRequires: pkgconfig(libasn1c)
Pau Espin Pedrol328ed942022-06-29 11:45:09 +020049BuildRequires: pkgconfig(libosmo-ranap) >= 1.3.0
50BuildRequires: pkgconfig(libosmo-sigtran) >= 1.6.0
Oliver Smith482bb072020-05-14 11:52:28 +020051%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
Oliver Smith482bb072020-05-14 11:52:28 +020064%prep
65%setup -q
66
67%build
68echo "%{version}" >.tarball-version
69autoreconf -fi
70%configure \
71%if %{with_iu}
72 --enable-iu \
73%endif
74 --docdir=%{_docdir}/%{name} \
75 --with-systemdsystemunitdir=%{_unitdir}
76make %{?_smp_mflags}
77
78%install
79%make_install
80
Oliver Smithbd6d6772020-05-14 11:53:18 +020081%if 0%{?suse_version}
Oliver Smith482bb072020-05-14 11:52:28 +020082%preun %service_del_preun %{name}.service
83%postun %service_del_postun %{name}.service
84%pre %service_add_pre %{name}.service
85%post %service_add_post %{name}.service
86%preun -n osmo-gtphub %service_del_preun osmo-gtphub.service
87%postun -n osmo-gtphub %service_del_postun osmo-gtphub.service
88%pre -n osmo-gtphub %service_add_pre osmo-gtphub.service
89%post -n osmo-gtphub %service_add_post osmo-gtphub.service
Oliver Smithbd6d6772020-05-14 11:53:18 +020090%endif
Oliver Smith482bb072020-05-14 11:52:28 +020091
92%check
93make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
94
95%files
Harald Weltec230f0c2022-06-18 13:32:49 +020096%doc AUTHORS README.md
Oliver Smith482bb072020-05-14 11:52:28 +020097%dir %{_docdir}/%{name}/examples
98%dir %{_docdir}/%{name}/examples/osmo-sgsn
99%exclude %{_docdir}/%{name}/examples/osmo-gtphub
Oliver Smith482bb072020-05-14 11:52:28 +0200100%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
101%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn.cfg
102%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
103%{_bindir}/osmo-sgsn
104%dir %{_sysconfdir}/osmocom
Harald Welte90dedcb2020-06-22 15:20:33 +0200105%config(noreplace) %{_sysconfdir}/osmocom/osmo-sgsn.cfg
Oliver Smith482bb072020-05-14 11:52:28 +0200106%{_unitdir}/%{name}.service
107
108%files -n osmo-gtphub
109%dir %{_docdir}/%{name}/examples
110%dir %{_docdir}/%{name}/examples/osmo-gtphub
111%{_docdir}/%{name}/examples/osmo-gtphub/osmo-gtphub-1iface.cfg
112%{_docdir}/%{name}/examples/osmo-gtphub/osmo-gtphub.cfg
113%{_bindir}/osmo-gtphub
114%dir %{_sysconfdir}/osmocom
Harald Welte90dedcb2020-06-22 15:20:33 +0200115%config(noreplace) %{_sysconfdir}/osmocom/osmo-gtphub.cfg
Oliver Smith482bb072020-05-14 11:52:28 +0200116%{_unitdir}/osmo-gtphub.service
117
Oliver Smith482bb072020-05-14 11:52:28 +0200118%changelog