WIP: packaging

Change-Id: Ic55bca1260f992d0ed8583e7c7fe948ba0160d4d
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..d36875a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+osmo-diameter2gsup (0.0.1) UNRELEASED; urgency=medium
+
+  * Initial release. (Closes: #XXXXXX)
+
+ -- Harald Welte <lafore@gnumonks.org>  Tue, 12 Jul 2022 17:51:01 +0200
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..f0bde73
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,23 @@
+Source: osmo-diameter2gsup
+Maintainer: Osmocom Community <openbsc@lists.osmocom.org>
+Section:
+Priority: optional
+Build-Depends:  rebar3,
+		erlang-base,
+		erlang-eunit
+Standards-Version: 3.9.8
+#Vcs-Browser:
+#Vcs-Git:
+#Homepage:
+
+Package: osmo-diameter2gsup
+Architecture: any
+Depends: ${shlibs:Depends},
+	 ${misc:Depends},
+	 erlang-bsae, ${erlang-abi:Depends},
+	 ${erlang:Depends}
+Multi-Arch: allowed
+Description: Osmocom DIAMETER to GSUP translator
+ This can be used to translate DIAMETER requests (such as those by an EPC)
+ to the Osmocom specific GSUP protocol, which means you can use OsmoHLR
+ as a simplistic HSS.
diff --git a/debian/dh-rebar.conf b/debian/dh-rebar.conf
new file mode 100644
index 0000000..dfbf2ab
--- /dev/null
+++ b/debian/dh-rebar.conf
@@ -0,0 +1 @@
+EXEC_REBAR_COMMANDS=compile eunit
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..6093c5d
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,44 @@
+#!/usr/bin/make -f
+export DH_VERBOSE=1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+include /usr/share/dpkg/default.mk
+export ERL_COMPILER_OPTIONS=deterministic
+
+BUILD_TARGET=rebar_compile
+TEST_TARGET=rebar_eunit
+
+.PHONY: build clean test install configure
+
+clean_debhelper:
+	$(H)$(call empty_trash)
+	$(H)$(RM) -rf debian/trash
+
+
+build: $(BUILD_TARGET)
+
+test: $(TEST_TARGET)
+
+configure:
+
+clean: clean_debhelper
+	$(H)echo $@
+	rebar3 clean skip_deps=true -vv
+	$(H)rm -rf ebin/*.beam
+	$(H)rm -rf ebin/*.app
+	$(H)rm -rf c_src/*.o
+	$(H)rm -rf priv/.so
+	$(H)rm -rf .eunit
+
+rebar_compile:
+	$(H)echo $@
+	rebar3 compile skip_deps=true -vv
+
+binary:
+	$(H)echo $@
+	rebar3 escriptize
+
+install:
+	$(H)echo $@
+	$(H)$(call trash, $(DEB_INST_PKG))
+	$(H)install -d
+