Add debian packaging rules

This allows us to package osmopy as debian package.

The package currently includes both the library as well as the
executables/scripts.  It might make sense to separate that into
a pure library package and an "utils" package

Related: SYS#3028
Change-Id: I332fb82d0e8dd09c5cf53caafa6a63297a8e3881
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..3bee65a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+osmo-python-tests (0.0.9) unstable; urgency=medium
+
+  * Initial package
+
+ -- Harald Welte <laforge@gnumonks.org>  Thu, 31 May 2019 10:33:31 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..f0df4c0
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,37 @@
+Source: osmo-python-tests
+Section: python
+Priority: optional
+Maintainer: Harald Welte <laforge@gnumonks.org>
+Build-Depends: debhelper (>= 9), python, dh-python, python-setuptools, python3, python3-setuptools
+Standards-Version: 3.9.8
+Homepage: http://git.osmocom.org/python/osmo-python-tests/
+Vcs-Git: git://git.osmocom.org/python/osmo-python-tests
+Vcs-Browser: http://git.osmocom.org/python/osmo-python-tests/
+
+Package: python2-osmopy-libs
+Architecture: all
+Depends: ${python:Depends}, ${misc:Depends}
+Description: Python code (not only) for testing of Osmocom programs
+ .
+ This package contains the Python 2 version of osmopy libraries.
+
+Package: python2-osmopy-utils
+Architecture: all
+Depends: ${python:Depends}, ${misc:Depends}, python2-osmopy-libs
+Description: Python code (not only) for testing of Osmocom programs
+ .
+ This package contains the Python 2 version of osmopy utils.
+
+Package: python3-osmopy-libs
+Architecture: all
+Depends: ${python3:Depends}, ${misc:Depends}
+Description: Python code (not only) for testing of Osmocom programs
+ .
+ This package contains the Python 3 version of osmopy libraries.
+
+Package: python3-osmopy-utils
+Architecture: all
+Depends: ${python3:Depends}, ${misc:Depends}, python3-osmopy-libs
+Description: Python code (not only) for testing of Osmocom programs
+ .
+ This package contains the Python 3 version of osmopy utils.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..22d0b8b
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,27 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: osmo-python-tests
+Source: http://git.osmocom.org/python/osmo-python-tests/
+
+Files: osmopy/obscvty.py
+Copyright: Copyright (C) 2012, 2013 Holger Hans Peter Freyther
+License: GPL-2+
+
+Files: osmopy/osmo_ipa.py
+Copyright: Copyright (C) 2016 sysmocom s.f.m.c. GmbH
+License: GPL-3+
+
+Files: osmopy/osmoutil.py
+Copyright: (C) 2013 by Katerina Barone-Adesi <kat.obsc@gmail.com>
+License: GPL-3+
+
+Files: osmopy/osmo_interact/*
+Copyright: (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
+License: GPL-3+
+
+Files: debian/*
+Copyright: 2018 Harald Welte <laforge@gnumonks.org>
+License: GPL-2+
+
+Files: setup.py
+Copyright: (C) 2013 by Katerina Barone-Adesi <kat.obsc@gmail.com>
+License: AGPL-3.0+
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..d9e98af
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,14 @@
+#!/usr/bin/make -f
+
+%:
+	dh $@ --with python2,python3
+
+override_dh_auto_install:
+	python2 setup.py install --install-layout=deb --root=$(CURDIR)/debian/python2-osmopy-libs
+	rm -rf $(CURDIR)/debian/python2-osmopy-libs/usr/bin
+	python2 setup.py install --install-layout=deb --root=$(CURDIR)/debian/python2-osmopy-utils
+	rm -rf $(CURDIR)/debian/python2-osmopy-utils/usr/lib
+	python3 setup.py install --install-layout=deb --root=$(CURDIR)/debian/python3-osmopy-libs
+	rm -rf $(CURDIR)/debian/python3-osmopy-libs/usr/bin
+	python3 setup.py install --install-layout=deb --root=$(CURDIR)/debian/python3-osmopy-utils
+	rm -rf $(CURDIR)/debian/python3-osmopy-utils/usr/lib
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)