rules 2.19 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

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

10
override_dh_install:
11
	cp -r "$(CURDIR)/db/"  "$(CURDIR)/dns/"  "$(CURDIR)/http/" "$(CURDIR)/aegir.make" "$(CURDIR)/platform/" "$(CURDIR)/Provision/" "$(CURDIR)/Symfony/" "$(CURDIR)"/*.inc "$(CURDIR)"/*.php "$(CURDIR)"/*.info "$(CURDIR)/debian/aegir-provision/usr/share/drush/commands/provision/"
12

13 14
	# We need this nasty hack, because we added a directory.
	# TODO: this is really lame, there must be a better way to do this?
15
	if [ -d "$(CURDIR)/tests" ]; then cp -r "$(CURDIR)/tests/" "$(CURDIR)/debian/aegir-provision/usr/share/drush/commands/provision/"; fi
16

17
	cp "$(CURDIR)/debian/aegir-provision.lintian" "$(CURDIR)/debian/aegir-provision/usr/share/lintian/overrides/aegir-provision"
anarcat's avatar
anarcat committed
18

19 20 21
override_dh_install_init:
	dh_installinit --name=hosting-queued

anarcat's avatar
anarcat committed
22 23 24
DOMAIN?=$(shell hostname -f)
KEY?="-kjenkins@$(DOMAIN)"

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

30 31 32
# 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
33
upstream_version=$(shell git describe --tags origin/6.x-1.x | sed 's/6.x-//;s/-\([0-9]*\)-\([^-]*\)$$/+\1.\2/')
34 35 36
# 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
37
debian_version=$(shell git describe --tags origin/debian | sed "s/debian\///;s/-\([0-9]*\)-\([^-]*\)$$/+\1.\2/;s/^.*-//" )
anarcat's avatar
anarcat committed
38

39
# this builds a debian package but first updates the branches to follow the latest 1.x branch
40
# this assumes you are on a "debian" branch (of course)
anarcat's avatar
anarcat committed
41
jenkins-build-auto:
anarcat's avatar
anarcat committed
42
	git merge origin/6.x-1.x
anarcat's avatar
anarcat committed
43 44 45
	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}
46 47 48

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