cvs: php4 / configure.in /pear Makefile.in pear.in php-config.in phpize.in /pear/PEAR Installer.php

From: Date: Mon, 24 Jul 2000 23:55:34 +0000
Subject: cvs: php4 / configure.in /pear Makefile.in pear.in php-config.in phpize.in /pear/PEAR Installer.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-903@lists.php.net to get a copy of this message
ssb Mon Jul 24 16:55:34 2000 EDT Modified files: /php4 configure.in /php4/pear Makefile.in pear.in php-config.in phpize.in /php4/pear/PEAR Installer.php Log: * generate pear scripts properly with configure Index: php4/configure.in diff -u php4/configure.in:1.159 php4/configure.in:1.160 --- php4/configure.in:1.159 Tue Jul 18 04:02:28 2000 +++ php4/configure.in Mon Jul 24 16:55:34 2000 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.159 2000/07/18 11:02:28 ssb Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.160 2000/07/24 23:55:34 ssb Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -542,16 +542,18 @@ CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" fi - PHP_ARG_ENABLE(pear,whether to install PEAR, [ --disable-pear Do not install PEAR],yes) if test "$PHP_PEAR" = "yes"; then PEAR_DIR=pear fi - - +PHP_OUTPUT(pear/pear) +PHP_OUTPUT(pear/run-tests) +PHP_OUTPUT(pear/phpize) +PHP_OUTPUT(pear/php-config) +PHP_OUTPUT(pear/PEAR.php) divert(5) @@ -666,6 +668,7 @@ EXTENSION_DIR="$prefix/lib/php/extensions/$PART1-$PART2-$ZEND_MODULE_API_NO" PEAR_INSTALLDIR="$prefix/lib/php" + INCLUDE_PATH=".:$PEAR_INSTALLDIR" AC_BUILD_RPATH @@ -798,7 +801,15 @@ $PHP_OUTPUT_FILES ], [], [ -PHP_GEN_MAKEFILES +if test "$CONFIG_FILES" = ""; then + PHP_GEN_MAKEFILES +else + for file in $PHP_FAST_OUTPUT_FILES; do + if test "$file" = "$CONFIG_FILES"; then + PHP_GEN_MAKEFILE($file) + fi + done +fi if test ! -f $srcdir/ext/bcmath/number.c; then echo "creating number.c" Index: php4/pear/Makefile.in diff -u php4/pear/Makefile.in:1.28 php4/pear/Makefile.in:1.29 --- php4/pear/Makefile.in:1.28 Mon Jul 24 01:05:51 2000 +++ php4/pear/Makefile.in Mon Jul 24 16:55:34 2000 @@ -1,5 +1,9 @@ -install_targets = install-data-local install-headers install-build +install_targets = \ + install-data-local \ + install-headers \ + install-build \ + install-programs include $(top_srcdir)/build/rules.mk @@ -7,7 +11,8 @@ PEAR_SUBDIRS = \ DB \ - File + File \ + PEAR PEAR_FILES = \ DB.php \ @@ -52,32 +57,16 @@ dynlib.m4 \ acinclude.m4 +bin_PROGRAMS = phpize php-config pear phpextdist + install-build: - -@$(mkinstalldirs) $(builddir) $(bindir) && \ - (cd $(top_srcdir) && cp $(BUILD_FILES) $(builddir)) && \ - echo "creating phpize" && \ - sed \ - -e 's#@PREFIX@#$(prefix)#' \ - < $(srcdir)/phpize.in > $(bindir)/phpize.tmp && \ - chmod +x $(bindir)/phpize.tmp && \ - mv $(bindir)/phpize.tmp $(bindir)/phpize && \ - echo "creating php-config" && \ - sed \ - -e 's#@PREFIX@#$(prefix)#' \ - -e 's#@PHPINCLUDEDIR@#$(phpincludedir)#g' \ - -e 's#@EXTENSION_DIR@#$(EXTENSION_DIR)#g' \ - < $(srcdir)/php-config.in > $(bindir)/php-config.tmp && \ - chmod +x $(bindir)/php-config.tmp && \ - mv $(bindir)/php-config.tmp $(bindir)/php-config && \ - echo "creating pear" && \ - sed \ - -e 's#@PREFIX@#$(prefix)#' \ - -e 's#@EXTENSION_DIR@#$(EXTENSION_DIR)#g' \ - -e 's#@PEAR_INSTALLDIR@#$(PEAR_INSTALLDIR)#g' \ - < $(srcdir)/pear.in > $(bindir)/pear.tmp && \ - chmod +x $(bindir)/pear.tmp && \ - mv $(bindir)/pear.tmp $(bindir)/pear && \ - cp $(srcdir)/phpextdist $(bindir)/phpextdist + $(mkinstalldirs) $(builddir) $(bindir) && \ + (cd $(top_srcdir) && cp $(BUILD_FILES) $(builddir)) + +install-programs: + for prog in $(bin_PROGRAMS); do \ + $(INSTALL) -m 755 $$prog $(bindir)/$$prog; \ + done HEADER_DIRS = \ / \ @@ -100,3 +89,18 @@ (cd $(top_srcdir)/$$i && cp -p *.h $(phpincludedir)/$$i; \ cd $(top_builddir)/$$i && cp -p *.h $(phpincludedir)/$$i) 2>/dev/null || true; \ done + +run-tests: run-tests.in $(top_builddir)/config.status + (cd ..;CONFIG_FILES=pear/run-tests CONFIG_HEADERS= $(top_builddir)/config.status) + +pear: pear.in $(top_builddir)/config.status + (cd ..;CONFIG_FILES=pear/pear CONFIG_HEADERS= $(top_builddir)/config.status) + +phpize: phpize.in $(top_builddir)/config.status + (cd ..;CONFIG_FILES=pear/phpize CONFIG_HEADERS= $(top_builddir)/config.status) + +php-config: php-config.in $(top_builddir)/config.status + (cd ..;CONFIG_FILES=pear/php-config CONFIG_HEADERS= $(top_builddir)/config.status) + +PEAR.php: PEAR.php.in $(top_builddir)/config.status + (cd ..;CONFIG_FILES=pear/PEAR.php CONFIG_HEADERS= $(top_builddir)/config.status) Index: php4/pear/pear.in diff -u php4/pear/pear.in:1.2 php4/pear/pear.in:1.3 --- php4/pear/pear.in:1.2 Mon Jul 24 01:05:51 2000 +++ php4/pear/pear.in Mon Jul 24 16:55:34 2000 @@ -1,19 +1,19 @@ -#!/usr/local/bin/php -f +#!@prefix@/bin/php -f <?php // -*- C++ -*- -error_reporting(1); +require_once "PEAR.php"; +require_once "PEAR/Installer.php"; -// config section, should be read from php-config -$debug = true; -$pear_phpdir = "@PEAR_INSTALLDIR@"; -$pear_extdir = "@EXTENSION_DIR@"; -//$pear_extdir = ini_get("extension_dir"); -$pear_docdir = ""; // empty means don't install docs +error_reporting(1); $pkgfile = $argv[0]; if (!$pkgfile) { die("Usage: pear <packagefile>\n"); } + +$p = new PEAR_Installer(); +$p->debug = true; +$p->install($pkgfile); ?> Index: php4/pear/php-config.in diff -u php4/pear/php-config.in:1.3 php4/pear/php-config.in:1.4 --- php4/pear/php-config.in:1.3 Wed Jun 14 01:30:37 2000 +++ php4/pear/php-config.in Mon Jul 24 16:55:34 2000 @@ -1,7 +1,11 @@ #! /bin/sh -prefix='@PREFIX@' -includes='-I@PHPINCLUDEDIR@ -I@PHPINCLUDEDIR@/main -I@PHPINCLUDEDIR@/Zend -I@PHPINCLUDEDIR@/TSRM' +prefix='@prefix@' +includedir='@includedir@/php' +includes="-I$includedir -I$includedir/main -I$includedir/Zend" +if test '@TSRM_DIR@' != ''; then + includes="$includes -I$includedir/TSRM" +fi extension_dir='@EXTENSION_DIR@' case "$1" in Index: php4/pear/phpize.in diff -u php4/pear/phpize.in:1.2 php4/pear/phpize.in:1.3 --- php4/pear/phpize.in:1.2 Tue May 2 13:10:46 2000 +++ php4/pear/phpize.in Mon Jul 24 16:55:34 2000 @@ -1,6 +1,6 @@ #! /bin/sh -prefix='@PREFIX@' +prefix='@prefix@' phpdir="$prefix/lib/php/build" builddir="pwd" FILES_BUILD="dynlib.mk fastgen.sh library.mk ltlib.mk program.mk rules.mk rules_pear.mk shtool" Index: php4/pear/PEAR/Installer.php diff -u php4/pear/PEAR/Installer.php:1.1 php4/pear/PEAR/Installer.php:1.2 --- php4/pear/PEAR/Installer.php:1.1 Mon Jul 24 01:05:51 2000 +++ php4/pear/PEAR/Installer.php Mon Jul 24 16:55:34 2000 @@ -44,10 +44,10 @@ var $pkgdir; /** directory where PHP code files go */ - var $pear_phpdir = '/usr/local/lib/php'; + var $pear_phpdir = PEAR_INSTALL_DIR; /** directory where PHP extension files go */ - var $pear_extdir = '/usr/local/lib/php/extensions/debug-non-zts-20000609'; + var $pear_extdir = PEAR_EXTENSION_DIR; /** directory where documentation goes */ var $pear_docdir = ''; @@ -259,10 +259,6 @@ xml_parser_free($xp); - if ($this->pkginfo['pkgtype'] != "binary") { - return new PEAR_Installer_Error("Invalid package: only binary packages supported yet.\n"); - } - return true; } @@ -274,6 +270,9 @@ $this->current_element = $name; switch ($name) { case "Package": + if (strtolower($attribs["Type"]) != "binary") { + return new PEAR_Installer_Error("Invalid package: only binary packages supported yet.\n"); + } $this->pkginfo['pkgtype'] = strtolower($attribs["Type"]); break; } @@ -291,8 +290,6 @@ // {{{ char_handler() function char_handler($xp, $data) { - global $debug; - switch ($this->current_element) { case "DestDir": $this->destdir = trim($data); @@ -318,7 +315,7 @@ print "Error: could not mkdir $d\n"; break; } - if ($debug) print "[debug] created directory $d\n"; + if ($this->debug) print "[debug] created directory $d\n"; break; case "File": if (!$this->pear_phpdir) { @@ -330,7 +327,8 @@ print "Error: failed to copy $this->pkgdir/$file to $d\n"; break; } - if ($debug) print "[debug] installed $d/$file\n"; + $this->cacheUpdateFrom("$d/$file"); + if ($this->debug) print "[debug] installed $d/$file\n"; break; case "ExtDir": if (!$this->pear_extdir) { @@ -350,7 +348,7 @@ print "Error: could not mkdir $d\n"; break; } - if ($debug) print "[debug] created directory $d\n"; + if ($this->debug) print "[debug] created directory $d\n"; break; case "ExtFile": if (!$this->pear_extdir) { @@ -362,7 +360,7 @@ print "Error: failed to copy $this->pkgdir/$file to $d\n"; break; } - if ($debug) print "[debug] installed $d/$file\n"; + if ($this->debug) print "[debug] installed $d/$file\n"; break; case "DocDir": if (!$this->pear_docdir) { @@ -382,7 +380,7 @@ print "Error: could not mkdir $d\n"; break; } - if ($debug) print "[debug] created directory $d\n"; + if ($this->debug) print "[debug] created directory $d\n"; break; case "DocFile": if (!$this->pear_docdir) { @@ -394,7 +392,7 @@ print "Error: failed to copy $this->pkgdir/$file to $d\n"; break; } - if ($debug) { + if ($this->debug) { print "[debug] installed $d/$file\n"; } break;

« previous php.cvs (#903) next »