]> git.pld-linux.org Git - packages/php.git/blobdiff - php.spec
fix php-config --php-sapis
[packages/php.git] / php.spec
index 9bc318391ad45228a64e2d57e0f3c20db7852965..9ae9d197beac89829f0632cdf596ea79f5b7424d 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -8,7 +8,6 @@
 # - dba: enable: --with-tcadb=DIR        DBA: Tokyo Cabinet abstract DB support
 # --with-libmbfl=DIR      MBSTRING: Use external libmbfl.  DIR is the libmbfl base install directory BUNDLED
 # --with-onig=DIR         MBSTRING: Use external oniguruma. DIR is the oniguruma install prefix.
-# - recheck: define PDO_MYSQL_UNIX_ADDR (ensure if's correct with mysql-libs and mysqlng)
 # - uses libvpx for webp support, should use libwebp-devel instead?
 # - fpm -qn check fails, as it still loads /etc/php/php.ini
 # - co-install with php 5.3:
@@ -18,7 +17,6 @@
 #        file /usr/bin/php.cli from install of php54-cli-5.4.5-0.2.i686 conflicts with file from package php-cli-5.3.14-1.i686
 #        file /usr/share/man/man1/php.1.gz from install of php54-cli-5.4.5-0.2.i686 conflicts with file from package php-cli-5.3.14-1.i686
 # NOTE: mysqlnd does not support ssl or compression (see FAQ at http://dev.mysql.com/downloads/connector/php-mysqlnd/)
-# - mysqlnd seems to be default on (and statically linked!)
 # UNPACKAGED EXTENSION NOTES:
 # - com_dotnet is Win32-only
 # TODO:
@@ -133,7 +131,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %define                orgname php
 %define                php_suffix 54
 
-%define                rel     0.6
+%define                rel     0.15
 Summary:       PHP: Hypertext Preprocessor
 Summary(fr.UTF-8):     Le langage de script embarque-HTML PHP
 Summary(pl.UTF-8):     JÄ™zyk skryptowy PHP
@@ -238,7 +236,7 @@ BuildRequires:      elfutils-devel
 #BuildRequires:        flex
 %{?with_kerberos5:BuildRequires:       heimdal-devel}
 %{?with_system_libzip:BuildRequires:   libzip-devel >= 0.10-3}
-BuildRequires: mysql-devel
+%{!?with_mysqlnd:BuildRequires:        mysql-devel}
 BuildRequires: pkgconfig
 BuildRequires: sed >= 4.0
 %if %{with mssql} || %{with sybase_ct}
@@ -2168,7 +2166,7 @@ for sapi in $sapis; do
 %endif
        %{?with_mhash:--with-mhash=yes} \
        --with-mysql-sock=/var/lib/mysql/mysql.sock \
