cvs: php4 /pear Makefile.frag

From: Date: Thu, 09 May 2002 12:45:02 +0000
Subject: cvs: php4 /pear Makefile.frag
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-3723@lists.php.net to get a copy of this message
ssb Thu May 9 08:45:02 2002 EDT Modified files: /php4/pear Makefile.frag Log: * use PEAR installer to install stuff (won't overwrite if newer versions of packages already are installed) Index: php4/pear/Makefile.frag diff -u php4/pear/Makefile.frag:1.16 php4/pear/Makefile.frag:1.17 --- php4/pear/Makefile.frag:1.16 Wed May 8 22:32:18 2002 +++ php4/pear/Makefile.frag Thu May 9 08:45:02 2002 @@ -8,13 +8,13 @@ peardir=$(PEAR_INSTALLDIR) -PEAR_SUBDIRS = \ - Archive \ - Console \ - PEAR \ - PEAR/Command \ - PEAR/Frontend \ - XML +#PEAR_SUBDIRS = \ +# Archive \ +# Console \ +# PEAR \ +# PEAR/Command \ +# PEAR/Frontend \ +# XML # These are moving to /pear (in cvs): # Crypt \ @@ -28,30 +28,30 @@ # Net \ # Schedule \ -PEAR_FILES = \ - Archive/Tar.php \ - Console/Getopt.php \ - PEAR.php \ - PEAR/Autoloader.php \ - PEAR/Command.php \ - PEAR/Command/Auth.php \ - PEAR/Command/Common.php \ - PEAR/Command/Config.php \ - PEAR/Command/Install.php \ - PEAR/Command/Package.php \ - PEAR/Command/Registry.php \ - PEAR/Command/Remote.php \ - PEAR/Frontend/CLI.php \ - PEAR/Frontend/Gtk.php \ - PEAR/Common.php \ - PEAR/Config.php \ - PEAR/Dependency.php \ - PEAR/Installer.php \ - PEAR/Packager.php \ - PEAR/Registry.php \ - PEAR/Remote.php \ - System.php \ - XML/Parser.php +#PEAR_FILES = \ +# Archive/Tar.php \ +# Console/Getopt.php \ +# PEAR.php \ +# PEAR/Autoloader.php \ +# PEAR/Command.php \ +# PEAR/Command/Auth.php \ +# PEAR/Command/Common.php \ +# PEAR/Command/Config.php \ +# PEAR/Command/Install.php \ +# PEAR/Command/Package.php \ +# PEAR/Command/Registry.php \ +# PEAR/Command/Remote.php \ +# PEAR/Frontend/CLI.php \ +# PEAR/Frontend/Gtk.php \ +# PEAR/Common.php \ +# PEAR/Config.php \ +# PEAR/Dependency.php \ +# PEAR/Installer.php \ +# PEAR/Packager.php \ +# PEAR/Registry.php \ +# PEAR/Remote.php \ +# System.php \ +# XML/Parser.php # These are moving to /pear (in cvs): # Crypt/CBC.php \ @@ -95,31 +95,41 @@ # Net/Socket.php \ # Schedule/At.php \ -#PEARCMD=$(top_builddir)/sapi/cli/php $(builddir)/scripts/pear -# -#install-pear-installer: $(top_builddir)/sapi/cli/php -# version=grep '<version>' $(srcdir)/package-pear.xml|head -1|cut -d\> -f2|cut -d\< -f1; \ -# if $(PEARCMD) shell-test PEAR; then -# if ! $(PEARCMD) shell-test PEAR $$version; then \ -# $(PEARCMD) upgrade package-pear.xml; \ -# fi; \ -# else; \ -# $(PEARCMD) install package-pear.xml; \ -# fi +PEARCMD=$(top_builddir)/sapi/cli/php -d include_path=$(top_srcdir)/pear pear/scripts/pear.in + +install-pear-installer: $(top_builddir)/sapi/cli/php + @if $(PEARCMD) shell-test PEAR; then \ + version=grep '<version>' $(srcdir)/package-pear.xml|head -1|cut -d\> -f2|cut -d\< -f1; \ + if ! $(PEARCMD) shell-test PEAR $$version; then \ + echo "Found an older version of the PEAR Installer, upgrading..."; \ + $(PEARCMD) -q upgrade $(srcdir)/package-pear.xml; \ + else \ + echo "No need to install or upgrade the PEAR Installer..."; \ + fi; \ + else \ + echo "PEAR Installer not found, installing..."; \ + $(PEARCMD) -q install $(srcdir)/package-pear.xml; \ + fi + +install-pear-packages: # requires cli installed + @/bin/ls -1 $(srcdir)/packages | while read package; do \ + case $$package in \ + *.tgz) pkg=$${package%.tgz};; \ + *.tar) pkg=$${package%.tar};; \ + *) continue;; \ + esac; \ + pkgname="$${pkg%-*}"; pkgver="$${pkg#*-}"; \ + if $(INSTALL_ROOT)$(bindir)/pear -d php_dir=$(INSTALL_ROOT)$(PEAR_INSTALLDIR) shell-test $$pkgname $$pkgver; then \ + echo "$$pkgname $$pkgver: already installed"; \ + else \ + $(INSTALL_ROOT)$(bindir)/pear -q -d php_dir=$(INSTALL_ROOT)$(PEAR_INSTALLDIR) -d bin_dir=$(INSTALL_ROOT)$(bindir) -d doc_dir=$(INSTALL_ROOT)$(datadir)/doc/pear -d ext_dir=$(INSTALL_ROOT)$(EXTENSION_DIR) install $(srcdir)/packages/$$package 2>&1 | sed -e "s/^/$$pkgname $$pkgver: /"; \ + fi; \ + done install-pear: @if $(mkinstalldirs) $(INSTALL_ROOT)$(peardir); then \ - for i in $(PEAR_SUBDIRS); do \ - $(mkinstalldirs) $(INSTALL_ROOT)$(peardir)/$$i; \ - done; \ - for i in $(PEAR_FILES); do \ - echo "Installing $$i"; \ - dir=echo $$i|sed 's%[^/][^/]*$$%%'; \ - $(INSTALL_DATA) $(srcdir)/$$i $(INSTALL_ROOT)$(peardir)/$$dir; \ - done; \ - rm -f $(INSTALL_ROOT)$(peardir)/PEAR/Command/Login.php; \ - rm -f $(INSTALL_ROOT)$(peardir)/PEAR/CommandResponse.php; \ - rm -f $(INSTALL_ROOT)$(peardir)/PEAR/Uploader.php; \ + $(MAKE) install-pear-installer; \ + $(MAKE) install-pear-packages; \ else \ cat $(srcdir)/install-pear.txt; \ exit 5; \

« previous php.pear.cvs (#3723) next »