1
0
forked from pool/osmo-ggsn
Jan Engelhardt 2017-12-28 00:35:20 +00:00 committed by Git OBS Bridge
commit 2f32687a40
8 changed files with 306 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

13
_service Normal file
View File

@ -0,0 +1,13 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">git://git.osmocom.org/osmo-ggsn</param>
<param name="revision">master</param>
<param name="versionformat">@PARENT_TAG@.@TAG_OFFSET@</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

125
build-fixes.diff Normal file
View File

@ -0,0 +1,125 @@
* stuff is in the wrong directory, move to sbin
* CFLAGS is abused for preprocessor, move to CPPFLAGS
* add missing $(LIBGTPNL_CFLAGS)
* ggsn includes libmnl.h but fails to PKG_CHECK for it;
turns out it only uses the header and no defs, so kill that.
* _DEPENDENCIES on files not generated by $this Makefile are pointless
* must use .la files in _LDADD/_LIBADD whenever they exist
* remove AC_PROG_CXX, the C++ is never used
---
ggsn/Makefile.am | 12 ++++++------
ggsn/gtp-kernel.c | 5 +----
gtp/Makefile.am | 3 ++-
lib/Makefile.am | 8 +++++---
sgsnemu/Makefile.am | 9 ++++-----
5 files changed, 18 insertions(+), 19 deletions(-)
Index: osmo-ggsn-1.0.0.30/ggsn/Makefile.am
===================================================================
--- osmo-ggsn-1.0.0.30.orig/ggsn/Makefile.am
+++ osmo-ggsn-1.0.0.30/ggsn/Makefile.am
@@ -1,17 +1,17 @@
-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)
+osmo_ggsn_LDADD = @EXEC_LDADD@ ../gtp/libgtp.la ../lib/libmisc.la $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS)
if ENABLE_GTP_KERNEL
-AM_CFLAGS += -DGTP_KERNEL
-osmo_ggsn_LDADD += -lgtpnl
+AM_CPPFLAGS += -DGTP_KERNEL ${LIBGTPNL_CFLAGS}
+osmo_ggsn_LDADD += ${LIBGTPNL_LIBS}
endif
-osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a
osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h gtp-kernel.h icmpv6.c icmpv6.h checksum.c checksum.h
if ENABLE_GTP_KERNEL
Index: osmo-ggsn-1.0.0.30/ggsn/gtp-kernel.c
===================================================================
--- osmo-ggsn-1.0.0.30.orig/ggsn/gtp-kernel.c
+++ osmo-ggsn-1.0.0.30/ggsn/gtp-kernel.c
@@ -17,8 +17,6 @@
#include <libgtpnl/gtp.h>
#include <libgtpnl/gtpnl.h>
-#include <libmnl/libmnl.h>
-
#include <errno.h>
#include <time.h>
@@ -30,8 +28,6 @@
#include <libgtpnl/gtp.h>
#include <libgtpnl/gtpnl.h>
-#include <libmnl/libmnl.h>
-
#include "gtp-kernel.h"
static void pdp_debug(struct pdp_t *pdp)
@@ -69,6 +65,7 @@ static void pdp_debug(struct pdp_t *pdp)
printf("\n");
}
+struct mnl_socket;
static struct {
int genl_id;
struct mnl_socket *nl;
Index: osmo-ggsn-1.0.0.30/gtp/Makefile.am
===================================================================
--- osmo-ggsn-1.0.0.30.orig/gtp/Makefile.am
+++ osmo-ggsn-1.0.0.30/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
Index: osmo-ggsn-1.0.0.30/lib/Makefile.am
===================================================================
--- osmo-ggsn-1.0.0.30.orig/lib/Makefile.am
+++ osmo-ggsn-1.0.0.30/lib/Makefile.am
@@ -1,7 +1,9 @@
-noinst_LIBRARIES = libmisc.a
+noinst_LTLIBRARIES = libmisc.la
noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h
-AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS)
+AM_CPPFLAGS = -DSBINDIR='"${sbindir}"' ${LIBOSMOCORE_CFLAGS}
+AM_CFLAGS = -fno-builtin -Wall
-libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c
+libmisc_la_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c
+libmisc_la_LIBADD = ${LIBOSMOCORE_LIBS}
Index: osmo-ggsn-1.0.0.30/sgsnemu/Makefile.am
===================================================================
--- osmo-ggsn-1.0.0.30.orig/sgsnemu/Makefile.am
+++ osmo-ggsn-1.0.0.30/sgsnemu/Makefile.am
@@ -1,9 +1,8 @@
-bin_PROGRAMS = sgsnemu
+sbin_PROGRAMS = sgsnemu
AM_LDFLAGS = @EXEC_LDFLAGS@
+AM_CPPFLAGS = -D_GNU_SOURCE -DSBINDIR='"$(sbindir)"' $(LIBOSMOCORE_CFLAGS)
+AM_CFLAGS = -O2 -fno-builtin -Wall -ggdb
-AM_CFLAGS = -O2 -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS)
-
-sgsnemu_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS)
-sgsnemu_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a
+sgsnemu_LDADD = @EXEC_LDADD@ ../gtp/libgtp.la ../lib/libmisc.la $(LIBOSMOCORE_LIBS)
sgsnemu_SOURCES = sgsnemu.c cmdline.c cmdline.h

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:94147ff40b089cd094e440b6d709e62b7b830bf563cd403d887b2b77b29d0e1b
size 112644

10
osmo-ggsn.changes Normal file
View File

@ -0,0 +1,10 @@
-------------------------------------------------------------------
Mon Oct 2 23:35:06 UTC 2017 - jengelh@inai.de
- Update to new upstream snapshot 1.0.0.30
-------------------------------------------------------------------
Sat Apr 29 01:21:17 UTC 2017 - jengelh@inai.de
- Initial package (version 0.93.7) for build.opensuse.org
- Add build-fixes.diff

11
osmo-ggsn.service Normal file
View File

@ -0,0 +1,11 @@
[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

120
osmo-ggsn.spec Normal file
View File

@ -0,0 +1,120 @@
#
# spec file for package osmo-ggsn
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#
Name: osmo-ggsn
Version: 1.0.0.30
Release: 0
Summary: GPRS Support Node
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
BuildRequires: libtool >= 2
BuildRequires: pkg-config >= 0.20
BuildRequires: systemd-rpm-macros
BuildRequires: xz
BuildRequires: pkgconfig(libgtpnl) >= 1.0.0
BuildRequires: pkgconfig(libmnl) >= 1.0.3
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}
%description
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
Summary: Library implementing GTP between SGSN and GGSN
License: GPL-2.0
Group: System/Libraries
%description -n libgtp1
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
%description -n libgtp-devel
libgtp implements the GPRS Tunneling Protocol between SGSN and GGSN.
This subpackage contains libraries and header files for developing
applications that want to make use of libgtp.
%prep
%setup -q
%patch -P 1 -p1
%build
autoreconf -fi
%configure --disable-static --includedir="%_includedir/%name" \
--enable-gtp-linux
make %{?_smp_mflags} V=1
%install
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"
%pre
%service_add_pre ggsn.service
%post
%service_add_post ggsn.service
%preun
%service_del_preun ggsn.service
%postun
%service_del_postun ggsn.service
%post -n libgtp1 -p /sbin/ldconfig
%postun -n libgtp1 -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
%files -n libgtp1
%defattr(-,root,root)
%_libdir/libgtp.so.1*
%files -n libgtp-devel
%defattr(-,root,root)
%_includedir/%name/
%_libdir/libgtp.so
%_libdir/pkgconfig/*.pc
%changelog