Browse Source

* php5: add /etc/rpm/macros.pear

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@5886 ec354946-7b23-47d6-9f5a-488ba84defc7
shaolin 13 years ago
parent
commit
b8d64ea7d7
1 changed files with 55 additions and 41 deletions
  1. 55 41
      p/php5/php5-vl.spec

+ 55 - 41
p/php5/php5-vl.spec

@@ -30,7 +30,7 @@ Name: php5
 Summary: The PHP HTML-embedded scripting language. (PHP: Hypertext Preprocessor)
 Summary(ja): HTML 埋め込み型スクリプト言語 PHP
 Version: 5.3.10
-Release: 3%{_dist_release}
+Release: 4%{_dist_release}
 
 Vendor: Project Vine
 Distribution: Vine Linux
@@ -42,6 +42,9 @@ URL: http://www.php.net/
 
 Source0: http://www.php.net/distributions/%{srcname}.tar.bz2
 
+# borrowed from Fedora's php-pear 1:1.9.4-5
+Source13: macros.pear
+
 Source20: README.vine
 Source21: php.ini-vine
 Source23: php5.conf-apache1
@@ -148,6 +151,8 @@ Requires(post): alternatives
 Requires: %{name} = %{version}-%{release}
 Conflicts: php-pear <= 4.4.2-0vl2
 Provides: php-pear = %{version}-%{release}
+# pear's version itself is 1.9.4
+Provides: php-pear(PEAR) = 1.9.4
 
 %description pear
 PEAR is a framework and distribution system for reusable PHP
@@ -515,7 +520,7 @@ popd
 %endif
 #======================================================================
 %install
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
 
 #export PHP_PEAR_SYSCONF_DIR=%{php_confdir}
 #export PHP_PEAR_TEMP_DIR=%{pear_cachedir}
@@ -533,27 +538,27 @@ unset http_proxy
 #----------------------------------------------------------------------
 pushd build-cgi
 # Install everything from the CGI SAPI build
-make install INSTALL_ROOT=$RPM_BUILD_ROOT
-#cp $RPM_BUILD_ROOT%{_bindir}/%{_name}{,-cgi}
+make install INSTALL_ROOT=%{buildroot}
+#cp %{buildroot}%{_bindir}/%{_name}{,-cgi}
 # Install the CLI SAPI as /usr/bin/%{_name}
-#make install-cli INSTALL_ROOT=$RPM_BUILD_ROOT
+#make install-cli INSTALL_ROOT=%{buildroot}
 popd
 
 # Install the default configuration file
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{php_confdir}
-%{__install} -m 644 php.ini-production $RPM_BUILD_ROOT%{php_confdir}/php.ini
+%{__install} -m 755 -d %{buildroot}%{php_confdir}
+%{__install} -m 644 php.ini-production %{buildroot}%{php_confdir}/php.ini
 
 # Append php.ini-vine
-cat %{SOURCE21} >> $RPM_BUILD_ROOT%{php_confdir}/php.ini
+cat %{SOURCE21} >> %{buildroot}%{php_confdir}/php.ini
 # Use correct libdir
-sed -i -e 's|%{_prefix}/lib|%{_libdir}|' $RPM_BUILD_ROOT%{php_confdir}/php.ini
+sed -i -e 's|%{_prefix}/lib|%{_libdir}|' %{buildroot}%{php_confdir}/php.ini
 
 # Remove suffix
-ln -sf php-config%{majorver} $RPM_BUILD_ROOT%{_bindir}/php-config
-ln -sf phpize%{majorver} $RPM_BUILD_ROOT%{_bindir}/phpize
-%{__install} -m 755 scripts/dev/phpextdist $RPM_BUILD_ROOT%{_bindir}
-cp $RPM_BUILD_ROOT%{_mandir}/man1/php-config{%{majorver},}.1
-cp $RPM_BUILD_ROOT%{_mandir}/man1/phpize{%{majorver},}.1
+ln -sf php-config%{majorver} %{buildroot}%{_bindir}/php-config
+ln -sf phpize%{majorver} %{buildroot}%{_bindir}/phpize
+%{__install} -m 755 scripts/dev/phpextdist %{buildroot}%{_bindir}
+cp %{buildroot}%{_mandir}/man1/php-config{%{majorver},}.1
+cp %{buildroot}%{_mandir}/man1/phpize{%{majorver},}.1
 
 # fix path in phar
 
