-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
common_rules.mk
42 lines (30 loc) · 1.91 KB
/
common_rules.mk
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
34
35
36
37
38
39
40
41
42
SQCK=$(shell which sqck || true)
ifeq ($(SQCK),)
KEY_INPUT_SUFFIX=-raw.gpg
else
KEY_INPUT_SUFFIX=-sqck.gpg
endif
$(BUILD_DIR)/%-sqck.gpg: $(BUILD_DIR)/%-sqck.key
gpg --no-default-keyring --keyring $@ --import $<
# We split verification because sqck must not be followed by |
# as shell would ignore the exit code of sqck.
$(BUILD_DIR)/%-sqck.key: $(BUILD_DIR)/%-raw.gpg
gpg --no-default-keyring --keyring $< --export $* | $(SQCK) $* > $@
$(BUILD_DIR)/%-raw.gpg: | $(BUILD_DIR)
gpg --no-default-keyring --keyring $@ --keyserver hkp://keyserver.ubuntu.com --recv-keys $*
$(BUILD_DIR):
mkdir -p $@
$(BUILD_DIR)/debcrafter-%.stamp: pkg_specs/%.sss pkg_specs/%.changelog $(BUILD_DIR)/%.d $(BUILD_DIR)/verify-%.stamp $(shell which debcrafter)
DEBEMAIL=$(MAINTAINER) debcrafter $< $(BUILD_DIR) --write-deps $(BUILD_DIR)/$*.d
touch $@
$(BUILD_DIR)/packages-%.stamp: $(BUILD_DIR)/debcrafter-%.stamp
if [ -d "$(BUILD_DIR)/$*-`head -n 1 pkg_specs/$*.changelog | sed -e 's/^.*(\([^)]*\)).*$$/\1/' -e 's/-[0-9]*$$//'`/debian/patches" -a '!' -e "$(BUILD_DIR)/$*-`head -n 1 pkg_specs/$*.changelog | sed -e 's/^.*(\([^)]*\)).*$$/\1/' -e 's/-[0-9]*$$//'`/.pc/applied-patches" ]; then cd "$(BUILD_DIR)/$*-`head -n 1 pkg_specs/$*.changelog | sed -e 's/^.*(\([^)]*\)).*$$/\1/' -e 's/-[0-9]*$$//'`" && QUILT_PATCHES=debian/patches quilt push -a; fi
cd "$(BUILD_DIR)/$*-`head -n 1 pkg_specs/$*.changelog | sed -e 's/^.*(\([^)]*\)).*$$/\1/' -e 's/-[0-9]*$$//'`" && SOURCE_DATE_EPOCH=`dpkg-parsechangelog -STimestamp` dpkg-buildpackage -a $(DEB_ARCH) $(BUILD_PACKAGE_FLAGS) && find debian -exec touch -d @`dpkg-parsechangelog -STimestamp` '{}' \;
touch $@
$(BUILD_DIR)/build-%.mk: $(SOURCE_DIR)build_rules/%.yaml $(SOURCE_DIR)build_template.mustache | $(BUILD_DIR)
mustache $^ > $@
$(BUILD_DIR)/%.d: ;
.PRECIOUS: $(BUILD_DIR)/%.d
-include $(addprefix $(BUILD_DIR)/build-,$(addsuffix .mk,$(SOURCES)))
include $(wildcard $(BUILD_DIR)/*.d)
.PHONY: all clean