aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2013-10-28 19:50:41 +0100
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 04:27:43 +0200
commite596091daf51443248a0cb427832be62552eaf27 (patch)
tree947c9dbe584746aa8a20d0f39a42ad0703bc5e6a /Makefile
parentea9414878e7613f33b7808feb390d3dd49aefb6c (diff)
Reorganization.
Move preseed-related stuff in ./preseed/, and vm-related stuff in ./virtualenv/.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..93d0c3f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+ARCH ?= $(shell uname -m | sed -e 's/^x86_64$$/amd64/' -e 's/^i686$$/i386/')
+VERSION = 7.2.0
+
+ISOIMG = debian-${VERSION}-${ARCH}-netinst.iso
+PRESEEDED = $(patsubst %.iso,%-preseeded.iso, ${ISOIMG})
+UDEBS = $(shell ./src/getname.sh)
+CHECKSUMS = MD5 SHA1 SHA256 SHA512
+
+# Preseed
+iso-preseed:
+ make dist/${ARCH}/${PRESEEDED}
+dist/${ARCH}/${PRESEEDED}: preseed.cfg $(wildcard ./include/*) dist/${ARCH}/${ISOIMG} ${UDEBS}
+ ./preseed.sh $@ dist/${ARCH}/${ISOIMG} ${UDEBS}
+
+# Get, verify
+iso-get: dist/${ARCH}/${ISOIMG}
+iso-checksum: $(patsubst %,iso-checksum-%, ${CHECKSUMS})
+
+# Verify a single digest
+iso-checksum-%: dist/${ARCH}/${ISOIMG} dist/${ARCH}/%SUMS dist/${ARCH}/%SUMS.sign
+ @echo Checking $* sum
+ @cd dist/${ARCH}; grep "\s${ISOIMG}$$" $*SUMS | $$(echo $* | sed 's@.*@/usr/bin/\L&sum@') --strict -c
+ gpg --verify dist/${ARCH}/$*SUMS.sign
+
+# Download
+.PRECIOUS: dist/${ARCH}/%
+dist/${ARCH}/%:
+ @[ -d dist/${ARCH} ] || mkdir -p dist/${ARCH}
+ wget -nc -P dist/${ARCH} http://cdimage.debian.org/debian-cd/current/${ARCH}/iso-cd/$*
+
+# All udebs
+udebs: ${UDEBS}
+
+# Single udeb; TODO: GPG sign
+%.udeb: UDEB = $(shell ./src/getname.sh $*)
+%.udeb: $(shell /usr/bin/git ls-files -- src/${UDEB})
+ @cd src/${UDEB} && /usr/bin/debuild -i -us -uc -b -a${ARCH}
+
+clean:
+ @for d in src/*-udeb/; do rm -fv $${d%-udeb/}_*.build $${d%-udeb/}_*.changes $${d%-udeb/}_*.udeb; cd $$d && dh_clean && cd -; done
+ @rm -fv $(patsubst %,dist/${ARCH}/%SUMS, ${CHECKSUMS}) $(patsubst %,dist/${ARCH}/%SUMS.sign, ${CHECKSUMS})
+
+.PHONY: clean cleanall iso-get iso-checksum iso-preseed udebs