@@ -565,13 +570,18 @@ perl -pi -e 's|^#!/.+/build-cgi/sapi/cli/php$|#!/usr/bin/%{_name}|' %{buildroot}
 perl -pi -e 's#s:([0-9]+):(.)(%{buildroot})+#"s:".($1-length($3)).":$2"#eg;' %{buildroot}%{php_confdir}/pear.conf
 
 for cmd in pear peardev pecl; do
-  cp $RPM_BUILD_ROOT%{_bindir}/${cmd}{,%{majorver}}
+  cp %{buildroot}%{_bindir}/${cmd}{,%{majorver}}
 done
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{pear_cachedir}
+%{__install} -m 755 -d %{buildroot}%{pear_cachedir}
+
+# install rpmmacro file for pear
+mkdir -p %{buildroot}%{_sysconfdir}/rpm 
+install -m 644 -c %{SOURCE13} \
+	%{buildroot}%{_sysconfdir}/rpm/macros.pear
 %endif
 
 # Install cgi/fcgi binaries
-mv $RPM_BUILD_ROOT%{_bindir}/php-cgi%{majorver} %{buildroot}%{_bindir}/%{_name}-cgi
+mv %{buildroot}%{_bindir}/php-cgi%{majorver} %{buildroot}%{_bindir}/%{_name}-cgi
 
 # Install fpm binaries
 %{__install} -d %{buildroot}%{_sbindir}
@@ -589,43 +599,43 @@ mv $RPM_BUILD_ROOT%{_bindir}/php-cgi%{majorver} %{buildroot}%{_bindir}/%{_name}-
 
 # Install the Apache1 module, config fragment
 %if %{?_dist_release} == "vl5"
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{apache1_moduledir}
-%{__install} -m 755 build-apache/libs/lib%{_name}.so $RPM_BUILD_ROOT%{apache1_moduledir}
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{apache1_cgidir}
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{apache1_fcgidir}
-ln -sf %{_bindir}/%{_name}-cgi $RPM_BUILD_ROOT%{apache1_cgidir}/%{_name}-cgi
-ln -sf %{_bindir}/%{_name}-cgi $RPM_BUILD_ROOT%{apache1_fcgidir}/%{_name}-fcgi
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{apache1_confdir}
-%{__install} -m 644 %{SOURCE23} $RPM_BUILD_ROOT%{apache1_confdir}/%{_name}.conf
+%{__install} -m 755 -d %{buildroot}%{apache1_moduledir}
+%{__install} -m 755 build-apache/libs/lib%{_name}.so %{buildroot}%{apache1_moduledir}
+%{__install} -m 755 -d %{buildroot}%{apache1_cgidir}
+%{__install} -m 755 -d %{buildroot}%{apache1_fcgidir}
+ln -sf %{_bindir}/%{_name}-cgi %{buildroot}%{apache1_cgidir}/%{_name}-cgi
+ln -sf %{_bindir}/%{_name}-cgi %{buildroot}%{apache1_fcgidir}/%{_name}-fcgi
+%{__install} -m 755 -d %{buildroot}%{apache1_confdir}
+%{__install} -m 644 %{SOURCE23} %{buildroot}%{apache1_confdir}/%{_name}.conf
 %endif
 
 # Install the Apache2 module, CGI SAPI, config fragment
 %if %{with apache2}
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{apache2_moduledir}
-%{__install} -m 755 build-apache2/libs/lib%{_name}.so $RPM_BUILD_ROOT%{apache2_moduledir}
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{apache2_cgidir}
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{apache2_fcgidir}
-ln -sf %{_bindir}/%{_name}-cgi $RPM_BUILD_ROOT%{apache2_cgidir}/%{_name}-cgi
-ln -sf %{_bindir}/%{_name}-cgi $RPM_BUILD_ROOT%{apache2_fcgidir}/%{_name}-fcgi
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{apache2_confdir}
-%{__install} -m 644 %{SOURCE24} $RPM_BUILD_ROOT%{apache2_confdir}/%{_name}.conf
+%{__install} -m 755 -d %{buildroot}%{apache2_moduledir}
+%{__install} -m 755 build-apache2/libs/lib%{_name}.so %{buildroot}%{apache2_moduledir}
+%{__install} -m 755 -d %{buildroot}%{apache2_cgidir}
+%{__install} -m 755 -d %{buildroot}%{apache2_fcgidir}
+ln -sf %{_bindir}/%{_name}-cgi %{buildroot}%{apache2_cgidir}/%{_name}-cgi
+ln -sf %{_bindir}/%{_name}-cgi %{buildroot}%{apache2_fcgidir}/%{_name}-fcgi
+%{__install} -m 755 -d %{buildroot}%{apache2_confdir}
+%{__install} -m 644 %{SOURCE24} %{buildroot}%{apache2_confdir}/%{_name}.conf
 %endif
 
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{php_confdir}/php.d
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/%{_name}
+%{__install} -m 755 -d %{buildroot}%{php_confdir}/php.d
+%{__install} -m 755 -d %{buildroot}%{_localstatedir}/%{_name}
 # for session.save_path
