summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriele Santomaggio <G.santomaggio@gmail.com>2016-02-04 09:02:10 +0100
committerGabriele Santomaggio <G.santomaggio@gmail.com>2016-02-04 09:02:10 +0100
commitff9db16f85e29664822b0f8f434cd1cdfed9db5f (patch)
treeee4be514d7aff9ed5da7c731e006141b386b0f9e
parent19a0501c35ef2b93cd0bd2f440bc1c26c0e8967a (diff)
parentd8f535e5d380e92ce5ed4f0775c941aa19a6683b (diff)
downloaderlang-sd_notify-ff9db16f85e29664822b0f8f434cd1cdfed9db5f.tar.gz
Merge pull request #1 from jan-grant/master
Update the CentOS build for sd_notify to support Debian.
-rw-r--r--.gitignore1
-rw-r--r--Makefile3
-rw-r--r--README.md23
-rw-r--r--packaging/deb/Makefile33
-rw-r--r--packaging/deb/debian/changelog5
-rw-r--r--packaging/deb/debian/compat1
-rw-r--r--packaging/deb/debian/control16
-rw-r--r--packaging/deb/debian/erlang-sd-notify.dirs2
-rw-r--r--packaging/deb/debian/rules6
-rw-r--r--packaging/deb/debian/source/format1
10 files changed, 89 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 19f4bd6..ff4c2e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@
*.o
*.so
.eunit/
+deb-build
ebin/
diff --git a/Makefile b/Makefile
index dfeaa69..d1dd742 100644
--- a/Makefile
+++ b/Makefile
@@ -15,3 +15,6 @@ clean:
dialyzer:
$(REBAR) dialyze $(REBAR_FLAGS)
+
+deb:
+ cd packaging/deb && $(MAKE) TOPDIR=$(PWD) deb
diff --git a/README.md b/README.md
index 4ede017..1ce14d9 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-`sd_notify` Erlang interface for Centos 7.
+`sd_notify` Erlang interface for Centos 7 and Debian
---
-This add the `sd_notify` to the Centos erlang package.
+This adds the `sd_notify` to the Centos erlang package.
I tested it starting for zero-dependencies RabbitMQ package ([github](https://github.com/rabbitmq/erlang-rpm) - [binany](https://www.rabbitmq.com/releases/erlang/) )
Build from source
@@ -38,3 +38,22 @@ RabbitMQ notes:
RabbitMQ does not need `sd_notify`,.
This add the feature for the users that in general need `sd_notify`.
The integration should be considerer as **experimental**
+
+
+Building on Debian
+-
+Install the pre-requisites to the build:
+
+ sudo apt-get install build-essential devscripts fakeroot \
+ debhelper erlang-dev libsystemd-dev erlang-eunit
+
+Make the package:
+
+ make deb
+
+Install and test:
+
+ sudo dpkg -i deb-build/erlang-sd-notify_0.9-1_amd64.deb
+ erl
+ 1> sd_notify:sd_notify(0,"READY=1").
+ ok
diff --git a/packaging/deb/Makefile b/packaging/deb/Makefile
new file mode 100644
index 0000000..a64ecce
--- /dev/null
+++ b/packaging/deb/Makefile
@@ -0,0 +1,33 @@
+VERSION=0.9
+
+# Directory names
+DEB_BUILD_DIR=deb-build
+PKG_NAME=erlang-sd-notify
+DEB_SOURCE_DIR=$(PKG_NAME)-$(VERSION)
+
+#
+PKG_DEST=$(TOPDIR)/$(DEB_BUILD_DIR)/$(DEB_SOURCE_DIR)
+
+# Where to build the 'pristine' source files
+TARBALL_DIR=$(TOPDIR)/$(DEB_BUILD_DIR)
+SOURCE_TGZ=$(PKG_NAME)_$(VERSION).orig.tar.gz
+
+# Place to install the compiled files to
+TARGET_DIR=$(TARGET_TOP)/usr/lib/erlang/lib/sd_notify-$(VERSION)
+
+deb:
+ mkdir -p $(PKG_DEST)
+ tar -c -C $(TOPDIR) --exclude-from=$(TOPDIR)/.gitignore --exclude=.git . | tar -x -C $(PKG_DEST)
+ tar -zcf $(TARBALL_DIR)/$(SOURCE_TGZ) -C $(TARBALL_DIR) $(DEB_SOURCE_DIR)
+
+ tar -c debian | tar -x -C $(PKG_DEST)
+ cp $(TOPDIR)/LICENSE $(PKG_DEST)/debian/copyright
+ sed -i 's/%VERSION%/$(VERSION)/g' $(PKG_DEST)/debian/$(PKG_NAME).dirs
+
+ cd $(PKG_DEST) && debuild -us -uc
+
+deb-install:
+ pwd
+ install -o root -g root -t $(TARGET_DIR)/ebin ../../ebin/*.app
+ install -o root -g root -t $(TARGET_DIR)/ebin ../../ebin/*.beam
+ install -o root -g root -t $(TARGET_DIR)/priv ../../priv/*.so
diff --git a/packaging/deb/debian/changelog b/packaging/deb/debian/changelog
new file mode 100644
index 0000000..06a2eb2
--- /dev/null
+++ b/packaging/deb/debian/changelog
@@ -0,0 +1,5 @@
+erlang-sd-notify (0.9-1) UNRELEASED; urgency=medium
+
+ * Initial release.
+
+ -- Maintainer Name <you@example.com> Wed, 03 Feb 2016 14:43:18 +0000
diff --git a/packaging/deb/debian/compat b/packaging/deb/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/packaging/deb/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/packaging/deb/debian/control b/packaging/deb/debian/control
new file mode 100644
index 0000000..db6448e
--- /dev/null
+++ b/packaging/deb/debian/control
@@ -0,0 +1,16 @@
+Source: erlang-sd-notify
+Maintainer: <you@example.com>
+Section: misc
+Priority: optional
+Standards-Version: 3.9.2
+Build-Depends: debhelper (>= 9),
+ erlang-dev (>=17.3-dfsg-4),
+ libsystemd-dev (>=215),
+ rebar,
+
+Package: erlang-sd-notify
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ erlang-base (>=17.3) | erlang-base-hipe (>=17.3),
+ libsystemd0 (>=215),
+Description: Systemd notification support for Erlang.
diff --git a/packaging/deb/debian/erlang-sd-notify.dirs b/packaging/deb/debian/erlang-sd-notify.dirs
new file mode 100644
index 0000000..1b9362c
--- /dev/null
+++ b/packaging/deb/debian/erlang-sd-notify.dirs
@@ -0,0 +1,2 @@
+usr/lib/erlang/lib/sd_notify-%VERSION%/ebin
+usr/lib/erlang/lib/sd_notify-%VERSION%/priv
diff --git a/packaging/deb/debian/rules b/packaging/deb/debian/rules
new file mode 100644
index 0000000..bca2f41
--- /dev/null
+++ b/packaging/deb/debian/rules
@@ -0,0 +1,6 @@
+#!/usr/bin/make -f
+%:
+ dh $@
+
+override_dh_auto_install:
+ make -C packaging/deb TARGET_TOP=$(PWD)/debian/erlang-sd-notify deb-install
diff --git a/packaging/deb/debian/source/format b/packaging/deb/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/packaging/deb/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)