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