summaryrefslogtreecommitdiff
path: root/packaging/deb/Makefile
blob: dd8bf0a7c7eb5de3b23c58ac903b1b1250031b9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
VERSION=1.0

# 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