-%{__install} -m 770 -d $RPM_BUILD_ROOT%{_localstatedir}/%{_name}/session
+%{__install} -m 770 -d %{buildroot}%{_localstatedir}/%{_name}/session
 # for extension modules
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{_libdir}/%{_name}
+%{__install} -m 755 -d %{buildroot}%{_libdir}/%{_name}
 # for --with-exec-dir
-%{__install} -m 755 -d $RPM_BUILD_ROOT%{_libdir}/%{_name}/bin
+%{__install} -m 755 -d %{buildroot}%{_libdir}/%{_name}/bin
 
 #----------------------------------------------------------------------
 # Generate files lists and stub .ini files for each subpackage
 for mod in dba imap ldap mcrypt snmp xmlrpc intl \
     mysql mysqli odbc pgsql sqlite \
     pdo pdo_odbc pdo_mysql pdo_pgsql pdo_sqlite; do
-    cat > $RPM_BUILD_ROOT%{php_confdir}/php.d/${mod}.ini <<EOF
+    cat > %{buildroot}%{php_confdir}/php.d/${mod}.ini <<EOF
 ; Enable ${mod} extension module
 extension=${mod}.so
 EOF
@@ -649,7 +659,7 @@ cat files.pdo_sqlite >> files.pdo
 
 #----------------------------------------------------------------------
 # Remove unpackaged files
-rm -f $RPM_BUILD_ROOT%{_libdir}/%{_name}/*.a
+rm -f %{buildroot}%{_libdir}/%{_name}/*.a
 
 # Remove irrelevant docs
 rm -f README.{Zeus,QNX,CVS-RULES}
@@ -746,7 +756,7 @@ fi
 %endif
 
 %clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
 rm -f files.*
 
 #======================================================================
@@ -785,6 +795,7 @@ rm -f files.*
 %files pear
 %defattr(-,root,root)
 %config %{php_confdir}/pear.conf
+%config %{_sysconfdir}/rpm/macros.pear
 %{_bindir}/pear%{majorver}
 %{_bindir}/peardev%{majorver}
 %{_bindir}/pecl%{majorver}
@@ -837,6 +848,9 @@ rm -f files.*
 
 #======================================================================
 %changelog
+* Sun Mar 11 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 5.3.10-4
+- add /etc/rpm/macros.pear (Source13) from Fedora
+
 * Wed Mar 07 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.3.10-3
 - rebuild with net-snmp-5.7.1
 - update Source21 (php.ini-vine)