X Strike Force X.Org X11 SVN commit: r28 - trunk/debian
Author: branden
Date: 2005-03-10 00:59:53 -0500 (Thu, 10 Mar 2005)
New Revision: 28
Modified:
trunk/debian/rules
Log:
Add Make variables to store the source package name, package version, and
upstream version (all determined from debian/changelog).
Make prune-upstream-tree rule confirm that it's in a plausible directory
before attempting to remove things.
Add make-orig-tar-gz (phony) rule to generate the .orig.tar.gz file.
Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules 2005-03-10 05:14:23 UTC (rev 27)
+++ trunk/debian/rules 2005-03-10 05:59:53 UTC (rev 28)
@@ -2,6 +2,15 @@
# $Id$
+# Determine (source) package name from Debian changelog.
+SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
+ | grep '^Source:' | awk '{print $$2}')
+# Determine package version from Debian changelog.
+SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
+ | grep '^Version:' | awk '{print $$2}')
+# Determine upstream version number.
+UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
+
build: stamp-build
stamp-build:
@@ -15,6 +24,8 @@
# which has licensing problems. It must be run before creating the
# .orig.tar.gz.
prune-upstream-tree:
+ # Ensure we're in the correct directory.
+ test -d xc
# Remove copies of stuff that is separately packaged in Debian.
rm -rf xc/extras/expat
rm -rf xc/extras/fontconfig
@@ -120,6 +131,13 @@
rm -f xc/programs/Xserver/hw/xfree86/drivers/rendition/v10002d.uc
rm -f xc/programs/Xserver/hw/xfree86/drivers/rendition/v20002d.uc
-.PHONY: build clean prune-upstream-tree
+make-orig-tar-gz: prune-upstream-tree
+ # Change to what should be the correct directory, ensure it is, and if
+ # so, create the .orig.tar.gz file.
+ ( cd .. \
+ && test -d $(SOURCE_NAME)-$(UPSTREAM_VERSION) \
+ && tar --exclude=debian --exclude=debian/* -cf - $(SOURCE_NAME)-$(UPSTREAM_VERSION) | gzip -9 >$(SOURCE_NAME)_$(UPSTREAM_VERSION).orig.tar.gz )
+.PHONY: build clean make-orig-tar-gz prune-upstream-tree
+
# vim:set ai noet sts=8 sw=8 tw=0:
Reply to: