# - 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:
# 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:
%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
#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}
%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} \
--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} \
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
%{__make} -f Makefile.fpm
./sapi/fpm/php-fpm -n -m
[ $(./sapi/fpm/php-fpm -n -m | grep cgi-fcgi) = "cgi-fcgi" ]
-
%endif
# CLI
# 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}
# 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
%endif
# install CLI
-libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php.cli
-cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/php.1
-echo ".so php.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.cli.1
-ln -sf php.cli $RPM_BUILD_ROOT%{_bindir}/php
+libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/%{name}
+cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
+echo ".so %{name}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
+ln -sf %{name} $RPM_BUILD_ROOT%{_bindir}/php
cp -p php.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
%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
%defattr(644,root,root,755)
%dir %{_sysconfdir}/cli.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-cli.ini
-%attr(755,root,root) %{_bindir}/php.cli
-%{_mandir}/man1/php.cli.1*
+%attr(755,root,root) %{_bindir}/%{name}
+%{_mandir}/man1/%{name}.1*
%files program
%defattr(644,root,root,755)
%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