[Dh-make-php-commits] r163 - in trunk: . debian pear.template
Charles Fry
cfry-guest at costa.debian.org
Wed Mar 8 16:02:34 UTC 2006
Author: cfry-guest
Date: 2006-03-07 15:27:09 +0000 (Tue, 07 Mar 2006)
New Revision: 163
Added:
trunk/pear.mk
Modified:
trunk/Makefile
trunk/debian/control
trunk/debian/dirs
trunk/pear.template/control
trunk/pear.template/rules
Log:
committing changes previously emailed to list
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2006-03-07 14:14:36 UTC (rev 162)
+++ trunk/Makefile 2006-03-07 15:27:09 UTC (rev 163)
@@ -32,6 +32,7 @@
cp -r licenses ${DESTDIR}/share/${PACKAGE}
cp -r xslt ${DESTDIR}/share/${PACKAGE}
cp dh-make-php.lib ${DESTDIR}/share/${PACKAGE}
+ cp pear.mk ${DESTDIR}/share/cdbs/1/class
rm -rf ${DESTDIR}/share/${PACKAGE}/pecl.template/CVS
rm -rf ${DESTDIR}/share/${PACKAGE}/pear.template/CVS
rm -rf ${DESTDIR}/share/${PACKAGE}/licenses/CVS
Modified: trunk/debian/control
===================================================================
--- trunk/debian/control 2006-03-07 14:14:36 UTC (rev 162)
+++ trunk/debian/control 2006-03-07 15:27:09 UTC (rev 163)
@@ -2,13 +2,13 @@
Section: web
Priority: optional
Maintainer: Uwe Steinmann <steinm at debian.org>
+Uploaders: Charles Fry <debian at frogcircus.org>
Build-Depends-Indep: debhelper (>> 4.0.0), po-debconf, docbook-xsl, xsltproc
-Standards-Version: 3.6.1
+Standards-Version: 3.6.2
Package: dh-make-php
Architecture: all
-Depends: xsltproc
-Recommends: php-pear
-Description: Creating debian source packages for pear and pecl extensions
- It contains two programs to create a debian source package
- from a pear or pecl package.
+Depends: php-pear, cdbs, xsltproc, xmlstarlet
+Description: Creates Debian source packages for PHP PEAR and PECL extensions
+ Contains two programs to create Debian source packages
+ from PHP PEAR or PECL packages.
Modified: trunk/debian/dirs
===================================================================
--- trunk/debian/dirs 2006-03-07 14:14:36 UTC (rev 162)
+++ trunk/debian/dirs 2006-03-07 15:27:09 UTC (rev 163)
@@ -1,2 +1,3 @@
usr/share/
+usr/share/cdbs/1/class
usr/bin
Added: trunk/pear.mk
===================================================================
--- trunk/pear.mk 2006-03-07 14:14:36 UTC (rev 162)
+++ trunk/pear.mk 2006-03-07 15:27:09 UTC (rev 163)
@@ -0,0 +1,100 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2006 Charles Fry <debian at frogcircus.org>
+# Description: Installs and cleans PEAR packages
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+ifndef _cdbs_bootstrap
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+endif
+
+ifndef _cdbs_class_pear
+_cdbs_class_pear := 1
+
+include $(_cdbs_rules_path)/debhelper.mk$(_cdbs_makefile_suffix)
+
+# modify these variables as necessary
+PEAR_PKG := $(shell /usr/bin/xmlstarlet sel -t -v '/package/name/text()' package.xml)
+PEAR_PKG_VERSION := $(shell /usr/bin/xmlstarlet sel -t -v '/package/release/version/text()' package.xml)
+# some packages use test instead of tests
+PEAR_TEST_DIR := tests
+
+# these shouldn't need to be changed
+PEAR_SOURCE_DIR = $(PEAR_PKG)-$(PEAR_PKG_VERSION)
+PEAR_OLD_DOC_DIR = usr/share/php/docs/$(PEAR_PKG)
+PEAR_NEW_DOC_DIR = usr/share/doc/$(DEB_PACKAGES)
+PEAR_OLD_TEST_DIR = usr/share/php/tests/$(PEAR_PKG)/$(PEAR_TEST_DIR)
+PEAR_NEW_TEST_DIR = $(PEAR_NEW_DOC_DIR)/tests
+
+DEB_PHONY_RULES += pear-sanity-check
+
+pear-sanity-check:
+ if ! [ -x /usr/bin/pear -a -x /usr/bin/xmlstarlet ] ; then \
+ echo "pear.mk depends on php4-pear, xmlstarlet" ; \
+ exit 1 ; \
+ fi
+
+# check sanity as early as possible
+pre-build:: pear-sanity-check
+
+common-configure-indep::
+ ln -f -s ../package.xml $(PEAR_SOURCE_DIR)
+
+clean::
+ rm -f $(PEAR_PKG)-*/package.xml
+
+common-install-indep:: pear-sanity-check
+ # install everything in default locations
+ /usr/bin/pear \
+ -c debian/pearrc \
+ -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 --nodeps -R $(DEB_DESTDIR) $(PEAR_SOURCE_DIR)/package.xml
+
+ # move documentation to correct location
+ mkdir -p $(DEB_DESTDIR)usr/share/doc
+ mv -i $(DEB_DESTDIR)$(PEAR_OLD_DOC_DIR) $(DEB_DESTDIR)$(PEAR_NEW_DOC_DIR)
+ ln -s ../../doc/$(DEB_PACKAGES) $(DEB_DESTDIR)$(PEAR_OLD_DOC_DIR)
+
+ # create upstream changelog
+ if [ -f debian/changelog.xsl ] ; then \
+ if [ -x /usr/bin/xsltproc ] ; then \
+ /usr/bin/xsltproc --nonet --novalid debian/changelog.xsl package.xml | gzip -9 > $(DEB_DESTDIR)$(PEAR_NEW_DOC_DIR)/changelog.gz ; \
+ else \
+ echo "pear.mk requires xsltproc to automatically install the upstream changelog" ; \
+ exit 1 ; \
+ fi ; \
+ fi
+
+ # move test to correct location
+ mkdir -p $(DEB_DESTDIR)$(PEAR_NEW_TEST_DIR)
+ # must move files instead of directory in case tests was part of docs above
+ mv -i $(DEB_DESTDIR)$(PEAR_OLD_TEST_DIR)/* $(DEB_DESTDIR)$(PEAR_NEW_TEST_DIR)
+ rmdir $(DEB_DESTDIR)$(PEAR_OLD_TEST_DIR)
+ ln -s ../../../doc/$(DEB_PACKAGES)/tests $(DEB_DESTDIR)$(PEAR_OLD_TEST_DIR)
+
+ # remove unwanted files
+ rm -rf $(DEB_DESTDIR)usr/share/php/.[a-z]* \
+ $(DEB_DESTDIR)$(PEAR_NEW_DOC_DIR)/LICENSE
+
+endif
Modified: trunk/pear.template/control
===================================================================
--- trunk/pear.template/control 2006-03-07 14:14:36 UTC (rev 162)
+++ trunk/pear.template/control 2006-03-07 15:27:09 UTC (rev 163)
@@ -2,7 +2,7 @@
Section: web
Priority: optional
Maintainer: ##maintainer##
-Build-Depends-Indep: debhelper (>> 4.0.0), php4-pear, xsltproc
+Build-Depends-Indep: debhelper (>> 4.0.0), dh-make-php
Standards-Version: 3.6.2
Package: ##packagename##
Modified: trunk/pear.template/rules
===================================================================
--- trunk/pear.template/rules 2006-03-07 14:14:36 UTC (rev 162)
+++ trunk/pear.template/rules 2006-03-07 15:27:09 UTC (rev 163)
@@ -1,102 +1,4 @@
#!/usr/bin/make -f
# template debian/rules provided by dh-make-php.
-# GNU copyright 2005 by Uwe Steinmann.
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-PEAR_PKG_NAME=##pearpkgname##
-PACKAGE_NAME=##packagename##
-PEAR="PHP_PEAR_PHP_BIN=/usr/bin/php /usr/bin/pear"
-PEAR_PHP_DIR=$(shell $(PEAR) config-get php_dir|sed -e 's/php_dir=//')
-PEAR_DOC_DIR=$(shell $(PEAR) config-get doc_dir|sed -e 's/doc_dir=//')
-SOURCE_DIR=$(shell ls -d $(PEAR_PKG_NAME)-*)
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- # Add here commands to configure the package.
-
- touch configure-stamp
-
-
-build: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
-
- # Add here commands to compile the package.
- ln -s ../package.xml $(SOURCE_DIR)
- xsltproc --nonet --novalid debian/changelog.xsl package.xml > debian/Changelog
-
- touch build-stamp
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
-
- # Add here commands to clean up after the build process.
- #-$(MAKE) clean
- rm -f debian/pearrc debian/Changelog $(SOURCE_DIR)/package.xml
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/$(PACKAGE_NAME).
- $(PEAR) install --nodeps -R debian/$(PACKAGE_NAME) $(SOURCE_DIR)/package.xml
- rm -f debian/pearrc
- rm -f debian/$(PACKAGE_NAME)$(PEAR_PHP_DIR)/.lock
- rm -f debian/$(PACKAGE_NAME)$(PEAR_PHP_DIR)/.filemap
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs debian/Changelog
- dh_installdocs
- if [ -d debian/$(PACKAGE_NAME)$(PEAR_PHP_DIR)/docs/$(PEAR_PKG_NAME) ]; then \
- mv debian/$(PACKAGE_NAME)$(PEAR_PHP_DIR)/docs/$(PEAR_PKG_NAME) debian/$(PACKAGE_NAME)/usr/share/doc/$(PACKAGE_NAME); \
- (cd debian/$(PACKAGE_NAME)$(PEAR_PHP_DIR)/docs/; ln -s /usr/share/doc/$(PACKAGE_NAME)/$(PEAR_PKG_NAME)) \
- fi
- if [ -d debian/$(PACKAGE_NAME)$(PEAR_PHP_DIR)/tests/$(PEAR_PKG_NAME)/tests ]; then \
- mkdir -p debian/$(PACKAGE_NAME)/usr/share/doc/$(PACKAGE_NAME)/examples; \
- mv debian/$(PACKAGE_NAME)$(PEAR_PHP_DIR)/tests/$(PEAR_PKG_NAME)/tests debian/$(PACKAGE_NAME)/usr/share/doc/$(PACKAGE_NAME)/examples/; \
- rm -rf debian/$(PACKAGE_NAME)$(PEAR_PHP_DIR)/tests; \
- fi
- dh_installexamples
-# dh_install --sourcedir=debian/$(PACKAGE_NAME)
-# dh_installmenu
- dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_installinit
-# dh_installcron
-# dh_installinfo
-# dh_installman
-# dh_link
-# dh_strip
- dh_compress
-# dh_fixperms
-# dh_perl
-# dh_python
-# dh_makeshlibs
- dh_installdeb
-# dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+include /usr/share/cdbs/1/class/pear.mk
More information about the Dh-make-php-commits
mailing list