diff options
author | Rob Austein <sra@hactrn.net> | 2016-06-27 11:38:39 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-06-27 11:38:39 -0400 |
commit | 5ce361bac89d49a368350e8c475b83e8e6cf0718 (patch) | |
tree | 0ad3144eebb5f069c238b35611750fe29d2ca1ab /software/Makefile | |
parent | 89e23287021da6db980ebbcca3c651bc163514bb (diff) | |
parent | 856cb22d530e820c122e0dbee5b61edff91d235e (diff) |
Merged software/master.
Diffstat (limited to 'software/Makefile')
-rw-r--r-- | software/Makefile | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/software/Makefile b/software/Makefile new file mode 100644 index 0000000..787fea4 --- /dev/null +++ b/software/Makefile @@ -0,0 +1,64 @@ +# Top-level build of software packages to work with Cryptech Alpha board. + +export CRYPTECH_VERSION := 2.0 + +HEAD_TIME := $(shell git show -s --format=%ct HEAD) +HEAD_HASH := $(shell git rev-parse HEAD) + +PACKAGE_NAME := cryptech-alpha +PACKAGE_VERSION := ${CRYPTECH_VERSION}~${HEAD_TIME}~${HEAD_HASH} + +export GNUPGHOME := /home/aptbot/gnupg + +REPO_BASE := /home/aptbot/alpha +REPO_UMASK := 002 + +PBUILDER_BASE := ${HOME}/pbuilder +PBUILDER_TARGETS := debian/jessie/i386 debian/jessie/amd64 ubuntu/xenial/i386 ubuntu/xenial/amd64 + +REPO_UPLOAD_USER := aptbot +REPO_UPLOAD_URI := rsync://apt.cryptech.is/alpha/ + +# Command to generate a new changelog containing one entry. +# Does nothing if the changelog already exists. + +DCH = test -f debian/changelog || \ + EDITOR=true VISUAL=true TZ=UTC DEBEMAIL='APT Builder Robot <aptbot@cryptech.is>' \ + dch --create --package ${PACKAGE_NAME} --newversion '${PACKAGE_VERSION}' \ + '$(strip Version ${CRYPTECH_VERSION} of software for Cryptech Alpha development board.)' + +all: init source pbuilder homebrew + +enchilada: all upload + +init: + git submodule update --init --recursive + +clean: + git clean -dfx + git submodule foreach --recursive git clean -dfx + +sandblast: clean + git submodule deinit -f . + +source: + cd source; ${DCH} + cd source; debuild -S -uc -us + +pbuilder: + rm -f ${PBUILDER_BASE}/*result/* + umask ${REPO_UMASK}; \ + for target in ${PBUILDER_TARGETS}; do echo $$target | tr '/' ' '; done | \ + while read dist code arch; do \ + reprepro -b ${REPO_BASE}/$$dist -A $$arch list $$code ${PACKAGE_NAME} | awk '{v = $$3} END {exit v != "${PACKAGE_VERSION}"}' && continue; \ + pbuilder-dist $$code $$arch build ${PACKAGE_NAME}_${PACKAGE_VERSION}.dsc; \ + reprepro -b ${REPO_BASE}/$$dist include $$code ${PBUILDER_BASE}/$${code}-$${arch}_result/${PACKAGE_NAME}_${PACKAGE_VERSION}_$${arch}.changes; \ + done + +RSYNC := rsync --rsh 'ssh -l ${REPO_UPLOAD_USER}' --archive --itemize-changes + +upload: + ${RSYNC} --ignore-existing ${REPO_BASE}/ ${REPO_UPLOAD_URI} + ${RSYNC} --delete --delete-delay ${REPO_BASE}/ ${REPO_UPLOAD_URI} + +.PHONY: all init clean source pbuilder homebrew upload enchilada sandblast |