summaryrefslogtreecommitdiff
path: root/packaging/deb/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/deb/Makefile')
-rw-r--r--packaging/deb/Makefile33
1 files changed, 33 insertions, 0 deletions
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