debpear-0.3/0000755000000000000000000000000012021064676007650 5ustar debpear-0.3/debian/0000755000000000000000000000000012021064676011072 5ustar debpear-0.3/debian/compat0000644000000000000000000000000212021064676012270 0ustar 8 debpear-0.3/debian/control0000644000000000000000000000175612021064676012506 0ustar Source: debpear Section: php Priority: optional Maintainer: Debian PKG PHP PEAR team Uploaders: Thomas Goirand Build-Depends: debhelper (>= 8) Standards-Version: 3.9.3 Vcs-Browser: http://git.debian.org/?p=pkg-php/debpear.git Vcs-Git: http://git.debian.org/git/pkg-php/debpear.git Package: debpear Architecture: all Depends: php-pear, pkg-php-tools, devscripts, build-essential, fakeroot, ${misc:Depends} Description: automatically builds and installs PEAR package as Debian packages With debpear, you can install PEAR packages out of only the name of a PHP PEAR module. Debpear will download, create, and build a Debian package out of the pear package that you selected, and eventually install it in your system. . The goal of debpear isn't to replace the real work of a Debian maintainer, but rather to allow its users to quickly build and install a PEAR package in a clean, Debian way, when this PEAR package doesn't exist in Debian yet. debpear-0.3/debian/manpages0000644000000000000000000000001212021064676012601 0ustar debpear.1 debpear-0.3/debian/source/0000755000000000000000000000000012021064676012372 5ustar debpear-0.3/debian/source/format0000644000000000000000000000001512021064676013601 0ustar 3.0 (native) debpear-0.3/debian/gbp.conf0000644000000000000000000000012512021064676012507 0ustar [DEFAULT] debian-branch = debian-sid [git-buildpackage] export-dir = ../build-area/ debpear-0.3/debian/install0000644000000000000000000000002112021064676012454 0ustar debpear /usr/bin debpear-0.3/debian/changelog0000644000000000000000000000117212021064676012745 0ustar debpear (0.3) unstable; urgency=low * Fixed the -i option when run as root. -- Thomas Goirand Mon, 03 Sep 2012 08:25:44 +0000 debpear (0.2) unstable; urgency=low * Removed the -p parameter, so that we can just call like this: debpear without needing to add -p (Closes: #677386). * Allow the use of a specified file as tarball instead of using pear download command (Closes: #677387). -- Thomas Goirand Wed, 13 Jun 2012 15:44:16 +0000 debpear (0.1) unstable; urgency=low * Initial release. -- Thomas Goirand Sat, 02 Jun 2012 16:31:10 +0000 debpear-0.3/debian/copyright0000644000000000000000000000217112021064676013026 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Contact: Thomas Goirand Source: git clone http://git.debian.org/git/pkg-php/debpear.git Files: * Copyright: (c) 2012, Thomas Goirand License: LGPL-2.1 License: LGPL-2.1 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . This library 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 Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the complete text of the GNU Lesser General Public License (LGPL) may be found in /usr/share/common-licenses/LGPL-2.1 debpear-0.3/debian/rules0000755000000000000000000000003612021064676012151 0ustar #!/usr/bin/make -f %: dh $@ debpear-0.3/debpear0000755000000000000000000001671212021064676011207 0ustar #!/bin/sh # Copyright: (c) 2012, Thomas Goirand # License: LGPL-2.1 # This library is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # . # This library 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 Lesser General Public License for more # details. # . # You should have received a copy of the GNU Lesser General Public License along # with this library; if not, write to the Free Software Foundation, Inc., 51 # Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # . # On Debian systems, the complete text of the GNU Lesser General Public License # (LGPL) may be found in /usr/share/common-licenses/LGPL-2.1 set -e # Path to the pkg-php-tools script PHPPKGINFO=/usr/share/pkg-php-tools/scripts/phppkginfo # Default values DO_INSTALL=no PEAR_CHANNEL=pear.php.net BUILD_DIR=./build-area VERBOSE=no ###################################### ### EVALUATION OF INPUT PARAMETERS ### ###################################### print_usage () { echo "$0 [options] " echo "Options are:" echo " Specify build dir: --build-dir|-b " echo " Be more verbose: --verbose|-v" echo " Specify PEAR channel: --channel|-c " echo " Specify tarball: --tarball|-t --pkg-version|-pv " echo " [--wget|-w ]" echo "Install the resulting package: --install|-i" } echoIfVerbose () { if [ ${VERBOSE} = "yes" ] ; then echo ${1} fi } for i in $@ ; do case ${1} in "--channel"|"-c") echo "Channels other than pear.php.net aren't supported yet" exit 1 PEAR_CHANNEL=${2} shift shift ;; "--tarball"|"-t") TARBALL=${2} if ! [ -f "${TARBALL}" -a "${5}" != "--wget" ] ; then if [ "${5}" != "--wget" -a "${5}" != "-w" ] ; then echo "Cannot find specified tarball file." print_usage exit 1 fi fi if [ "${3}" != "--pkg-version" -a "${3}" != "-pv" ] ; then echo "Please specify a package version when using --tarball|-t" print_usage exit 1 fi if [ -z "${4}" ] ; then echo "No package version specified after --pkg-version|-pv" print_usage exit 1 fi VERSION_STRING="${4}" shift shift shift shift if [ "${1}" = "--wget" -o "${1}" = "-w" ] ; then WGET_URL=${2} shift shift fi ;; "--build-dir"|"-b") BUILD_DIR=${2} shift shift ;; "--install"|"-i") DO_INSTALL=yes shift ;; "--verbose"|"-v") VERBOSE=yes shift ;; *) ;; esac done if [ $# != 1 ] ; then echo "No PEAR package given as parameter: exiting" print_usage exit 1 fi PEAR_PKG_NAME=$1 if [ -z "${PEAR_PKG_NAME}" ] ; then echo "No PEAR package defined: exiting" print_usage exit 1 fi ########################### ### START OF THE SCRIPT ### ########################### echoIfVerbose "debpear ===> Preparing build area in ${BUILD_DIR}" DEB_PKG_NAME=`${PHPPKGINFO} debian_pkgname ${PEAR_CHANNEL} ${PEAR_PKG_NAME}` if ! [ -d "${BUILD_DIR}" ] ; then mkdir ${BUILD_DIR} fi if [ -n "${TARBALL}" ] ; then if [ -n "${WGET_URL}" ] ; then if ! [ -f ${TARBALL} ] ; then wget ${WGET_URL} -O ${TARBALL} fi fi cp ${TARBALL} ${BUILD_DIR}/${PEAR_PKG_NAME}-${VERSION_STRING}.tgz fi cd ${BUILD_DIR} if [ -z "${TARBALL}" ] ; then pear download ${PEAR_PKG_NAME} fi ### CALCULATION OF VERSIONS AND NAMES ### DOWNLOADED_PEAR_PKG=`ls | grep ${PEAR_PKG_NAME}` FILENAME_LEN=`echo ${DOWNLOADED_PEAR_PKG} | awk '{printf length($0)}'` PEAR_PKG_NAME_LEN=`echo ${PEAR_PKG_NAME} | awk '{printf length($0)}'` VERSION_START=$((PEAR_PKG_NAME_LEN + 2)) VERSION_LEN=$((${FILENAME_LEN} - ${PEAR_PKG_NAME_LEN} - 5)) VERSION_STRING=`echo ${DOWNLOADED_PEAR_PKG} | awk '{printf substr($0,'${VERSION_START}','${VERSION_LEN}')}'` DEB_SRC_FOLDER="${DEB_PKG_NAME}-${VERSION_STRING}" DEB_PKG_RESULT="${DEB_PKG_NAME}_${VERSION_STRING}-1_all.deb" cp ${DOWNLOADED_PEAR_PKG} ${DEB_PKG_NAME}_${VERSION_STRING}.orig.tar.gz if ! [ -d "${DEB_SRC_FOLDER}" ] ; then mkdir ${DEB_SRC_FOLDER} fi echo "debpear ===> Extracting orig tarball" if [ ${VERBOSE} = "yes" ] ; then TAR_OPT="v" fi tar -C ${DEB_SRC_FOLDER} -xzf${TAR_OPT} ${DOWNLOADED_PEAR_PKG} cd ${DEB_SRC_FOLDER} ######################################### ### GENERATION OF THE ./debian FOLDER ### ######################################### echo "debpear ===> Building ${DEB_PKG_RESULT}" mkdir -p debian/source echo "3.0 (quilt)" >debian/source/format echo "8" >debian/compat if ! [ -f debian/changelog ] ; then EDITOR=touch dch --create --package ${DEB_PKG_NAME} --distribution unstable --urgency low -v ${VERSION_STRING}-1 fi echo "Source: ${DEB_PKG_NAME} Section: php Priority: optional Maintainer: Debian PHP PEAR Maintainers Build-Depends: debhelper (>= 8), pkg-php-tools Build-Depends-Indep: php-pear Standards-Version: 3.9.3 Vcs-Browser: http://git.debian.org/?p=pkg-php/${DEB_PKG_NAME}.git Vcs-Git: http://git.debian.org/git/pkg-php/${DEB_PKG_NAME}.git Homepage: http://pear.php.net/package/${PEAR_PKG_NAME} Package: ${DEB_PKG_NAME} Architecture: all Depends: \${misc:Depends}, php-pear, \${phppear:Debian-Depends} Recommends: \${phppear:Debian-Recommends} Breaks: \${phppear:Debian-Breaks} Description: \${phppear:summary} \${phppear:description} " >debian/control echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ${PEAR_PKG_NAME} Source: http://pear.php.net/package/${PEAR_PKG_NAME} Files: debian/* Copyright: Generated by debpear License: BSD-2-clauses Files: * Copyright: License: License: BSD-2-clauses Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ">debian/copyright echo "#!/usr/bin/make -f %: dh \$@ --buildsystem=phppear --with phppear " >debian/rules echo "version=3 http://pear.php.net/package/${PEAR_PKG_NAME}/download http://download.pear.php.net/package/${PEAR_PKG_NAME}-(.*).tgz " >debian/watch ############################### ### BUILDING AND INSTALLING ### ############################### dpkg-buildpackage cd .. if [ "${DO_INSTALL}" = "yes" ] ; then if ! [ `whoami` = "root" ] ; then sudo dpkg -i ${DEB_PKG_RESULT} else dpkg -i ${DEB_PKG_RESULT} fi fi debpear-0.3/debpear.10000644000000000000000000000527112021064676011341 0ustar .TH debpear 1 .SH NAME debpear \- automatically builds and installs PEAR packages as Debian packages .SH SYNOPSIS .B debpear .B [options] .B .SH DESCRIPTION .LP .I debpear is a tool to automatically create and build a Debian package out of a PHP PEAR package. It will download the PEAR package from pear.php.net, then by looking into it, create the corresponding Debian package, and eventually also installs it. .SH PARAMETERS .LP .B .IP Defines the PEAR package name you want to install, as seen on the http://pear.php.net/ site. Make sure respect the case in the name of the package (for example: Package_NAME). .SH OPTIONS .LP \-\-build\-dir|\-b .IP Specify the directory where the Debian package will be built. .LP \-\-verbose|\-v .IP Makes debpear more verbose. .LP \-\-channel|\-c .I channel .IP Specify the URL .I channel of the PEAR package. Currently not implemented: please contribute! .LP \-\-tarball|\-t .I tarball \-\-pkg\-version|\-pv .I pkg\-version [ \-\-wget|\-w .I URL ] .IP Do not use "pear download" to optain the PEAR package from upstream authors. Instead, use .I tarball and use .I pkg\-version when building the package. Eventually also download the tarball from .I URL using wget before building. .LP \-\-install|\-i .IP Install the resulting debian package in your system. Note that you must be root to use this option. If you aren't root, then debpear will try to get root using sudo. .SH EXAMPLE .LP debpear \-i Auth_RADIUS .IP This will create a php\-auth\-radius package in ./build\-area, and automatically install it. Because it's written in the package.xml shipped with Auth_RADIUS at pear.php.net, php\-auth\-radius will depend on php5\-radius. .LP debpear \-t current.tgz \-pv 1.3.1 \-w http://downloads.jasig.org/cas\-clients/php/current.tgz CAS .IP Downloads cas\-clients from http://downloads.jasig.org/cas\-clients/php/current.tgz, as current.tgz in the current directory, then builds it as if it was downloaded as CAS\-1.3.1.tgz by "pear download". .SH IMPORTANT .IP Note that the debian/copyright file generated by debpear isn't good enough for redistribution of the created packages. You should carefuly review the PEAR package license before doing so. Also, debpear has been created for convenience, but it will never replace the manual work of an experienced Debian maintainer for creating PEAR packages. It can, however, be used to create a template package quickly, before a careful review, in order to save time building a Debian PEAR package. .SH AUTHORS .IP debpear has been written by Thomas Goirand , and is maintained inside the PKG PHP PEAR Debian team, that can be reached at: .