adding debian/rules for package building

This commit is contained in:
Daniel Salinas
2013-04-29 16:02:54 -05:00
parent c0a6f7e1cf
commit 3be8a6f065
3 changed files with 40 additions and 4 deletions

2
debian/changelog vendored
View File

@@ -1,4 +1,4 @@
nova-compute-openvz (1.0-1) UNRELEASED; urgency=low
openvz-nova-driver (1.0-1) UNRELEASED; urgency=low
* Initial release. (Closes: #XXXXXX)

6
debian/control vendored
View File

@@ -1,10 +1,10 @@
Source: nova-compute-openvz
Source: openvz-nova-driver
Maintainer: Daniel Salinas <imsplitbit@gmail.com>
Priority: optional
Build-Depends: python-setuptools (>= 0.6b3), debhelper (>= 7.4.3), python-support (>= 0.8.4)
Build-Depends: debhelper (>= 7.4.3), python-support (>= 0.8.4)
Standards-Version: 3.8.4
Package: nova-compute-openvz
Package: openvz-nova-driver
Architecture: all
Depends: ${misc:Depends},
${python:Depends},

36
debian/rules vendored Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/make -f
export MASTER_HEAD=`git log -1 --format=%h master`
export DEVELOPMENT_HEAD=`git log -1 --format=%h development`
export CHANGELOGENTRY="$(VERSION_STRING)"
%:
dh $@ --with python2
# If you want to run an automated build (for something like Jenkins),
# this is the thing for you. Just run:
#
# debian/rules automated-build
#
automated-build:
# Make a backup of the upstream debian/control
cp -av debian/control debian/control.pristine
# Add the current git hash to the Description field of the package
sed -i "s/^Description: .*$$/& (master: $(MASTER_HEAD) development: $(DEVELOPMENT_HEAD))/" debian/control
# Update the changelog
dch -v $(CHANGELOGENTRY) "Automated build."
# Clean up
dh clean
# Build it
dh build --with python2
fakeroot dh binary --with python2
# Put the upstream debian/control back in place
mv -v debian/control.pristine debian/control
override_dh_install:
dh_install --fail-missing