create libosmoisdn sub-library

There are some parts of libosmogsm which are not really GSM specific,
but rather ISDN bits that were inherited by GSM.  This includes the
I.460 multiplex as well as the core LAPD protocol.

Let's move those bits to its own libosmoisdn library, before we add
more ISDN specific bits to the wrong place.

Backwards-compatibility is created by making libosmogsm depend on
libosmoisdn, and by providing wrapper include files for source
compatibility.

Change-Id: Ib1a6c762322fd5047be3188b1df22408ef06aa50
diff --git a/contrib/libosmocore.spec.in b/contrib/libosmocore.spec.in
index 208f42d..14e8a7e 100644
--- a/contrib/libosmocore.spec.in
+++ b/contrib/libosmocore.spec.in
@@ -211,6 +211,8 @@
 Group:          Development/Libraries/C and C++
 Requires:       libosmocore-devel = %version
 Requires:       libosmogsm18 = %version
+Requires:       libosmoisdn-devel = %version
+Requires:       libosmoisdn0 = %version
 
 %description -n libosmogsm-devel
 The libosmogsm library in particular is a collection of common code
@@ -222,6 +224,34 @@
 This subpackage contains libraries and header files for developing
 applications that want to make use of libosmogsm.
 
+%package -n libosmoisdn0
+Summary:        Osmocom ISDN utility library
+License:        GPL-2.0-or-later
+Group:          System/Libraries
+
+%description -n libosmoisdn0
+libosmocore is a package with various utility functions that were
+originally developed as part of the OpenBSC project.
+
+The libosmoisdn library in particular is a collection of common code used in
+various ISDN related sub-projects inside the Osmocom family of projects. It
+includes an I.460 sub-channel multiplex and a generic LAPD core.
+
+%package -n libosmoisdn-devel
+Summary:        Development files for the Osmocom ISDN utility library
+License:        GPL-2.0-or-later
+Group:          Development/Libraries/C and C++
+Requires:       libosmocore-devel = %version
+Requires:       libosmoisdn0 = %version
+
+%description -n libosmoisdn-devel
+The libosmoisdn library in particular is a collection of common code used in
+various ISDN related sub-projects inside the Osmocom family of projects. It
+includes an I.460 sub-channel multiplex and a generic LAPD core.
+
+This subpackage contains libraries and header files for developing
+applications that want to make use of libosmogsm.
+
 %package -n libosmosim2
 Summary:        Osmocom SIM card related utility library
 License:        GPL-2.0-or-later
@@ -332,6 +362,8 @@
 %postun -n libosmogb14 -p /sbin/ldconfig
 %post   -n libosmogsm18 -p /sbin/ldconfig
 %postun -n libosmogsm18 -p /sbin/ldconfig
+%post   -n libosmoisdn0 -p /sbin/ldconfig
+%postun -n libosmoisdn0 -p /sbin/ldconfig
 %post   -n libosmosim2 -p /sbin/ldconfig
 %postun -n libosmosim2 -p /sbin/ldconfig
 %post   -n libosmovty9 -p /sbin/ldconfig
@@ -418,6 +450,18 @@
 %_libdir/libosmogsm.so
 %_libdir/pkgconfig/libosmogsm.pc
 
+%files -n libosmoisdn0
+%defattr(-,root,root)
+%_libdir/libosmoisdn.so.0*
+
+%files -n libosmoisdn-devel
+%defattr(-,root,root)
+%dir %_includedir/%name
+%dir %_includedir/%name/osmocom
+%_includedir/%name/osmocom/isdn/
+%_libdir/libosmoisdn.so
+%_libdir/pkgconfig/libosmoisdn.pc
+
 %files -n libosmosim2
 %defattr(-,root,root)
 %_libdir/libosmosim.so.2*