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/debian/control b/debian/control
index ec23133..2b8504a 100644
--- a/debian/control
+++ b/debian/control
@@ -34,6 +34,7 @@
          libosmocore19 (= ${binary:Version}),
          libosmogb14 (= ${binary:Version}),
          libosmogsm18 (= ${binary:Version}),
+         libosmoisdn0 (= ${binary:Version}),
          libosmovty9 (= ${binary:Version}),
          libosmoctrl0 (= ${binary:Version}),
          libosmosim2 (= ${binary:Version}),
@@ -141,6 +142,7 @@
          libosmocodec-doc,
          libosmocoding-doc,
          libosmogsm-doc,
+         libosmoisdn-doc,
          libosmovty-doc
 Description: Documentation for the Osmo Core library
  This is part of the libosmocore "meta"-library. The libosmocore library
@@ -218,6 +220,39 @@
  .
  This package contains the documentation for the libosmogsm library.
 
+Package: libosmoisdn0
+Section: libs
+Architecture: any
+Multi-Arch: same
+Depends: ${shlibs:Depends},
+         ${misc:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Description: Osmo ISDN utility library
+ This is part of the libosmocore "meta"-library. The libosmocore library
+ contains various utility functions that were originally developed as part of
+ the OpenBSC project, but which are of a more generic nature and thus useful to
+ (at least) other programs that are developed in the sphere of Free Software /
+ Open Source mobile communication.
+ .
+ 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: libosmoisdn-doc
+Architecture: all
+Section: doc
+Depends: ${misc:Depends},
+         libosmoisdn0,
+         libjs-jquery
+Description: Documentation for the Osmo ISDN utility library
+ This is part of the libosmocore "meta"-library. The libosmocore library
+ contains various utility functions that were originally developed as part of
+ the OpenBSC project, but which are of a more generic nature and thus useful to
+ (at least) other programs that are developed in the sphere of Free Software /
+ Open Source mobile communication.
+ .
+ This package contains the documentation for the libosmoisdnm library.
+
 Package: libosmovty9
 Section: libs
 Architecture: any
diff --git a/debian/copyright b/debian/copyright
index 31a2946..9281f03 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -36,7 +36,7 @@
 License: GPL-2+
 
 Files: src/gsm/gsm48_ie.c
-       src/gsm/lapd_core.c
+       src/isdn/lapd_core.c
        src/gsm/lapdm.c
 Copyright: 2008,2010-2011 Harald Welte <laforge@gnumonks.org>
            2009-2011      Andreas Eversberg <jolly@eversberg.eu>
diff --git a/debian/libosmocore.dirs b/debian/libosmocore.dirs
index 94090a3..9c10e3a 100644
--- a/debian/libosmocore.dirs
+++ b/debian/libosmocore.dirs
@@ -5,4 +5,5 @@
 usr/include/osmocom/core
 usr/include/osmocom/crypt
 usr/include/osmocom/gsm
+usr/include/osmocom/isdn
 usr/include/osmocom/vty
diff --git a/debian/libosmoisdn-doc.doc-base b/debian/libosmoisdn-doc.doc-base
new file mode 100644
index 0000000..bca6e1d
--- /dev/null
+++ b/debian/libosmoisdn-doc.doc-base
@@ -0,0 +1,7 @@
+Document: libosmoisdn-doc
+Title: Documentation for the libosmoisdn library
+Section: Programming
+
+Format: HTML
+Index: /usr/share/doc/libosmocore/isdn/html/index.html
+Files: /usr/share/doc/libosmocore/isdn/html/*.html
diff --git a/debian/libosmoisdn-doc.install b/debian/libosmoisdn-doc.install
new file mode 100644
index 0000000..9c98550
--- /dev/null
+++ b/debian/libosmoisdn-doc.install
@@ -0,0 +1 @@
+usr/share/doc/libosmocore/isdn/
diff --git a/debian/libosmoisdn0.install b/debian/libosmoisdn0.install
new file mode 100644
index 0000000..691a3e0
--- /dev/null
+++ b/debian/libosmoisdn0.install
@@ -0,0 +1 @@
+usr/lib/*/libosmoisdn*.so.*
diff --git a/debian/rules b/debian/rules
index f5b71eb..a96c893 100755
--- a/debian/rules
+++ b/debian/rules
@@ -50,6 +50,7 @@
 	$(RM) -r doc/core/
 	$(RM) -r doc/ctrl/
 	$(RM) -r doc/gsm/
+	$(RM) -r doc/isdn/
 	$(RM) -r doc/gb/
 	$(RM) -r doc/vty/html/
 	$(RM) -r doc/vty/latex/