Browse Source

made phpize operable introducing a soft dependency to autoconf, automake, libtool

Christoph Schug 21 years ago
parent
commit
f87838a92f
2 changed files with 35 additions and 4 deletions
  1. 28 0
      php/php.patch
  2. 7 4
      php/php.spec

+ 28 - 0
php/php.patch

@@ -0,0 +1,28 @@
+--- php-4.3.7/scripts/phpize.in.orig	2003-11-14 04:21:15.000000000 +0100
++++ php-4.3.7/scripts/phpize.in	2004-06-11 09:27:51.866609632 +0200
+@@ -1,5 +1,25 @@
+ #! /bin/sh
+ 
++PATH="@l_prefix@/bin;@l_prefix@/sbin:$PATH"
++export PATH
++
++prereq_fail=""
++for prereq in autoconf automake libtool; do
++    @l_rpm@ --quiet -q $prereq
++    if [ $? -ne 0 ]; then
++        prereq_fail="$prereq_fail $prereq"
++    fi
++done
++if [ ".$prereq_fail" != . ]; then
++    { echo "OpenPKG: ERROR: please install following OpenPKG packages first"
++      echo "before running $0:"
++      for prereq in $prereq_fail; do
++          echo "o $prereq"
++      done
++    } | @l_rpmtool@ msg -b -t error
++    exit 1
++fi
++
+ prefix='@prefix@'
+ phpdir="$prefix/lib/php/build"
+ includedir="$prefix/include/php"

+ 7 - 4
php/php.spec

@@ -38,7 +38,7 @@ Class:        BASE
 Group:        Language
 License:      PHP
 Version:      %{V_php}
-Release:      20040604
+Release:      20040611
 
 #   package options
 %option       with_bc                   no
@@ -103,6 +103,7 @@ Release:      20040604
 #   list of sources
 Source0:      http://static.php.net/www.php.net/distributions/php-%{V_php}.tar.gz
 Patch0:       http://www.hardened-php.net/hardened-php-%{V_php}-%{V_php_hardened}.patch.gz
+Patch1:       php.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -253,8 +254,12 @@ AutoReqProv:  no
         configure \
         ext/gd/config.m4
 %if "%{with_hardened}" == "yes"
-    %patch -p1
+    %patch -p1 -P 0
 %endif
+    %patch -p1 -P 1
+    %{l_shtool} subst \
+        %{l_value -s l_prefix l_rpm l_rpmtool} \
+        scripts/phpize.in
 
 %build
     #   configure package
@@ -478,8 +483,6 @@ AutoReqProv:  no
         $RPM_BUILD_ROOT%{l_prefix}/etc/php/php.ini
 
     #   strip down installation
-    rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/php/build
-    rmdir $RPM_BUILD_ROOT%{l_prefix}/lib/php >/dev/null 2>&1 || true
     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
 
     #   determine installation files