From 35f2bd60ae44b9e01f3f842b83f648f7db7c366c Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 21 Oct 2021 13:50:20 +0200 Subject: [PATCH] Provide libosmo-hnbap as a public shared library It is needed by the new osmo-hnodeb project. Related: SYS#5516 Change-Id: I0d0862e9d59d3b206f3f7dfae4b39ae4032bb762 --- Makefile.am | 2 +- configure.ac | 1 + contrib/osmo-iuh.spec.in | 23 +++++++++++++++++++++++ debian/control | 22 ++++++++++++++++++++++ debian/libosmo-hnbap-dev.install | 3 +++ debian/libosmo-hnbap0.install | 1 + debian/rules | 1 + include/osmocom/hnbap/Makefile.am | 4 +++- libosmo-hnbap.pc.in | 10 ++++++++++ src/Makefile.am | 15 ++++++++++----- src/hnbap/Makefile.am | 6 +++--- src/tests/Makefile.am | 10 ++++++---- 12 files changed, 84 insertions(+), 14 deletions(-) create mode 100644 debian/libosmo-hnbap-dev.install create mode 100644 debian/libosmo-hnbap0.install create mode 100644 libosmo-hnbap.pc.in diff --git a/Makefile.am b/Makefile.am index fd684e7e..1dc00d64 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 SUBDIRS = src include doc contrib pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libosmo-ranap.pc libosmo-sabp.pc +pkgconfig_DATA = libosmo-hnbap.pc libosmo-ranap.pc libosmo-sabp.pc EXTRA_DIST = \ .version \ diff --git a/configure.ac b/configure.ac index e2d9f566..93c5bb1a 100644 --- a/configure.ac +++ b/configure.ac @@ -150,6 +150,7 @@ AC_MSG_RESULT([CFLAGS="$CFLAGS"]) AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) AC_OUTPUT( + libosmo-hnbap.pc libosmo-ranap.pc libosmo-sabp.pc src/Makefile diff --git a/contrib/osmo-iuh.spec.in b/contrib/osmo-iuh.spec.in index c8bdea29..592b1684 100644 --- a/contrib/osmo-iuh.spec.in +++ b/contrib/osmo-iuh.spec.in @@ -42,6 +42,21 @@ BuildRequires: pkgconfig(libosmovty) >= 1.5.0 %description Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) +%package -n libosmo-hnbap0 +Summary: Shared Library part of libosmo-hnbap +Group: System/Libraries + +%description -n libosmo-hnbap0 +Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +%package -n libosmo-hnbap-devel +Summary: Development files for Osmocom HNBAP library +Group: Development/Libraries/C and C++ +Requires: libosmo-hnbap0 = %{version} + +%description -n libosmo-hnbap-devel +Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + %package -n libosmo-ranap3 Summary: Shared Library part of libosmo-ranap Group: System/Libraries @@ -121,6 +136,14 @@ make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +) %config %{_sysconfdir}/osmocom/osmo-hnbgw.cfg %{_unitdir}/osmo-hnbgw.service +%files -n libosmo-hnbap0 +%{_libdir}/libosmo-hnbap.so.0* + +%files -n libosmo-hnbap-devel +%{_includedir}/* +%{_libdir}/libosmo-hnbap.so +%{_libdir}/pkgconfig/libosmo-hnbap.pc + %files -n libosmo-ranap3 %{_libdir}/libosmo-ranap.so.3* diff --git a/debian/control b/debian/control index 236e8535..e13834f9 100644 --- a/debian/control +++ b/debian/control @@ -45,6 +45,28 @@ Description: ${misc:Package} PDF documentation Various manuals: user manual, VTY reference manual and/or protocol/interface manuals. +Package: libosmo-hnbap0 +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +Package: libosmo-hnbap-dbg +Section: debug +Architecture: any +Multi-Arch: same +Depends: libosmo-hnbap0 (= ${binary:Version}), ${misc:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + +Package: libosmo-hnbap-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libosmo-hnbap0 (= ${binary:Version}), ${misc:Depends} +Description: Osmocom code for the Iuh interface (HNBAP, RUA, RANAP) + Package: libosmo-ranap3 Section: libs Architecture: any diff --git a/debian/libosmo-hnbap-dev.install b/debian/libosmo-hnbap-dev.install new file mode 100644 index 00000000..4191a57d --- /dev/null +++ b/debian/libosmo-hnbap-dev.install @@ -0,0 +1,3 @@ +usr/include/osmocom/hnbap +usr/lib/*/libosmo-hnbap.so +usr/lib/*/pkgconfig/libosmo-hnbap.pc diff --git a/debian/libosmo-hnbap0.install b/debian/libosmo-hnbap0.install new file mode 100644 index 00000000..766f1f1d --- /dev/null +++ b/debian/libosmo-hnbap0.install @@ -0,0 +1 @@ +usr/lib/*/libosmo-hnbap*.so.* diff --git a/debian/rules b/debian/rules index e1f61242..714ef8bf 100755 --- a/debian/rules +++ b/debian/rules @@ -14,6 +14,7 @@ override_dh_auto_configure: # See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg override_dh_strip: + dh_strip -plibosmo-hnbap0 --dbg-package=libosmo-hnbap-dbg dh_strip -plibosmo-ranap3 --dbg-package=libosmo-ranap-dbg dh_strip -plibosmo-sabp0 --dbg-package=libosmo-sabp-dbg dh_strip -posmo-hnbgw --dbg-package=osmo-hnbgw-dbg diff --git a/include/osmocom/hnbap/Makefile.am b/include/osmocom/hnbap/Makefile.am index cd9b7203..871549e7 100644 --- a/include/osmocom/hnbap/Makefile.am +++ b/include/osmocom/hnbap/Makefile.am @@ -1,4 +1,4 @@ -noinst_HEADERS = \ +hnbap_HEADERS = \ hnbap_common.h hnbap_ies_defs.h \ AccessResult.h \ Access-stratum-release-indicator.h \ @@ -116,5 +116,7 @@ noinst_HEADERS = \ U-RNTIQueryResponse.h \ UTRANCellID.h +hnbapdir = $(includedir)/osmocom/hnbap + DISTCLEANFILES = \ hnbap_ies_defs.h diff --git a/libosmo-hnbap.pc.in b/libosmo-hnbap.pc.in new file mode 100644 index 00000000..db057566 --- /dev/null +++ b/libosmo-hnbap.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom HNBAP protocol library +Description: C Utility Library +Version: @VERSION@ +Libs: -L${libdir} -losmo-hnbap +Cflags: -I${includedir}/ diff --git a/src/Makefile.am b/src/Makefile.am index 524f7b2f..3414a011 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -61,9 +61,15 @@ AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \ # build the shared RANAP + SABP library # +HNBAP_LIBVERSION=0:0:0 RANAP_LIBVERSION=4:0:1 SABP_LIBVERSION=0:0:0 -lib_LTLIBRARIES = libosmo-ranap.la libosmo-sabp.la +lib_LTLIBRARIES = libosmo-hnbap.la libosmo-ranap.la libosmo-sabp.la +libosmo_hnbap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HNBAP_LIBVERSION) +libosmo_hnbap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ + $(ASN1C_LIBS) hnbap/libosmo-asn1-hnbap.la +libosmo_hnbap_la_SOURCES = hnbap_common.c hnbap_encoder.c hnbap_decoder.c + libosmo_ranap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(RANAP_LIBVERSION) libosmo_ranap_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOSIGTRAN_LIBS) \ $(ASN1C_LIBS) ranap/libosmo-asn1-ranap.la @@ -80,8 +86,7 @@ libosmo_sabp_la_SOURCES = sabp_common.c sabp_encoder.c sabp_decoder.c # bin_PROGRAMS = osmo-hnbgw -osmo_hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c hnbap_common.c \ - rua_encoder.c rua_decoder.c rua_common.c \ +osmo_hnbgw_SOURCES = rua_encoder.c rua_decoder.c rua_common.c \ rua_msg_factory.c \ hnbgw.c hnbgw_hnbap.c hnbgw_rua.c hnbgw_ranap.c \ hnbgw_vty.c \ @@ -90,8 +95,8 @@ osmo_hnbgw_SOURCES = hnbap_encoder.c hnbap_decoder.c hnbap_common.c \ osmo_hnbgw_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOVTY_LIBS) $(OSMOCTRL_LIBS) \ $(ASN1C_LIBS) $(OSMOSIGTRAN_LIBS) \ $(OSMONETIF_LIBS) \ - hnbap/libosmo-asn1-hnbap.a rua/libosmo-asn1-rua.a \ - libosmo-ranap.la + rua/libosmo-asn1-rua.a \ + libosmo-hnbap.la libosmo-ranap.la regen: regenerate-from-asn1-source diff --git a/src/hnbap/Makefile.am b/src/hnbap/Makefile.am index 8a2c56aa..c4a8c296 100644 --- a/src/hnbap/Makefile.am +++ b/src/hnbap/Makefile.am @@ -236,9 +236,9 @@ AM_CFLAGS = -I$(top_srcdir)/include $(ASN1C_CFLAGS) $(OSMOCORE_CFLAGS) HNBAP_ASN1 = $(top_srcdir)/asn1/hnbap -noinst_LIBRARIES=libosmo-asn1-hnbap.a -libosmo_asn1_hnbap_a_SOURCES=$(ASN_MODULE_SOURCES) -libosmo_asn1_hnbap_a_LIBADD=$(ASN1C_LDADD) +noinst_LTLIBRARIES=libosmo-asn1-hnbap.la +libosmo_asn1_hnbap_la_SOURCES=$(ASN_MODULE_SOURCES) +libosmo_asn1_hnbap_la_LIBADD=$(ASN1C_LDADD) regen: regenerate-from-asn1-source diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 003ea519..dfc8fe6b 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -11,17 +11,16 @@ check_PROGRAMS = test-ranap test-helpers test-hnbap hnb-test #dummy-cn noinst_HEADERS = test_common.h hnb-test.h hnb-test-layers.h -HNBAP_FILES = $(top_srcdir)/src/hnbap_common.c $(top_builddir)/src/hnbap_decoder.c $(top_builddir)/src/hnbap_encoder.c RUA_FILES = $(top_srcdir)/src/rua_common.c $(top_builddir)/src/rua_decoder.c $(top_builddir)/src/rua_encoder.c $(top_srcdir)/src/rua_msg_factory.c test_helpers_SOURCES = test-helpers.c test_common.c test_helpers_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la test_hnbap_SOURCES = $(top_srcdir)/src/hnbap_common.c $(top_builddir)/src/hnbap_decoder.c test-hnbap.c test_common.c -test_hnbap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/hnbap/libosmo-asn1-hnbap.a $(top_builddir)/src/libosmo-ranap.la +test_hnbap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-hnbap.la $(top_builddir)/src/libosmo-ranap.la -hnb_test_SOURCES = $(HNBAP_FILES) $(RUA_FILES) hnb-test.c test_common.c hnb-test-ranap.c hnb-test-rua.c -hnb_test_LDADD = $(COMMON_LIBS) $(top_builddir)/src/hnbap/libosmo-asn1-hnbap.a $(top_builddir)/src/rua/libosmo-asn1-rua.a $(top_builddir)/src/libosmo-ranap.la +hnb_test_SOURCES = $(RUA_FILES) hnb-test.c test_common.c hnb-test-ranap.c hnb-test-rua.c +hnb_test_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-hnbap.la $(top_builddir)/src/rua/libosmo-asn1-rua.a $(top_builddir)/src/libosmo-ranap.la test_ranap_SOURCES = test-ranap.c test_common.c test_ranap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la @@ -30,6 +29,9 @@ test_ranap_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la #dummy_cn_SOURCES = test_common.c dummy_cn_sua.c #dummy_cn_LDADD = $(COMMON_LIBS) $(top_builddir)/src/libosmo-ranap.la +$(top_builddir)/src/libosmo-hnbap.la: + $(MAKE) -C $(top_builddir)/src libosmo-hnbap.la + $(top_builddir)/src/libosmo-ranap.la: $(MAKE) -C $(top_builddir)/src libosmo-ranap.la