rules 2.15 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 $@ --with=systemd
anarcat's avatar
anarcat committed
9

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

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

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

20
override_dh_installinit:
21 22
	dh_installinit --name=hosting-queued

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

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

31 32 33 34 35
# the version from the changelog, add the git hash
version=$(shell sed -ne 's/^[^(]*(\([^)]*\)).*/\1/;1p' debian/changelog)
commit=$(shell git log -n 1 --oneline | sed 's/ .*$$//')

# the version we're building with jenkins
36
jenkins_version=${version}+${BUILD_NUMBER}.${commit}
anarcat's avatar
anarcat committed
37

anarcat's avatar
anarcat committed
38 39 40 41
# debug for the above
show-version:
	@echo ${version}

anarcat's avatar
anarcat committed
42
# this builds a debian package but first updates the branches to follow the latest 2.x branch
43
# this assumes you are on a "debian" branch (of course)
anarcat's avatar
anarcat committed
44
jenkins-build-auto:
45
	dch -D unstable -v ${jenkins_version} "automatic jenkins build ${BUILD_TAG} for commit ${commit}"
anarcat's avatar
anarcat committed
46
	git commit -m"dummy commit for jenkins ${BUILD_TAG} autobuild" debian/changelog
47
	git-buildpackage -b ${KEY}
48

49 50
# helper to debug the above
show-jenkins-build-auto:
51
	@echo would build version ${jenkins_version} with key ${KEY}