Initial Debian folder.
[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_auto_clean:
14         dh_auto_clean
15         rm -rf debian/*.upstart
16
17 override_dh_installinit:
18         if dpkg-vendor --derives-from ubuntu ; then \
19                 for i in *.upstart.in ; do \
20                         MYPKG=`echo $i | cut -d. -f1` ; \
21                         cp $MYPKG.upstart.in $MYPKG.upstart ; \
22                 done ; \
23         fi
24         dh_installinit --error-handler=true
25
26 override_dh_gencontrol:
27         if dpkg-vendor --derives-from ubuntu ; then \
28                 dh_gencontrol -- -T$(CURDIR)/debian/ubuntu_control_vars ; \
29         else \
30                 dh_gencontrol -- -T$(CURDIR)/debian/debian_control_vars ; \
31         fi
32
33 override_dh_builddeb:
34         dh_builddeb -- -Zxz -z9
35
36 regen-manifest-patch:
37         quilt pop -a || true
38         quilt push install-missing-files.patch
39         git checkout MANIFEST.in
40         git ls-files --no-empty-directory --exclude-standard nova | grep -v '.py$$' | sed -n 's/.*/include &/gp' >> MANIFEST.in
41         quilt refresh
42         quilt pop -a
43
44 get-vcs-source:
45         git remote add upstream git://github.com/openstack/$(DEBPKGNAME).git || true
46         git fetch upstream
47         if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] ; then \
48                 git archive --prefix=$(DEBPKGNAME)-$(VERSION)/ $(VERSION) | xz >../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ; \
49         fi
50         if ! git checkout master ; then \
51                 echo "No upstream branch: checking out" ; \
52                 git checkout -b master upstream/master ; \
53         fi
54         git checkout debian/experimental