diff --git a/0001-fix-compiler-warnings-return-0-in-main-in-3-tests.patch b/0001-fix-compiler-warnings-return-0-in-main-in-3-tests.patch new file mode 100644 index 0000000..f72c165 --- /dev/null +++ b/0001-fix-compiler-warnings-return-0-in-main-in-3-tests.patch @@ -0,0 +1,45 @@ +From dabb8b4860199a44401fa436f5fcd56eb3d09512 Mon Sep 17 00:00:00 2001 +From: Neels Hofmeyr +Date: Sun, 29 Oct 2017 01:53:50 +0200 +Subject: [PATCH] fix compiler warnings: return 0 in main(), in 3 tests + +Change-Id: I9e49ceba6b0a8dffd331e5707667d9bb007f3ec7 +--- + tests/gtp/gtpie_test.c | 1 + + tests/lib/in46a_test.c | 1 + + tests/lib/ippool_test.c | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/tests/gtp/gtpie_test.c b/tests/gtp/gtpie_test.c +index fe2d502..8d87dcc 100644 +--- a/tests/gtp/gtpie_test.c ++++ b/tests/gtp/gtpie_test.c +@@ -124,4 +124,5 @@ int main(int argc, char **argv) + /* TODO: gtpie_encaps() */ + /* TODO: gtpie_encaps2() */ + /* TODO: gtpie_getie(), gtpie_exist(), gtpie_get*() */ ++ return 0; + } +diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c +index 42a1768..ab7156f 100644 +--- a/tests/lib/in46a_test.c ++++ b/tests/lib/in46a_test.c +@@ -321,4 +321,5 @@ int main(int argc, char **argv) + test_in46a_to_eua(); + test_in46a_from_eua(); + test_in46a_netmasklen(); ++ return 0; + } +diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c +index ea56edd..5b3227c 100644 +--- a/tests/lib/ippool_test.c ++++ b/tests/lib/ippool_test.c +@@ -130,4 +130,5 @@ int main(int argc, char **argv) + srand(time(NULL)); + + test_pool_sizes(); ++ return 0; + } +-- +2.13.6 + diff --git a/build-fixes2.diff b/build-fixes2.diff new file mode 100644 index 0000000..95b40b8 --- /dev/null +++ b/build-fixes2.diff @@ -0,0 +1,47 @@ +diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am +index 8a468a9..0d8d8ff 100644 +--- a/ggsn/Makefile.am ++++ b/ggsn/Makefile.am +@@ -1,8 +1,9 @@ +-bin_PROGRAMS = osmo-ggsn ++sbin_PROGRAMS = osmo-ggsn + + AM_LDFLAGS = @EXEC_LDFLAGS@ + +-AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) ++AM_CPPFLAGS = -D_GNU_SOURCE -DSBINDIR='"${sbindir}"' ${LIBOSMOCORE_CFLAGS} ${LIBOSMOCTRL_CFLAGS} ${LIBOSMOVTY_CFLAGS} ++AM_CFLAGS = -fno-builtin -Wall + + osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) + +diff --git a/gtp/Makefile.am b/gtp/Makefile.am +index 7a0ff0a..211abc3 100644 +--- a/gtp/Makefile.am ++++ b/gtp/Makefile.am +@@ -6,7 +6,8 @@ lib_LTLIBRARIES = libgtp.la + + include_HEADERS = gtp.h pdp.h gtpie.h + +-AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) ++AM_CPPFLAGS = -DSBINDIR='"$(sbindir)"' $(LIBOSMOCORE_CFLAGS) ++AM_CFLAGS = -O2 -fno-builtin -Wall -ggdb + + libgtp_la_SOURCES = gtp.c gtp.h gtpie.c gtpie.h pdp.c pdp.h lookupa.c lookupa.h queue.c queue.h + libgtp_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined +diff --git a/sgsnemu/Makefile.am b/sgsnemu/Makefile.am +index 4d02eca..32df2a3 100644 +--- a/sgsnemu/Makefile.am ++++ b/sgsnemu/Makefile.am +@@ -1,8 +1,10 @@ +-bin_PROGRAMS = sgsnemu ++sbin_PROGRAMS = sgsnemu + + AM_LDFLAGS = @EXEC_LDFLAGS@ + +-AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS) ++AM_CPPFLAGS = -D_GNU_SOURCE -DSBINDIR='"$(sbindir)"' $(LIBOSMOCORE_CFLAGS) ++AM_CFLAGS = -O2 -fno-builtin -Wall -ggdb ++ + + sgsnemu_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) + sgsnemu_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a diff --git a/osmo-ggsn.changes b/osmo-ggsn.changes index 0807480..412101d 100644 --- a/osmo-ggsn.changes +++ b/osmo-ggsn.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Fri Dec 29 16:38:27 UTC 2017 - mardnh@gmx.de + +- Use systemd service file from tarball +- Fix URL +- Use correct libversion +- Minor specfile cleanup +- Disable kernel-gtp support +- Do not apply patch (broken in some parts) + - build-fixes.diff +- Add patch: + - build-fixes2.diff + - 0001-fix-compiler-warnings-return-0-in-main-in-3-tests.patch + ------------------------------------------------------------------- Thu Dec 28 00:36:08 UTC 2017 - jengelh@inai.de diff --git a/osmo-ggsn.service b/osmo-ggsn.service deleted file mode 100644 index d784b9f..0000000 --- a/osmo-ggsn.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Gateway GPRS Support Node -After=network.target -Documentation=man:ggsn(8) -ConditionFileNotEmpty=/etc/openggsn/ggsn.conf - -[Service] -ExecStart=/usr/sbin/ggsn -fc /etc/openggsn/ggsn.conf - -[Install] -WantedBy=multi-user.target diff --git a/osmo-ggsn.spec b/osmo-ggsn.spec index 3ad3bf1..a4ad857 100644 --- a/osmo-ggsn.spec +++ b/osmo-ggsn.spec @@ -20,14 +20,15 @@ Name: osmo-ggsn Version: 1.1.0 Release: 0 Summary: GPRS Support Node -License: GPL-2.0 and LGPL-2.1+ +License: GPL-2.0 AND LGPL-2.1+ Group: Productivity/Telephony/Servers -Url: http://sourceforge.net/projects/ggsn/ -Source: %name-%version.tar.xz -Source2: osmo-ggsn.service -Patch1: build-fixes.diff +URL: https://osmocom.org/projects/openggsn/wiki/OsmoGGSN +Source: %{name}-%{version}.tar.xz +#Patch1: build-fixes.diff +Patch2: build-fixes2.diff +Patch3: 0001-fix-compiler-warnings-return-0-in-main-in-3-tests.patch BuildRequires: libtool >= 2 -BuildRequires: pkg-config >= 0.20 +BuildRequires: pkgconfig >= 0.20 BuildRequires: systemd-rpm-macros BuildRequires: xz BuildRequires: pkgconfig(libgtpnl) >= 1.0.0 @@ -36,7 +37,6 @@ BuildRequires: pkgconfig(libosmocore) >= 0.6.4 BuildRequires: pkgconfig(libosmoctrl) BuildRequires: pkgconfig(libosmogsm) BuildRequires: pkgconfig(libosmovty) >= 0.3.0 -BuildRoot: %{_tmppath}/%{name}-%{version}-build Obsoletes: openggsn %{?systemd_requires} @@ -45,19 +45,19 @@ Osmo-GGSN is a C-language implementation of a GGSN (Gateway GPRS Support Node), a core network element of ETSI/3GPP cellular networks such as GPRS, EDGE, UMTS or HSPA. -%package -n libgtp1 +%package -n libgtp2 Summary: Library implementing GTP between SGSN and GGSN License: GPL-2.0 Group: System/Libraries -%description -n libgtp1 +%description -n libgtp2 libgtp implements the GPRS Tunneling Protocol between SGSN and GGSN. %package -n libgtp-devel Summary: Development files for the GTP library License: GPL-2.0 Group: Development/Libraries/C and C++ -Requires: libgtp1 = %version +Requires: libgtp2 = %{version} %description -n libgtp-devel libgtp implements the GPRS Tunneling Protocol between SGSN and GGSN. @@ -67,54 +67,65 @@ applications that want to make use of libgtp. %prep %setup -q -%patch -P 1 -p1 +#%%patch -P 1 -p1 +%patch2 -p1 +%patch3 -p1 %build +echo "%{version}" >.tarball-version autoreconf -fi -%configure --disable-static --includedir="%_includedir/%name" \ - --enable-gtp-linux +%configure \ + --disable-static \ + --docdir=%{_docdir}/%{name} \ + --includedir="%{_includedir}/%{name}" make %{?_smp_mflags} V=1 %install -b="%buildroot" +b=%{buildroot} %make_install -rm -f "$b/%_libdir"/*.la -mkdir -p "$b/%_localstatedir/lib/ggsn" -echo 0 >"$b/%_localstatedir/lib/ggsn/gsn_restart" -install -Dm0644 "%{S:2}" "$b/%_unitdir/ggsn.service" +find %{buildroot} -type f -name "*.la" -delete -print +install -D -m 0644 contrib/osmo-ggsn.service "$b/%{_unitdir}/%{name}.service" +install -d %{buildroot}/%{_sbindir} +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} +install -d %{buildroot}%{_sysconfdir}/osmocom +install -m 0644 doc/examples/osmo-ggsn.cfg %{buildroot}%{_sysconfdir}/osmocom/osmo-ggsn.cfg +install -m 0644 doc/examples/sgsnemu.conf %{buildroot}%{_sysconfdir}/osmocom/sgsnemu.conf %pre -%service_add_pre ggsn.service +%service_add_pre %{name}.service %post -%service_add_post ggsn.service +%service_add_post %{name}.service %preun -%service_del_preun ggsn.service +%service_del_preun %{name}.service %postun -%service_del_postun ggsn.service +%service_del_postun %{name}.service -%post -n libgtp1 -p /sbin/ldconfig -%postun -n libgtp1 -p /sbin/ldconfig +%post -n libgtp2 -p /sbin/ldconfig +%postun -n libgtp2 -p /sbin/ldconfig %files -%defattr(-,root,root) -%doc COPYING NEWS README.md examples/ggsn.conf examples/sgsnemu.conf -%_sbindir/ggsn -%_sbindir/sgsnemu -%_mandir/man8/*.8* -%_localstatedir/lib/ggsn/ -%_unitdir/ggsn.service +%doc AUTHORS COPYING README.md +%{_sbindir}/osmo-ggsn +%{_sbindir}/sgsnemu +%{_mandir}/man8/osmo-ggsn.8%{ext_man} +%{_mandir}/man8/sgsnemu.8%{ext_man} +%{_unitdir}/%{name}.service +%{_sbindir}/rc%{name} +%dir %{_docdir}/%{name}/examples +%{_docdir}/%{name}/examples/osmo-ggsn.cfg +%dir %{_sysconfdir}/osmocom +%config(noreplace) %{_sysconfdir}/osmocom/osmo-ggsn.cfg +%config(noreplace) %{_sysconfdir}/osmocom/sgsnemu.conf -%files -n libgtp1 -%defattr(-,root,root) -%_libdir/libgtp.so.1* +%files -n libgtp2 +%{_libdir}/libgtp.so.2* %files -n libgtp-devel -%defattr(-,root,root) -%_includedir/%name/ -%_libdir/libgtp.so -%_libdir/pkgconfig/*.pc +%{_includedir}/%{name}/ +%{_libdir}/libgtp.so +%{_libdir}/pkgconfig/libgtp.pc %changelog