summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-05-29 12:13:33 -0400
committerAndrew Cady <d@jerkface.net>2020-05-29 12:17:29 -0400
commitb5dcd1d2803047f21363fc7f5128c70ffc4c3a82 (patch)
tree28960873e7e36f148de136ce2b22f6b02457ff09 /src
parentb03e239f21f86fd5f05ea946aa71e1e305387a7c (diff)
use config.mk
Diffstat (limited to 'src')
-rw-r--r--src/control.mk5
-rw-r--r--src/equivs.mk19
2 files changed, 11 insertions, 13 deletions
diff --git a/src/control.mk b/src/control.mk
index a0bba6e..42760c5 100644
--- a/src/control.mk
+++ b/src/control.mk
@@ -1,9 +1,6 @@
1clean-equivs:
2 rm -f control equivs-stamp
3 1
4control_files := $(wildcard control.d/*.control) 2control_files := $(wildcard control.d/*.control)
5control: src/control.sh $(control_files) .git/refs/heads/master 3control: src/control.sh $(control_files) .git/refs/heads/master
6 ./src/control.sh $(control_files) > $@ 4 ./src/control.sh $(control_files) > $@
7include src/equivs.mk
8
9 5
6include src/equivs.mk
diff --git a/src/equivs.mk b/src/equivs.mk
index 7035250..a1f1bac 100644
--- a/src/equivs.mk
+++ b/src/equivs.mk
@@ -1,16 +1,18 @@
1ARCH := $(shell dpkg-architecture -q DEB_BUILD_ARCH) 1config.mk: control
2ifndef VERSION 2 sed -ne 's/^Version: /VERSION=/p; s/^Architecture: /ARCH=/p; s/^Package: /PKG=/p;' < $< > $@
3VERSION := $(shell TZ=UTC date -Is | tr -d :- | tr T . | sed 's/+.*//') 3 echo 'export VERSION ARCH PKG' >> $@
4endif 4
5export VERSION 5include config.mk
6PKG ?= $(notdir $(PWD))
7 6
8PKG_FILE ?= $(PKG)_$(VERSION)_$(ARCH).deb 7PKG_FILE = $(PKG)_$(VERSION)_$(ARCH).deb
9export PKG_FILE 8export PKG_FILE
10 9
11$(PKG_FILE): control 10$(PKG_FILE): control
12 equivs-build control 11 equivs-build control
13 12
13clean-equivs:
14 rm -f control equivs-stamp
15
14equivs-stamp: control 16equivs-stamp: control
15 $(MAKE) $(PKG_FILE) 17 $(MAKE) $(PKG_FILE)
16 $(MAKE) install-equivs 18 $(MAKE) install-equivs
@@ -18,12 +20,11 @@ equivs-stamp: control
18 touch $@ 20 touch $@
19 21
20.PHONY: install-equivs 22.PHONY: install-equivs
21
22install-equivs: 23install-equivs:
23ifneq (0,$(shell id -u)) 24ifneq (0,$(shell id -u))
24 sudo $(MAKE) PKG_FILE=$(PKG_FILE) MAKEFLAGS=$(MAKEFLAGS) $@ 25 sudo $(MAKE) PKG_FILE=$(PKG_FILE) MAKEFLAGS=$(MAKEFLAGS) $@
25else 26else
26 dpkg -i $(PKG_FILE) 27 dpkg -i $${PKG_FILE}
27ifneq ($(REMOVE_EQUIVS_PACKAGE),) 28ifneq ($(REMOVE_EQUIVS_PACKAGE),)
28 dpkg -r $${PKG_FILE%%_*} 29 dpkg -r $${PKG_FILE%%_*}
29endif 30endif