-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.old
30 lines (23 loc) · 1.15 KB
/
Makefile.old
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
DIR=$(shell basename $(CURDIR))
VERSION=`gawk '$$1 == "Version:"{print $$2}' $(DIR)/DEBIAN/control`
ARCH=`gawk '$$1 == "Architecture:"{print $$2}' $(DIR)/DEBIAN/control`
COMMIT = $(shell date "+xe%Y%m%d_%H%M%S")
SUBDIRS := $(shell find $(DIR) -type d -print)
FILTER := $(abspath .git% %.deb .%)
FILTERORIG := $(abspath .git% %.deb) /DEBIAN%
FILES := $(filter-out $(FILTER), $(abspath $(shell find . -mindepth 1 -type f -print)))
ORIGS := $(filter-out $(FILTERORIG), $(realpath $(subst ./$(DIR),,$(shell find . -mindepth 2 -type f -print))))
FILESGIT := $(filter-out $(abspath .git%), $(abspath $(shell find . -mindepth 1 -type f -print)))
all: $(DIR)/DEBIAN/control
$(DIR)/DEBIAN/control: $(FILES)
echo DIR $(DIR)
sed -e "s/^Version:.*/`gawk -f ../increment.awk $(DIR)/DEBIAN/control`/" $(DIR)/DEBIAN/control > $(DIR)/DEBIAN/control.tmp
mv $(DIR)/DEBIAN/control.tmp $(DIR)/DEBIAN/control
sudo dpkg-deb --build $(DIR) "$(DIR)_$(VERSION)_$(ARCH).deb"
aptly repo add xundeenergie "$(DIR)_$(VERSION)_$(ARCH).deb"
update:
for i in $(ORIGS); do sudo cp -u $$i $(DIR)$$i;done
publish-git: $(FILESGIT)
sudo git add .
git commit -m $(COMMIT)
git push origin master