Clean up usbip package version generation

Extract the current usbip version from its config.h file rather than
repeating it in rules.real where we might forget to update it.

Pass VERSION_DEBIAN into rules.real from rules.gen rather than
invoking dpkg-parsechangelog again.

svn path=/dists/sid/linux-tools/; revision=19188
This commit is contained in:
Ben Hutchings 2012-06-24 00:44:58 +00:00
parent b989eb0842
commit d0d98ef3a7
2 changed files with 4 additions and 3 deletions

View File

@ -39,6 +39,7 @@ class gencontrol(object):
def do_main_setup(self, vars, makeflags):
makeflags.update({
'VERSION': self.version.linux_version,
'VERSION_DEBIAN': self.version.complete,
'UPSTREAMVERSION': self.version.linux_upstream,
})

6
debian/rules.real vendored
View File

@ -3,8 +3,6 @@ export DH_OPTIONS
include debian/rules.defs
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
PACKAGE_VERSION := $(shell dpkg-parsechangelog | sed -ne 's,^Version: ,,p')
USBIP_VERSION := 1.1.1+$(PACKAGE_VERSION)
binary-arch: install-kbuild install-usbip
ifneq ($(filter alpha amd64 armel armhf hppa i386 powerpc ppc64 s390 s390x sh4 sparc sparc64,$(DEB_BUILD_ARCH)),)
@ -61,6 +59,7 @@ install-tools: $(STAMPS_DIR)/build
install-usbip: DH_OPTIONS = -plibusbip-dev -pusbip
install-usbip: DIR = $(CURDIR)/debian/tmp
install-usbip: override VERSION := $(shell sed -ne 's,^#define PACKAGE_VERSION "\(.*\)"$$,\1,p' $(BUILD_DIR)/drivers/staging/usbip/userspace/config.h)
install-usbip: $(STAMPS_DIR)/build
dh_testdir
dh_testroot
@ -75,6 +74,7 @@ install-usbip: $(STAMPS_DIR)/build
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol -- -v$(USBIP_VERSION)
test -n "$(VERSION)" -a -n "$(VERSION_DEBIAN)"
dh_gencontrol -- -v$(VERSION)+$(VERSION_DEBIAN)
dh_md5sums
dh_builddeb