-       --with-pdo-mysql=shared%{?with_mysqlnd:,mysqlnd} \
+       --with-pdo-mysql=shared,%{!?with_mysqlnd:/usr}%{?with_mysqlnd:mysqlnd} \
        %{?with_oci8:--with-pdo-oci=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
        %{?with_odbc:--with-pdo-odbc=shared,unixODBC,/usr} \
        %{?with_pgsql:--with-pdo-pgsql=shared} \
@@ -2206,9 +2204,9 @@ for sapi in $sapis; do
        --with-mcrypt=shared \
        %{?with_mm:--with-mm} \
        %{?with_mssql:--with-mssql=shared} \
-       %{?with_mysqlnd:--with-mysqlnd=shared} \
-       --with-mysql=shared%{?with_mysqlnd:,mysqlnd} \
-       %{?with_mysqli:--with-mysqli=shared%{?with_mysqlnd:,mysqlnd}} \
+       %{?with_mysqlnd:--enable-mysqlnd=shared} \
+       --with-mysql=shared,%{!?with_mysqlnd:/usr}%{?with_mysqlnd:mysqlnd} \
+       %{?with_mysqli:--with-mysqli=shared,%{!?with_mysqlnd:/usr/bin/mysql_config}%{?with_mysqlnd:mysqlnd}} \
        %{?with_oci8:--with-oci8=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
        %{?with_openssl:--with-openssl=shared} \
        %{?with_kerberos5:--with-kerberos} \
@@ -2244,8 +2242,8 @@ for sapi in $sapis; do
 done
 
 # as we build each SAPI in own make, adjust php-config.in forehead
-sapis=$(awk '/^PHP_SAPI = /{print $3}' Makefile.* | sort -u | grep -v none | xargs)
-sed -i -e "s,@PHP_INSTALLED_SAPIS@,$sapis," "scripts/php-config.in"
+sapis=$(%{__sed} -rne 's/^PHP_INSTALLED_SAPIS = (.+)/\1/p' Makefile.* | tr ' ' '\n' | sort -u | xargs)
+%{__sed} -i -e "s,@PHP_INSTALLED_SAPIS@,$sapis," scripts/php-config.in
 
 # must make libphp_common first, so modules can link against it.
 cp -af php_config.h.cli main/php_config.h
@@ -2278,7 +2276,6 @@ cp -pf php_config.h.fpm main/php_config.h
 %{__make} -f Makefile.fpm
 ./sapi/fpm/php-fpm -n -m
 [ $(./sapi/fpm/php-fpm -n -m | grep cgi-fcgi) = "cgi-fcgi" ]
-
 %endif
 
 # CLI
@@ -2386,7 +2383,7 @@ libtool --mode=install install -p sapi/apache2handler/libphp5.la $RPM_BUILD_ROOT
 
 # install litespeed sapi
 %if %{with litespeed}
-libtool --mode=install install -p sapi/litespeed/php $RPM_BUILD_ROOT%{_sbindir}/php.litespeed
+libtool --mode=install install -p sapi/litespeed/php $RPM_BUILD_ROOT%{_sbindir}/%{name}.litespeed
 %endif
 
 libtool --mode=install install -p libphp_common.la $RPM_BUILD_ROOT%{_libdir}
@@ -2402,13 +2399,18 @@ cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
 # install FCGI PM
 %if %{with fpm}
 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/fpm.d,%{_sbindir}}
-libtool --mode=install install -p sapi/fpm/php-fpm $RPM_BUILD_ROOT%{_sbindir}
-cp -p sapi/fpm/php-fpm.8 $RPM_BUILD_ROOT%{_mandir}/man8
+libtool --mode=install install -p sapi/fpm/php-fpm $RPM_BUILD_ROOT%{_sbindir}/%{name}-fpm
+cp -p sapi/fpm/php-fpm.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}-fpm.8
 cp -p sapi/fpm/php-fpm.conf $RPM_BUILD_ROOT%{_sysconfdir}
 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
-install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/php-fpm
+install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fpm
+%{__sed} -i -e '
+       s#/usr/lib/php#%{php_extensiondir}#
+       s#/etc/php#%{_sysconfdir}#
+       s#@processname@#%{name}-fpm#g
+' $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fpm $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.conf
 install -d $RPM_BUILD_ROOT/etc/logrotate.d
-cp -p %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/php-fpm
+cp -p %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
 %endif
 
 # install Embedded API
@@ -2516,13 +2518,13 @@ fi
 %useradd -u 51 -r -s /bin/false -c "HTTP User" -g http http
 
 %post fpm
-/sbin/chkconfig --add php-fpm
-%service php-fpm restart
+/sbin/chkconfig --add %{name}-fpm
+%service %{name}-fpm restart
 
 %preun fpm
 if [ "$1" = 0 ]; then
-       %service php-fpm stop
-       /sbin/chkconfig --del php-fpm
+       %service %{name}-fpm stop
+       /sbin/chkconfig --del %{name}-fpm
 fi
 
 %postun fpm
@@ -2697,10 +2699,10 @@ fi
 %doc sapi/fpm/{CREDITS,LICENSE}
 %dir %{_sysconfdir}/fpm.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-fpm.conf
-%attr(755,root,root) %{_sbindir}/php-fpm
-%{_mandir}/man8/php-fpm.8*
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/php-fpm
-%attr(754,root,root) /etc/rc.d/init.d/php-fpm
+%attr(755,root,root) %{_sbindir}/%{name}-fpm
+%{_mandir}/man8/%{name}-fpm.8*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}-fpm
+%attr(754,root,root) /etc/rc.d/init.d/%{name}-fpm
 %endif
 
 %files common
This page took 0.036437 seconds and 4 git commands to generate.