#!/usr/bin/make -f

SHELL := /bin/bash

override_dh_auto_build:

override_dh_auto_install:
	install -Dpm755 -d debian/tmp/lib/systemd/system
	install -Dpm755 -d debian/tmp/opt/atlassian/bamboo
	cp -rfT bamboo debian/tmp/opt/atlassian/bamboo
	install -Dpm644 -t debian/tmp/lib/systemd/system bamboo.service
	chmod a+x debian/tmp/opt/atlassian/bamboo/bin/start-bamboo.sh
	chmod a+x debian/tmp/opt/atlassian/bamboo/bin/stop-bamboo.sh
	find debian/tmp/opt/atlassian/bamboo -type f -name '*.so' -exec chrpath -d {} \;
	find debian/tmp/opt/atlassian/bamboo -type f -name '*.bak' -delete
	find debian/tmp/opt/atlassian/bamboo -type f -name '*.orig' -delete
	find debian/tmp/opt/atlassian/bamboo -type f -name '*.rej' -delete
	fdupes -qnrps debian/tmp/opt/atlassian/bamboo

override_dh_fixperms:
	dh_fixperms
	chmod a+x debian/atlassian-bamboo/opt/atlassian/bamboo/bin/start-bamboo.sh
	chmod a+x debian/atlassian-bamboo/opt/atlassian/bamboo/bin/stop-bamboo.sh

override_dh_strip:

override_dh_strip_nondeterminism:

override_dh_shlibdeps:

override_dh_makeshlibs:

override_dh_dwz:

override_dh_auto_test:

override_dh_auto_clean:

%:
	dh $@
