aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-07-03 15:15:51 -0400
committerRob Austein <sra@hactrn.net>2016-07-03 15:15:51 -0400
commit4e745ec22b4ff3f481a1dfb1a2dc322130c73d33 (patch)
tree90d153b5a35162badab600aa0b07f1cfd895a0ce /Makefile
parente04af864c3904e6401ef1d100e9ea6e67d75aefc (diff)
Simplify version numbering, add preliminary Homebrew support.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile48
1 files changed, 32 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 98378ce..1e15c3d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,21 @@
# Top-level package build for 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}
+PACKAGE_VERSION := 2.0.$(shell git show -s --format=%ct HEAD)
export GNUPGHOME := /home/aptbot/gnupg
+GPG_USER := APT Builder Robot <aptbot@cryptech.is>
+GPG_KEYID := 37A8E93F5D7E7B9A
-REPO_BASE := /home/aptbot/alpha
+REPO_BASE := /home/aptbot
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/
+REPO_UPLOAD_HOST := bikeshed.cryptech.is
+REPO_UPLOAD_DIRS := apt brew
# Yes, we really are putting the firmware tarball into the source package.
# We want to supply the firmware in both source and binary form, to save users
@@ -34,11 +32,11 @@ TAMPER := build/user/ln5/tamper/tamper.hex
# 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>' \
+ EDITOR=true VISUAL=true TZ=UTC DEBEMAIL='${GPG_USER}' \
dch --create --package ${PACKAGE_NAME} --newversion '${PACKAGE_VERSION}' \
- '$(strip Version ${CRYPTECH_VERSION} package for Cryptech Alpha development board.)'
+ 'Software and firmware for Cryptech Alpha development board.'
-all: init firmware dsc pbuilder homebrew
+all: init firmware dsc pbuilder homebrew expire
enchilada: all upload
@@ -85,15 +83,33 @@ pbuilder:
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; \
+ reprepro -b ${REPO_BASE}/apt/$$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; \
+ cp -p ${PBUILDER_BASE}/$${code}-$${arch}_result/${PACKAGE_NAME}_${PACKAGE_VERSION}.tar.xz ${REPO_BASE}/brew/tarballs/; \
+ reprepro -b ${REPO_BASE}/apt/$$dist include $$code ${PBUILDER_BASE}/$${code}-$${arch}_result/${PACKAGE_NAME}_${PACKAGE_VERSION}_$${arch}.changes; \
done
+homebrew:
+ rm -rf tap
+ umask ${REPO_UMASK}; \
+ git clone ${REPO_BASE}/brew/tap tap; \
+ cd tap; \
+ ../build-homebrew-formula.py ${REPO_BASE}/brew/tarballs/${PACKAGE_NAME}_${PACKAGE_VERSION}.tar.xz ${PACKAGE_VERSION} ${PACKAGE_NAME}.rb; \
+ git add ${PACKAGE_NAME}.rb; \
+ git commit -S${GPG_KEYID} --author='${GPG_USER}' -m '${PACKAGE_NAME} ${PACKAGE_VERSION}'; \
+ git push
+# rm -rf tap
+
+# Still need:
+#
+# expire: target to expire old tarballs from .../brew/tarballs/, along the lines of download.rpki.net scripts
+
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}
+ for dir in ${REPO_UPLOAD_DIRS}; do \
+ ${RSYNC} --ignore-existing ${REPO_BASE}/$${dir}/ rsync://${REPO_UPLOAD_HOST}/$${dir}/ \
+ ${RSYNC} --delete --delete-delay ${REPO_BASE}/$${dir}/ rsync://${REPO_UPLOAD_HOST}/$${dir}/ \
+ done
-.PHONY: all init clean firmware shadow bitstream elves tamper dsc pbuilder homebrew upload enchilada sandblast
+.PHONY: all init clean firmware shadow bitstream elves tamper dsc pbuilder homebrew expire upload enchilada sandblast