aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 8135639966931e4f792b9eae0870f541e05a5b42 (plain) (blame)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# 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)

CRYPTECH_PACKAGE_VERSION := ${CRYPTECH_VERSION}~${HEAD_TIME}~${HEAD_HASH}

# 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 cryptech-alpha --newversion '${CRYPTECH_PACKAGE_VERSION}' \
	'$(strip Version ${CRYPTECH_VERSION} of software for Cryptech Alpha development board.)'

REPOSITORY  := /home/aptbot/alpha
GNUPGHOME   := /home/aptbot/gnupg
CODENAME    := wheezy
REPO_UMASK  := 002
UPLOAD_USER := aptbot
UPLOAD_URI  := rsync://apt.cryptech.is/alpha/

export GNUPGHOME


all: init source pbuilder homebrew

enchilada: all reprepro 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 sw; ${DCH}
	cd sw; debuild -S -uc -us

# Maybe use pdebuild here?  Have full-blown multi-arch multi-dist
# pbuilder example for another project, but something simpler would be
# nice....

pbuilder:
	cd sw; debuild -b -uc -us

reprepro: ${REPOSITORY}/conf/distributions ${REPOSITORY}/conf/options
	umask ${REPO_UMASK}; for f in *.changes; do reprepro -b ${REPOSITORY} include ${CODENAME} $$f; done

${REPOSITORY}/conf/distributions ${REPOSITORY}/conf/options:
	install -D reprepro-conf/$(notdir $@) ${REPOSITORY}/conf/$(notdir $@)

RSYNC	:= rsync --rsh 'ssh -l ${UPLOAD_USER}' --archive --itemize-changes

upload:
	${RSYNC} --ignore-existing       ${REPOSITORY}/ ${UPLOAD_URI}
	${RSYNC} --delete --delete-delay ${REPOSITORY}/ ${UPLOAD_URI}

.PHONY: all init clean source pbuilder homebrew reprepro upload enchilada sandblast