[Dh-make-php-commits] r252 - trunk
steinm at alioth.debian.org
steinm at alioth.debian.org
Mon May 14 13:40:06 UTC 2007
Author: steinm
Date: 2007-05-14 13:40:06 +0000 (Mon, 14 May 2007)
New Revision: 252
Modified:
trunk/dh-make-pear
trunk/dh-make-pecl
trunk/dh-make-php.lib
Log:
- get rid of all the xml processing. Use phppkginfo for extracting
data from the package.xml instead
Modified: trunk/dh-make-pear
===================================================================
--- trunk/dh-make-pear 2007-05-14 13:38:46 UTC (rev 251)
+++ trunk/dh-make-pear 2007-05-14 13:40:06 UTC (rev 252)
@@ -9,7 +9,7 @@
# at http://www.gnu.org/.
PROGNAME=dh-make-pear
-PROGVERSION=0.2.2
+PROGVERSION=0.2.3
PREFIX=/usr
DEBPACKAGEPREFIX=php
@@ -18,13 +18,7 @@
# if you change the examples directory make sure to adjust the
# regular expression to set the PACKAGEDOCFILES
PACKAGEEXPFILES="examples"
-# There has been versions of xmlstarlet which were called xml
-# instead of xmlstarlet
-if [ -x /usr/bin/xmlstarlet ]; then
- XMLSTARLET=/usr/bin/xmlstarlet
-else
- XMLSTARLET=/usr/bin/xml
-fi
+PHPPKGINFO=${PREFIX}/share/dh-make-php/phppkginfo
DEBMAINTAINER=
DEPENDS=
DEPARCH=all
@@ -120,64 +114,63 @@
# get information about package from package.xml
eval_package
-echo "Creating debian source package: ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}"
+SRCPACKAGEDIR=${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}
+
+echo "Creating debian source package: ${SRCPACKAGEDIR}"
echo "Upstream is: ${UPSTREAM}"
get_maintainer
-if [ -d ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION} ] ; then
- echo "Directory '${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}' already exits."
+if [ -d ${SRCPACKAGEDI} ] ; then
+ echo "Directory '${SRCPACKAGEDIR}' already exits."
exit
fi
-ln -s ${PEARPACKAGENAME} ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}_${VERSION}.orig.tar.gz
-mkdir ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}
-mv ${PHP_PKG_NAME}-${VERSION} ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}
-mv package.xml ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}
-#tar czf ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}_${VERSION}.orig.tar.gz ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}
-mkdir -p ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian
+ln -s ${PEARPACKAGENAME} ${SRCPACKAGEDIR}.orig.tar.gz
+mkdir ${SRCPACKAGEDIR}
+mv ${PHP_PKG_NAME}-${VERSION} ${SRCPACKAGEDIR}
+mv package.xml ${SRCPACKAGEDIR}
+#tar czf ${SRCPACKAGEDIR}.orig.tar.gz ${SRCPACKAGEDIR}
+mkdir -p ${SRCPACKAGEDIR}/debian
-cp ${DEBTEMPDIR}/compat ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian
-cp ${DEBTEMPDIR}/dirs ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian
+cp ${DEBTEMPDIR}/compat ${SRCPACKAGEDIR}/debian
+cp ${DEBTEMPDIR}/dirs ${SRCPACKAGEDIR}/debian
install_docfiles
install_expfiles
-PACKAGEXML=${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/package.xml
-
sed -e "s/##date##/`(LC_ALL=C; date -R)`/g" \
-e "s/##maintainer##/${DEBMAINTAINER}/g" \
-e "s/##upstream##/${UPSTREAM}/g" \
-e "s/##license##/${LICENSE}/g" \
-e "s/##pearpkgname##/${PHP_PKG_NAME}/g" \
- ${DEBTEMPDIR}/copyright > ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/copyright
+ ${DEBTEMPDIR}/copyright > ${SRCPACKAGEDIR}/debian/copyright
if [ -n "${LICENSEFILE}" ]; then
- cat "${LICENSEFILE}" >> ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/copyright
+ cat "${LICENSEFILE}" >> ${SRCPACKAGEDIR}/debian/copyright
fi
sed -e "s/##packagename##/${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}/g" \
-e "s/##maintainer##/${DEBMAINTAINER}/g" \
-e "s§##summary##§${SUMMARY}§g" \
-e "s/##depends##/${DEPENDS}/g" \
-e "s/##architecture##/${DEPARCH}/g" \
- ${DEBTEMPDIR}/control > ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/control
- xsltproc --nonet --novalid --param Element "/*/description" ${PREFIX}/share/dh-make-php/xslt/common.xsl ${PACKAGEXML} | fold -s -w 70|sed -e "s§^[ \t]*$§.§g" -e "s§^§ §g" >> ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/control
-# sgrep -e '"<description>"__"</description>"' ${PACKAGEXML} | fold -s -w 70|sed -e "s§^[ \t]*$§.§g" -e "s§^§ §g" >> ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/control
+ ${DEBTEMPDIR}/control > ${SRCPACKAGEDIR}/debian/control
+ ${PHPPKGINFO} ${SRCPACKAGEDIR} description | fold -s -w 70|sed -e "s§^[ \t]*$§.§g" -e "s§^§ §g" >> ${SRCPACKAGEDIR}/debian/control
sed -e "s/##packagename##/${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}/g" \
-e "s/##version##/${VERSION}/g" \
-e "s/##pearpkgname##/${PHP_PKG_NAME}/g" \
- ${DEBTEMPDIR}/rules > ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/rules
-chmod 755 ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/rules
+ ${DEBTEMPDIR}/rules > ${SRCPACKAGEDIR}/debian/rules
+chmod 755 ${SRCPACKAGEDIR}/debian/rules
sed -e "s/##packagename##/${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}/g" \
-e "s/##date##/`(LC_ALL=C; date -R)`/g" \
-e "s/##maintainer##/${DEBMAINTAINER}/g" \
-e "s/##version##/${VERSION}/g" \
- ${DEBTEMPDIR}/changelog > ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/changelog
+ ${DEBTEMPDIR}/changelog > ${SRCPACKAGEDIR}/debian/changelog
sed -e "s/##packagename##/${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}/g" \
-e "s/##date##/`(LC_ALL=C; date -R)`/g" \
-e "s/##maintainer##/${DEBMAINTAINER}/g" \
- ${DEBTEMPDIR}/README.Debian > ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/README.Debian
+ ${DEBTEMPDIR}/README.Debian > ${SRCPACKAGEDIR}/debian/README.Debian
sed -e "s/##pearpkgname##/${PHP_PKG_NAME}/g" \
- ${DEBTEMPDIR}/watch > ${DEBPACKAGEPREFIX}-${PHP_PKG_LOWNAME}-${VERSION}/debian/watch
+ ${DEBTEMPDIR}/watch > ${SRCPACKAGEDIR}/debian/watch
Modified: trunk/dh-make-pecl
===================================================================
--- trunk/dh-make-pecl 2007-05-14 13:38:46 UTC (rev 251)
+++ trunk/dh-make-pecl 2007-05-14 13:40:06 UTC (rev 252)
@@ -9,7 +9,7 @@
# at http://www.gnu.org/.
PROGNAME=dh-make-pecl
-PROGVERSION=0.2.2
+PROGVERSION=0.2.3
PREFIX=/usr
DEBPACKAGEPREFIX=php
@@ -18,13 +18,7 @@
# if you change the examples directory make sure to adjust the
# regular expression to set the PACKAGEDOCFILES
PACKAGEEXPFILES="examples"
-# There has been versions of xmlstarlet which were called xml
-# instead of xmlstarlet
-if [ -x /usr/bin/xmlstarlet ]; then
- XMLSTARLET=/usr/bin/xmlstarlet
-else
- XMLSTARLET=/usr/bin/xml
-fi
+PHPPKGINFO=${PREFIX}/share/dh-make-php/phppkginfo
DEBMAINTAINER=
DEPENDS=
BUILDDEPENDS=
@@ -142,9 +136,6 @@
exit 0
fi
-# sets $PACKAGEVERSION, which is the version of the package.xml file
-get_packageversion
-
# get information about package from package.xml
eval_package
@@ -180,8 +171,6 @@
install_docfiles
install_expfiles
-PACKAGEXML=${SRCPACKAGEDIR}/package.xml
-
sed -e "s/##date##/`(LC_ALL=C; date -R)`/g" \
-e "s/##maintainer##/${DEBMAINTAINER}/g" \
-e "s/##upstream##/${UPSTREAM}/g" \
@@ -279,12 +268,10 @@
-e "s/##binpackagename##/${BINPACKAGE}/g" \
${DEBTEMPDIR}/control-bin >> ${SRCPACKAGEDIR}/debian/control
-# xsltproc --nonet --novalid --param Element "/package/summary" ${PREFIX}/share/dh-make-php/xslt/common.xsl ${SRCPACKAGEDIR}/package.xml|sed -e 's/^/ /g' >> ${SRCPACKAGEDIR}/debian/control
- ${XMLSTARLET} sel -T -t -v "/package/summary" ${SRCPACKAGEDIR}/package.xml|sed -e 's/^/ /g' >> ${SRCPACKAGEDIR}/debian/control
+ ${PHPPKGINFO} ${SRCPACKAGEDIR} summary|sed -e 's/^/ /g' >> ${SRCPACKAGEDIR}/debian/control
echo "" >> ${SRCPACKAGEDIR}/debian/control
echo " ." >> ${SRCPACKAGEDIR}/debian/control
-# xsltproc --nonet --novalid --param Element "/package/description" ${PREFIX}/share/dh-make-php/xslt/common.xsl ${SRCPACKAGEDIR}/package.xml|fold -s -w70|sed -e 's/^[[:space:]]*$/./g'|sed -e 's/^/ /g' >> ${SRCPACKAGEDIR}/debian/control
- ${XMLSTARLET} sel -T -t -v "/package/description" ${SRCPACKAGEDIR}/package.xml|fold -s -w70|sed -e 's/^[[:space:]]*$/./g'|sed -e 's/^/ /g' >> ${SRCPACKAGEDIR}/debian/control
+ ${PHPPKGINFO} ${SRCPACKAGEDIR} description|fold -s -w70|sed -e 's/^[[:space:]]*$/./g'|sed -e 's/^/ /g' >> ${SRCPACKAGEDIR}/debian/control
echo "" >> ${SRCPACKAGEDIR}/debian/control
echo "" >> ${SRCPACKAGEDIR}/debian/control
Modified: trunk/dh-make-php.lib
===================================================================
--- trunk/dh-make-php.lib 2007-05-14 13:38:46 UTC (rev 251)
+++ trunk/dh-make-php.lib 2007-05-14 13:40:06 UTC (rev 252)
@@ -1,9 +1,5 @@
#!/bin/sh
-get_packageversion() {
- PACKAGEVERSION=$(${XMLSTARLET} sel -t -m "/package" -v "@version" package.xml)
-}
-
get_zendapi() {
ZENDAPI=$(egrep "#define ZEND_MODULE_API_NO" /usr/include/php4/Zend/zend_modules.h | sed "s/#define ZEND_MODULE_API_NO //")
}
@@ -71,28 +67,19 @@
}
eval_package() {
- if [ "${PACKAGEVERSION}" = "2.0" ] ; then
- echo "lajdflaljfa"
- VERSION=$(${XMLSTARLET} sel -t -v "/package/version/release" package.xml)
- LICENSE=$(${XMLSTARLET} sel -t -v "/package/license" package.xml)
- UPSTREAM=$(xsltproc --nonet --novalid ${PREFIX}/share/dh-make-php/xslt/maintainers-2.0.xsl package.xml | sed -e 's/; $//g')
- PACKAGEDOCFILES=$(${XMLSTARLET} sel -t -m "/package/contents/*/file[@role='doc']" -v "@name" -o " " package.xml | sed -e 's# examples/[^ ]*##g' -e 's#^examples/[^ ]*##g')
- PACKAGETESTFILES=$(${XMLSTARLET} sel -t -m "/package/contents/*/file[@role='test']" -v "@name" -o " " package.xml | sed -e 's# examples/[^ ]*##g' -e 's#^examples/[^ ]*##g')
- else
- VERSION=$(xsltproc --nonet --novalid --param Element "/package/release/version" ${PREFIX}/share/dh-make-php/xslt/common.xsl package.xml)
- LICENSE=$(xsltproc --nonet --novalid --param Element "/package/release/license" ${PREFIX}/share/dh-make-php/xslt/common.xsl package.xml)
- UPSTREAM=$(xsltproc --nonet --novalid ${PREFIX}/share/dh-make-php/xslt/maintainers.xsl package.xml | sed -e 's/; $//g')
- PACKAGEDOCFILES=$(xsltproc --nonet --novalid --stringparam filetype doc ${PREFIX}/share/dh-make-php/xslt/filelist.xsl package.xml | sed -e 's# examples/[^ ]*##g' -e 's#^examples/[^ ]*##g')
- PACKAGETESTFILES=$(xsltproc --nonet --novalid --stringparam filetype test ${PREFIX}/share/dh-make-php/xslt/filelist.xsl package.xml)
- fi
+ VERSION=$(${PHPPKGINFO} . version)
+ LICENSE=$(${PHPPKGINFO} . license)
+ UPSTREAM=$(${PHPPKGINFO} . maintainers)
+
+# PACKAGEDOCFILES=$(${XMLSTARLET} sel ${XMLNSREPLACEOPTION} ${XMLNSREPLACEMENT} -t -m "/${XMLNSPREFIX}package/${XMLNSPREFIX}contents/*/${XMLNSPREFIX}file[@role='doc']" -v "@name" -o " " package.xml | sed -e 's# examples/[^ ]*##g' -e 's#^examples/[^ ]*##g')
+# PACKAGETESTFILES=$(${XMLSTARLET} sel ${XMLNSREPLACEOPTION} ${XMLNSREPLACEMENT} -t -m "/${XMLNSPREFIX}package/${XMLNSPREFIX}contents/*/${XMLNSPREFIX}file[@role='test']" -v "@name" -o " " package.xml | sed -e 's# examples/[^ ]*##g' -e 's#^examples/[^ ]*##g')
LOWLICENSE=$(echo $LICENSE | awk '{print tolower($0)}' | sed 's/ /-/g')
if [ -f "${PREFIX}/share/dh-make-php/licenses/${LOWLICENSE}" ]; then
LICENSEFILE=${PREFIX}/share/dh-make-php/licenses/${LOWLICENSE}
fi
- PHP_PKG_NAME=$(xsltproc --nonet --novalid --param Element "/package/name" ${PREFIX}/share/dh-make-php/xslt/common.xsl package.xml)
+ PHP_PKG_NAME=$(${PHPPKGINFO} . package)
PHP_PKG_LOWNAME=$(echo $PHP_PKG_NAME | awk '{print tolower($0)}' | sed 's/_/-/g')
- SUMMARY=$(xsltproc --nonet --novalid --param Element "/package/summary" ${PREFIX}/share/dh-make-php/xslt/common.xsl package.xml)
- DESCRIPTION=$(xsltproc --nonet --novalid --param Element "/package/description" ${PREFIX}/share/dh-make-php/xslt/common.xsl package.xml|fold -s -w60)
+ SUMMARY=$(${PHPPKGINFO} . summary)
}
# vim: syntax=sh
More information about the Dh-make-php-commits
mailing list