debian: add packaging

Add initial debian packaging and a systemd service that starts
osmo_dia2gsup. Given that dependencies listed in rebar.lock are not
packaged in debian 11, this just uses rebar3 to download and compile
the dependencies during the build.

Resulting erlang files are installed to the following path, where they
become available in the erlang shell (erl):
  /lib/erlang/lib/{name_of_component}/ebin/

Related: SYS#6006
Change-Id: Ic55bca1260f992d0ed8583e7c7fe948ba0160d4d
This commit is contained in:
Oliver Smith 2022-07-14 12:37:13 +02:00
parent 9491cf41d0
commit 173095f9fa
8 changed files with 64 additions and 0 deletions

6
.gitignore vendored
View File

@ -9,3 +9,9 @@ erl_crash.dump
src/diameter_3gpp* src/diameter_3gpp*
src/diameter_rfc* src/diameter_rfc*
src/diameter_etsi* src/diameter_etsi*
/debian/*.debhelper
/debian/files
/debian/osmo-diameter2gsup.substvars
/debian/osmo-diameter2gsup/
/debian/debhelper-build-stamp

View File

@ -0,0 +1,14 @@
[Unit]
Description=Osmocom DIAMETER to GSUP translator
After=osmo-hlr.service
[Service]
Type=simple
Restart=always
Environment="HOME=/var/lib/osmo_dia2gsup"
ExecStartPre=/usr/bin/mkdir -p /var/lib/osmo_dia2gsup
ExecStart=/usr/bin/erl -noshell -sname osmo_dia2gsup -eval "osmo_dia2gsup:start()."
RestartSec=2
[Install]
WantedBy=multi-user.target

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
osmo-diameter2gsup (0.1.0) unstable; urgency=medium
* Initial release.
-- Oliver Smith <osmith@sysmocom.de> Wed, 14 Jul 2022 14:51:01 +0200

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
10

17
debian/control vendored Normal file
View File

@ -0,0 +1,17 @@
Source: osmo-diameter2gsup
Maintainer: Osmocom Community <openbsc@lists.osmocom.org>
Section: net
Priority: optional
Build-Depends: erlang-nox,
libpcap-dev,
rebar3,
Standards-Version: 4.5.0
Package: osmo-diameter2gsup
Architecture: any
Depends: erlang-nox
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.

2
debian/osmo-diameter2gsup.install vendored Normal file
View File

@ -0,0 +1,2 @@
/contrib/systemd/osmo_dia2gsup.service /lib/systemd/system/
/_lib/* /usr/lib/erlang/lib/

18
debian/rules vendored Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/make -f
build:
rebar3 compile
rebar3 escriptize
rebar3 eunit
for i in _build/default/lib/*; do \
libdir=_lib/"$$(basename "$$i")"; \
mkdir -pv "$$libdir"; \
cp -rv "$$i/ebin" "$$libdir"; \
done
find _lib -name .empty -delete
clean:
rm -rf _build _lib
%:
dh $@

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (native)