[php-maint] Pear Policy Draft

Mark A. Hershberger mah at everybody.org
Sun Sep 23 02:58:12 UTC 2007


I took the sample rules file from
http://wiki.debian.org/GregoryColpart/PearPolicyDraft and tweaked it
with some additional variables common in other packages
(e.g. DEB_SOURCE_PACKAGE) in order to make it possible to just drop
this in place for 90% of Pear packages.

Also, I was wondering about the get-orig-source target.  Since the
guidelines suggest creating a watch file usable by uscan, it seems
redundant.

Anyway, my suggested diffs follow my sig.

-- 
http://hexmode.com/
GPG Fingerprint: 7E15 362D A32C DFAB E4D2  B37A 735E F10A 2DFC BFF5

The most beautiful experience we can have is the mysterious.
    -- Albert Einstein, The World As I See it

diff -ub rules.wiki\~ rules.wiki
--- rules.wiki~	2007-09-22 20:50:53.000000000 -0400
+++ rules.wiki	2007-09-22 21:27:07.000000000 -0400
@@ -3,10 +3,11 @@
 DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
 DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
 DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
+DEB_SOURCE_PACKAGE := $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':'))
 
+PEAR_LIBRARY_NAME ?= $(shell pear info package.xml | awk '/^Package / {print $$2}')
 PEAR ?= /usr/bin/pear
-pear_pkg = $(shell ls |grep PEARLIBRARYNAME)
-package = php-auth
+TOP=debian/$(DEB_SOURCE_PACKAGE)
 
 configure: configure-stamp
 configure-stamp:
@@ -32,30 +33,29 @@
 	dh_installdirs
 
 	# Add here commands to install the package into debian/package.
-	cp package.xml $(pear_pkg)/package.xml;
-	$(PEAR) -c debian/pearrc \
-		-d include_path=/usr/share/php \
+	cp package.xml $(PEAR_LIBRARY_NAME)-$(DEB_UPSTREAM_VERSION)
+	$(PEAR) -d include_path=/usr/share/php \
 		-d php_bin=/usr/bin/php \
 		-d bin_dir=/usr/bin \
 		-d php_dir=/usr/share/php \
 		-d data_dir=/usr/share/php/data \
 		-d doc_dir=/usr/share/php/docs \
 		-d test_dir=/usr/share/php/tests \
-	install -n -f -P debian/$(package) $(pear_pkg)/package.xml
+		install -n -f -P $(TOP) $(PEAR_LIBRARY_NAME)-$(DEB_UPSTREAM_VERSION)/package.xml
 
 	# remove unwanted files
-	rm -f debian/$(package)/usr/share/php/.filemap;
-	rm -f debian/$(package)/usr/share/php/.lock;
-	rm -rf debian/$(package)/usr/share/php/.channels;
-	rm -rf debian/$(package)/usr/share/php/.depdblock;
-	rm -rf debian/$(package)/usr/share/php/.depdb;
-	rm -rf debian/$(package)/usr/share/php/.registry/.channel.pecl.php.net;
-	rm -rf debian/$(package)/usr/share/php/.registry/.channel.__uri;
-	rm -rf debian/$(package)/tmp
+	rm -f $(TOP)/usr/share/php/.filemap;
+	rm -f $(TOP)/usr/share/php/.lock;
+	rm -rf $(TOP)/usr/share/php/.channels;
+	rm -rf $(TOP)/usr/share/php/.depdblock;
+	rm -rf $(TOP)/usr/share/php/.depdb;
+	rm -rf $(TOP)/usr/share/php/.registry/.channel.pecl.php.net;
+	rm -rf $(TOP)/usr/share/php/.registry/.channel.__uri;
+	rm -rf $(TOP)/tmp
 
 	# remove duplicated files, these files are in /usr/share/doc/package
-	rm -rf debian/$(package)/usr/share/php/tests \
-		debian/$(package)/usr/share/php/docs
+	rm -rf $(TOP)/usr/share/php/tests \
+		$(TOP)/usr/share/php/docs
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -79,6 +79,5 @@
 .PHONY: build clean binary-indep binary-arch binary install configure
 
 get-orig-source:
-	wget http://download.pear.php.net/package/PEARLIBRARYNAME-${DEB_UPSTREAM_VERSION}.tgz \
-		-O php-PEARLIBRARYNAME_${DEB_UPSTREAM_VERSION}.orig.tar.gz
-
+	wget http://download.pear.php.net/package/$(PEAR_LIBRARY_NAME)-$(DEB_UPSTREAM_VERSION).tgz \
+		-O $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz

Diff finished.  Sat Sep 22 22:50:08 2007



More information about the pkg-php-maint mailing list