ricoh-sp100-sp204/Makefile

55 lines
2.1 KiB
Makefile
Raw Normal View History

2017-02-09 18:31:36 +01:00
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 .publish-git .builddeb %.swp Makefile)
FILTERORIG := $(abspath .git% %.deb .publish-git .builddeb %.swp Makefile) $(shell test -e noupdate.files && cat noupdate.files) /DEBIAN%
FILES := $(filter-out $(FILTER), $(abspath $(shell find . -mindepth 1 -type f -print) ))
ORIGS := $(filter-out $(FILTERORIG), $(realpath $(subst ./$(DIR),,$(shell sudo 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)
all: .builddeb
@#echo FILE $(FILESGIT)
.builddeb: $(FILES)
@#echo FILT $(FILTER)
@#echo FILE $(FILES)
@echo `gawk -f ../increment.awk $(DIR)/DEBIAN/control`
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
fakeroot dpkg-deb --build $(DIR) "$(DIR)_$(VERSION)_$(ARCH).deb"
2017-05-12 00:20:11 +02:00
ln -sf "$(DIR)_$(VERSION)_$(ARCH).deb" "$(DIR)_current_$(ARCH).deb"
2017-02-09 18:31:36 +01:00
aptly repo add xundeenergie "$(DIR)_$(VERSION)_$(ARCH).deb"
touch .builddeb
2017-03-22 23:22:44 +01:00
buildonlydeb: $(FILES)
@#echo FILT $(FILTER)
@#echo FILE $(FILES)
@echo `gawk -f ../increment.awk $(DIR)/DEBIAN/control`
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
fakeroot dpkg-deb --build $(DIR) "$(DIR)_$(VERSION)_$(ARCH).deb"
2017-05-07 01:57:21 +02:00
ln -sf "$(DIR)_$(VERSION)_$(ARCH).deb" "$(DIR)_current_$(ARCH).deb"
2017-03-22 23:22:44 +01:00
2017-02-09 18:31:36 +01:00
.update: $(ORIGS)
@#for i in $(ORIGS); do $$i;done
@echo "Copy originals to $(DIR)"
@for i in $(ORIGS); do sudo cp -uv $$i $(DIR)$$i;done
touch .update
.publish-git: $(FILESGIT)
fakeroot git add .
fakeroot git commit -m $(COMMIT) && git push origin master || exit 0
touch .publish-git
2017-05-07 01:49:47 +02:00
pull-git:
git pull origin || exit 0