blob: ad12846bfdebd5fbf05046ca175ca258ab927d08 [file] [log] [blame]
Oliver Smithb0925892020-05-14 11:48:32 +02001#
2# spec file for package osmo-msc
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 Smithb0925892020-05-14 11:48:32 +020015## Disable LTO for now since it breaks compilation of the tests
16## https://osmocom.org/issues/4115
17%define _lto_cflags %{nil}
18
Oliver Smithb0925892020-05-14 11:48:32 +020019%define with_iu 1
20Name: osmo-msc
Oliver Smith03145932020-05-14 11:49:00 +020021Version: @VERSION@
Oliver Smithb0925892020-05-14 11:48:32 +020022Release: 0
23Summary: Osmocom's MSC for 2G and 3G circuit-switched mobile networks
24License: AGPL-3.0-or-later AND GPL-2.0-only
25Group: Productivity/Telephony/Servers
Oliver Smith03145932020-05-14 11:49:00 +020026URL: https://osmocom.org/projects/osmomsc
Oliver Smithb0925892020-05-14 11:48:32 +020027Source: %{name}-%{version}.tar.xz
28BuildRequires: autoconf
29BuildRequires: automake
Oliver Smithb0925892020-05-14 11:48:32 +020030BuildRequires: libtool
Oliver Smith03145932020-05-14 11:49:00 +020031%if 0%{?suse_version}
32BuildRequires: systemd-rpm-macros
33%endif
Oliver Smithb0925892020-05-14 11:48:32 +020034BuildRequires: pkgconfig >= 0.20
Harald Welte467fc572022-05-13 19:48:08 +020035BuildRequires: pkgconfig(sqlite3)
Oliver Smithb0925892020-05-14 11:48:32 +020036BuildRequires: pkgconfig(libcrypto) >= 0.9.5
Pau Espin Pedrol7eefae42023-09-12 16:46:11 +020037BuildRequires: pkgconfig(libosmo-gsup-client) >= 1.7.0
38BuildRequires: pkgconfig(libosmo-mgcp-client) >= 1.12.0
39BuildRequires: pkgconfig(libosmo-netif) >= 1.4.0
40BuildRequires: pkgconfig(libosmo-sccp) >= 1.8.0
41BuildRequires: pkgconfig(libosmo-sigtran) >= 1.8.0
42BuildRequires: pkgconfig(libosmoabis) >= 1.5.0
43BuildRequires: pkgconfig(libosmocore) >= 1.9.0
44BuildRequires: pkgconfig(libosmoctrl) >= 1.9.0
45BuildRequires: pkgconfig(libosmogsm) >= 1.9.0
46BuildRequires: pkgconfig(libosmovty) >= 1.9.0
Pau Espin Pedrol59764b62021-02-23 20:22:34 +010047BuildRequires: pkgconfig(libsmpp34) >= 1.14.0
Oliver Smithb0925892020-05-14 11:48:32 +020048####
49BuildRequires: lksctp-tools-devel
50####
51%{?systemd_requires}
52%if %{with_iu}
53BuildRequires: pkgconfig(libasn1c) >= 0.9.30
Pau Espin Pedrol7eefae42023-09-12 16:46:11 +020054BuildRequires: pkgconfig(libosmo-ranap) >= 1.5.0
Oliver Smithb0925892020-05-14 11:48:32 +020055%endif
56
57%description
58The Mobile Switching Center (MSC) is the heart of 2G/3G
59circuit-switched services. It terminates the A-interface links from the
60Base Station Controllers (BSC) and handles the MM and CC sub-layers of
61the Layer 3 protocol from the phones (MS).
62
63This Osmocom implementation of the MSC handles A interfaces via 3GPP
64AoIP in an ASP role. It furthermore implements IETF MGCP against an
65external media gateway, such as OsmoMGW. It does *not* implement MAP
66towards a HLR, but the much simpler Osmocom GSUP protocol, which can
67be translated to MAP if needed.
68
69%prep
70%setup -q
71
72%build
73echo "%{version}" >.tarball-version
74autoreconf -fi
75%configure \
76%if %{with_iu}
77 --enable-iu \
78%endif
Harald Welte5c38c812020-06-03 14:45:21 +020079 --enable-smpp \
Oliver Smithb0925892020-05-14 11:48:32 +020080 --docdir=%{_docdir}/%{name} \
81 --with-systemdsystemunitdir=%{_unitdir}
82
83make %{?_smp_mflags}
84
85%install
86%make_install
87
88%preun
Max62e16d32022-10-12 16:15:25 +030089%if 0%{?suse_version}
Oliver Smithb0925892020-05-14 11:48:32 +020090%service_del_preun %{name}.service
Max62e16d32022-10-12 16:15:25 +030091%endif
Oliver Smithb0925892020-05-14 11:48:32 +020092
93%postun
Max62e16d32022-10-12 16:15:25 +030094%if 0%{?suse_version}
Oliver Smithb0925892020-05-14 11:48:32 +020095%service_del_postun %{name}.service
Max62e16d32022-10-12 16:15:25 +030096%endif
Oliver Smithb0925892020-05-14 11:48:32 +020097
98%pre
Max62e16d32022-10-12 16:15:25 +030099getent group osmocom >/dev/null || groupadd --system osmocom
100getent passwd osmocom >/dev/null || useradd --system --gid osmocom --home-dir /var/lib/osmocom \
101 --shell /sbin/nologin --comment "Open Source Mobile Communications" osmocom
102%if 0%{?suse_version}
Oliver Smithb0925892020-05-14 11:48:32 +0200103%service_add_pre %{name}.service
Max62e16d32022-10-12 16:15:25 +0300104%endif
Oliver Smithb0925892020-05-14 11:48:32 +0200105
106%post
Max62e16d32022-10-12 16:15:25 +0300107%if 0%{?suse_version}
Oliver Smithb0925892020-05-14 11:48:32 +0200108%service_add_post %{name}.service
Oliver Smith03145932020-05-14 11:49:00 +0200109%endif
Max62e16d32022-10-12 16:15:25 +0300110chown osmocom:osmocom /etc/osmocom/osmo-msc.cfg
111chmod 0660 /etc/osmocom/osmo-msc.cfg
112chown root:osmocom /etc/osmocom
113chmod 2775 /etc/osmocom
Oliver Smith5a140652024-04-26 15:08:45 +0200114mkdir -p /var/lib/osmocom
115chown -R osmocom:osmocom /var/lib/osmocom
Oliver Smithb0925892020-05-14 11:48:32 +0200116
117%check
118make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
119
120%files
121%license COPYING
Harald Welte2eaaf6f2022-06-21 09:50:53 +0200122%doc AUTHORS README.md
Oliver Smithb0925892020-05-14 11:48:32 +0200123%dir %{_docdir}/%{name}/examples
124%dir %{_docdir}/%{name}/examples/osmo-msc
125%{_docdir}/%{name}/examples/osmo-msc/osmo-msc.cfg
126%{_docdir}/%{name}/examples/osmo-msc/osmo-msc_custom-sccp.cfg
127%{_docdir}/%{name}/examples/osmo-msc/osmo-msc_multi-cs7.cfg
128%{_bindir}/osmo-msc
129%{_unitdir}/%{name}.service
130%dir %{_sysconfdir}/osmocom
Harald Weltea4a45252020-06-22 14:21:37 +0200131%config(noreplace) %{_sysconfdir}/osmocom/osmo-msc.cfg
Oliver Smithb0925892020-05-14 11:48:32 +0200132
133%changelog