90ec76b417ef7a4ed3af308f793998aeacf3e775
[openstack-build/ceilometer-build.git] / trusty / debian / rules
1 #!/usr/bin/make -f
2
3 #export DH_VERBOSE=1
4
5 %:
6         dh $@  --with python2
7
8 DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
9 VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[~-].*//')
10 DEBFLAVOR :=$(shell dpkg-parsechangelog | grep -E ^Distribution: | cut -d" " -f2)
11 DEBPKGNAME :=$(shell dpkg-parsechangelog | grep -E ^Source: | cut -d" " -f2)
12
13 override_dh_installchangelogs:
14         dh_installchangelogs debian/CHANGELOG
15
16 override_dh_auto_clean:
17         dh_auto_clean
18         rm -rf debian/*.upstart
19
20 override_dh_installinit:
21         if dpkg-vendor --derives-from ubuntu ; then \
22                 for i in *.upstart.in ; do \
23                         MYPKG=`echo $i | cut -d. -f1` ; \
24                         cp $MYPKG.upstart.in $MYPKG.upstart ; \
25                 done ; \
26         fi
27         dh_installinit --error-handler=true
28
29 override_dh_gencontrol:
30         if dpkg-vendor --derives-from ubuntu ; then \
31                 dh_gencontrol -- -T$(CURDIR)/debian/ubuntu_control_vars ; \
32         else \
33                 dh_gencontrol -- -T$(CURDIR)/debian/debian_control_vars ; \
34         fi
35
36 override_dh_builddeb:
37         dh_builddeb -- -Zxz -z9
38
39 regen-manifest-patch:
40         quilt pop -a || true
41         quilt push install-missing-files.patch
42         git checkout MANIFEST.in
43         git ls-files --no-empty-directory --exclude-standard nova | grep -v '.py$$' | sed -n 's/.*/include &/gp' >> MANIFEST.in
44         quilt refresh
45         quilt pop -a
46
47 get-vcs-source:
48         git remote add upstream git://github.com/openstack/$(DEBPKGNAME).git || true
49         git fetch upstream
50         if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] ; then \
51                 git archive --prefix=$(DEBPKGNAME)-$(VERSION)/ $(VERSION) | xz >../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ; \
52         fi
53         if ! git checkout master ; then \
54                 echo "No upstream branch: checking out" ; \
55                 git checkout -b master upstream/master ; \
56         fi
57         git checkout debian/experimental