debian/rules

- Also extract the source package name from the changelog.
- Simplify tar extraction.

svn path=/dists/trunk/linux-2.6/; revision=8139
This commit is contained in:
Bastian Blank 2007-01-08 18:17:35 +00:00
parent 6cb8372a0b
commit 0c8c083cc0
1 changed files with 7 additions and 12 deletions

19
debian/rules vendored
View File

@ -5,9 +5,8 @@
SHELL := sh -e
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
srcver := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
VERSION := $(shell echo $(srcver) | sed -e 's,-[^-]*$$,,')
MAJOR := $(word 1,$(subst ., ,$(VERSION))).$(word 2,$(subst ., ,$(VERSION)))
SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
VERSION := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)-[^-]*$$,\1,p')
include debian/rules.defs
@ -36,20 +35,16 @@ $(STAMPS_DIR)/build-base: $(STAMPS_DIR)/setup-base
$(BUILD_DIR) $(STAMPS_DIR):
@[ -d $@ ] || mkdir $@
DIR_ORIG = ../orig/linux-$(MAJOR)-$(VERSION)
TAR_ORIG = ../linux-$(MAJOR)_$(VERSION).orig.tar.gz
DIR_ORIG = ../orig/$(SOURCE)-$(VERSION)
TAR_ORIG = ../$(SOURCE)_$(VERSION).orig.tar.gz
orig: $(DIR_ORIG)
rsync --delete --exclude debian --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
$(DIR_ORIG):
if [ -f $(TAR_ORIG) ]; then \
mkdir -p ../orig; \
tar -C ../orig -xzf $(TAR_ORIG); \
else \
echo "Can't find orig tarball." >&2; \
exit 1; \
fi
@[ -e $(TAR_ORIG) ] || ( echo "Can't find orig tarball" >&2; exit 1 )
mkdir -p ../orig
tar -C ../orig -xzf $<
maintainerclean:
rm -f debian/control debian/control.md5sum debian/rules.gen debian/bin/patch.* debian/linux-*