-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (21 loc) · 1022 Bytes
/
Makefile
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
BASE_NAME=axfrnotify
BIN_NAME=axfrnotify
all:
@echo 'Example: BIN_DIR=../$(BASE_NAME)/target/debug ARCH=amd64 VERSION=0.1.0-alpha-3 TAG=$VERSION DIST=trusty make package'
package: $(BASE_NAME)-$(VERSION)-$(DIST)-$(ARCH).deb
$(BASE_NAME)-$(VERSION)-$(DIST)-$(ARCH).deb: $(BASE_NAME)/DEBIAN/control $(BASE_NAME)/usr/bin/$(BIN_NAME)
dpkg-deb -b $(BASE_NAME) $@
dpkg-deb -I $@
clean:
-rm -fR $(BASE_NAME)/DEBIAN
-rm -fR $(BASE_NAME)/usr
-rmdir $(BASE_NAME)
-rm $(BASE_NAME)-$(VERSION)-$(DIST)-$(ARCH).deb
$(BASE_NAME)/DEBIAN/control: templates/DEBIAN/control $(BASE_NAME)/usr/bin/$(BIN_NAME) $(BASE_NAME)/DEBIAN
SIZE=`du -s $(BASE_NAME)/usr/bin/$(BIN_NAME) | awk '{ print $$1}'`; SAN_VERSION=`echo $$VERSION | sed 's/^[a-z]*//'`; sed "s/@@PACKAGE_NAME@@/$(BASE_NAME)/; s/@@VERSION@@/$${SAN_VERSION}/; s/@@ARCH@@/$(ARCH)/; s/@@SIZE@@/$${SIZE}/" $< > $@
$(BASE_NAME)/usr/bin/$(BIN_NAME): $(BIN_DIR)/$(BIN_NAME) $(BASE_NAME)/usr/bin
cp $< $@
$(BASE_NAME)/usr/bin:
mkdir -p $@
$(BASE_NAME)/DEBIAN:
mkdir -p $@