rules 2.08 KB
Newer Older
anarcat's avatar
anarcat committed
1 2 3 4 5 6
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

anarcat's avatar
anarcat committed
7 8
%:
	dh $@
anarcat's avatar
anarcat committed
9

anarcat's avatar
anarcat committed
10
override_dh_install:
11 12 13
	cp -r "$(CURDIR)/db/"  "$(CURDIR)/dns/"  "$(CURDIR)/http/" "$(CURDIR)/aegir.make" "$(CURDIR)/platform/" "$(CURDIR)"/*.inc "$(CURDIR)"/*.php "$(CURDIR)"/*.info "$(CURDIR)/debian/aegir-provision/usr/share/drush/commands/provision/"
	# We need this nasty hack, because we added a directory.
	# TODO: this is really lame, there must be a better way to do this?
14
	if [ -d "$(CURDIR)/tests" ]; then
15 16
	  cp -r "$(CURDIR)/tests/" "$(CURDIR)/debian/aegir-provision/usr/share/drush/commands/provision/"
	fi
17
	cp "$(CURDIR)/debian/aegir-provision.lintian" "$(CURDIR)/debian/aegir-provision/usr/share/lintian/overrides/aegir-provision"
anarcat's avatar
anarcat committed
18

anarcat's avatar
anarcat committed
19 20 21
DOMAIN?=$(shell hostname -f)
KEY?="-kjenkins@$(DOMAIN)"

22 23
# this builds a debian package based on what the current branches are
# this usually tests the latest release
anarcat's avatar
anarcat committed
24
jenkins-build-official:
25
	git-buildpackage -b --git-upstream-branch=origin/upstream --git-debian-branch=origin/debian --git-ignore-branch -kjenkins@ci.aegirproject.org
26

27 28 29
# the upstream version: strip the 6.x and turn the appendix into
# +N.foo where N is the number of commits since last tag and foo is
# the hash
30
upstream_version=$(shell git describe --tags origin/6.x-1.x | sed 's/6.x-//;s/-\([0-9]*\)-\([^-]*\)$$/+\1.\2/')
31 32 33
# the debian version, strip the debian/ part of the tag and the
# upstream version number, keep just the debian part, replacing as
# above for the N.foo part
34
debian_version=$(shell git describe --tags origin/debian | sed "s/debian\///;s/-\([0-9]*\)-\([^-]*\)$$/+\1.\2/;s/^.*-//" )
anarcat's avatar
anarcat committed
35

36
# this builds a debian package but first updates the branches to follow the latest 1.x branch
37
# this assumes you are on a "debian" branch (of course)
anarcat's avatar
anarcat committed
38
jenkins-build-auto:
anarcat's avatar
anarcat committed
39
	git merge origin/6.x-1.x
anarcat's avatar
anarcat committed
40 41 42
	dch -D unstable -v ${upstream_version}-${debian_version} "automatic jenkins build ${BUILD_TAG}"
	git commit -m"dummy commit for jenkins ${BUILD_TAG} autobuild" debian/changelog
	git-buildpackage -b --git-upstream-branch=origin/6.x-1.x ${KEY}
43 44 45

show-version:
	@echo ${upstream_version}-${debian_version}