|
@@ -1,3 +1,5 @@
|
|
|
+%bcond_without apache2
|
|
|
+
|
|
|
%global majorver 5
|
|
|
%global _name php%{majorver}
|
|
|
|
|
@@ -27,8 +29,8 @@
|
|
|
Name: php5
|
|
|
Summary: The PHP HTML-embedded scripting language. (PHP: Hypertext Preprocessor)
|
|
|
Summary(ja): HTML 埋め込み型スクリプト言語 PHP
|
|
|
-Version: 5.3.7
|
|
|
-Release: 2%{_dist_release}
|
|
|
+Version: 5.3.9
|
|
|
+Release: 1%{_dist_release}
|
|
|
|
|
|
Vendor: Project Vine
|
|
|
Distribution: Vine Linux
|
|
@@ -44,13 +46,17 @@ Source20: README.vine
|
|
|
Source21: php.ini-vine
|
|
|
Source23: php5.conf-apache1
|
|
|
Source24: php5.conf-apache2
|
|
|
+Source25: php-fpm.init
|
|
|
+Source26: php-fpm.conf
|
|
|
+Source27: default-pool.conf
|
|
|
+Source28: php-fpm.logrotate
|
|
|
|
|
|
Patch33: php-5.2.4-phpincludedir.patch
|
|
|
# Additional feature
|
|
|
Patch51: php-5.3.0-session_strict_mode.patch
|
|
|
|
|
|
# security fix
|
|
|
-Patch1000: php-5.3.7-bug55439.patch
|
|
|
+#Patch1000: php-5.3.7-bug55439.patch
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
BuildRequires: autoconf
|
|
@@ -159,7 +165,9 @@ Provides: php-apache = %{version}-%{release}
|
|
|
%description apache
|
|
|
This package contains the php5 module for Apache version 1.
|
|
|
%endif
|
|
|
+
|
|
|
#----------------------------------------------------------------------
|
|
|
+%if %{with apache2}
|
|
|
%package apache2
|
|
|
Group: System Environment/Daemons
|
|
|
Summary: php5 module for Apache version 2
|
|
@@ -175,6 +183,19 @@ Provides: php-apache2 = %{version}-%{release}
|
|
|
|
|
|
Apache2 must be configured to use prefork MPM because
|
|
|
this module is not threadsafe.
|
|
|
+%endif
|
|
|
+
|
|
|
+#----------------------------------------------------------------------
|
|
|
+%package fpm
|
|
|
+Group: System Environment/Daemons
|
|
|
+Summary: PHP with FastCGI Process Manager (FPM)
|
|
|
+Summary(ja): FastCGI Process Manager (FPM) が組み込まれたPHP
|
|
|
+Requires: %{name} = %{version}-%{release}
|
|
|
+
|
|
|
+%description fpm
|
|
|
+ PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI
|
|
|
+implementation with some additional features useful for sites of
|
|
|
+any size, especially busier sites.
|
|
|
|
|
|
#======================================================================
|
|
|
# modules
|
|
@@ -373,19 +394,17 @@ in their scripts.
|
|
|
%patch33 -p1 -b .phpincludedir
|
|
|
%patch51 -p1 -b .strict_session
|
|
|
|
|
|
-%patch1000 -p3 -b .bug55439
|
|
|
-
|
|
|
# Prevent %%doc confusion over LICENSE files
|
|
|
cp Zend/LICENSE Zend/ZEND_LICENSE
|
|
|
cp Zend/ChangeLog Zend/ZEND_ChangeLog
|
|
|
cp TSRM/LICENSE TSRM_LICENSE
|
|
|
|
|
|
-mkdir -p php5-apache2
|
|
|
-cp %{SOURCE20} php5-apache2/README.vine
|
|
|
+mkdir -p %{_name}-apache2
|
|
|
+cp %{SOURCE20} %{_name}-apache2/README.vine
|
|
|
|
|
|
# Source is built three times:
|
|
|
# once for /usr/bin/php, once for the Apache1 module, once for the Apache2 module.
|
|
|
-mkdir build-cgi build-apache build-apache2
|
|
|
+mkdir build-cgi build-fpm build-apache build-apache2
|
|
|
|
|
|
#======================================================================
|
|
|
%build
|
|
@@ -414,12 +433,13 @@ CFLAGS="-fPIC" \
|
|
|
--disable-rpath \
|
|
|
--enable-bcmath \
|
|
|
--enable-calendar \
|
|
|
- --enable-dba=shared --with-gdbm --with-db4 \
|
|
|
+ --enable-dba=shared --with-gdbm --with-db4 --with-inifile \
|
|
|
--enable-exif \
|
|
|
--enable-ftp \
|
|
|
--enable-inline-optimization \
|
|
|
--enable-intl=shared \
|
|
|
--enable-mbstring \
|
|
|
+ --enable-pdo=shared \
|
|
|
--enable-shmop \
|
|
|
--enable-soap \
|
|
|
--enable-sockets \
|
|
@@ -428,7 +448,7 @@ CFLAGS="-fPIC" \
|
|
|
--enable-zend-multibyte \
|
|
|
--with-bz2 \
|
|
|
--with-curl \
|
|
|
- --with-gd --with-jpeg-dir=%{_prefix} --with-png-dir=%{_prefix} --with-freetype-dir=%{_prefix} \
|
|
|
+ --with-gd=%{_prefix} --with-jpeg-dir=%{_prefix} --with-png-dir=%{_prefix} --with-freetype-dir=%{_prefix} \
|
|
|
--with-gettext \
|
|
|
--with-gmp \
|
|
|
--with-imap=shared --with-imap-ssl \
|
|
@@ -437,15 +457,13 @@ CFLAGS="-fPIC" \
|
|
|
%endif
|
|
|
--with-ldap=shared \
|
|
|
--with-mcrypt=shared,%{_prefix} \
|
|
|
- --with-mysql=shared,%{_prefix} \
|
|
|
- --with-mysqli=shared \
|
|
|
+ --with-mysql=shared,mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd \
|
|
|
--with-openssl \
|
|
|
- --enable-pdo=shared --with-pdo-odbc=shared,unixODBC,%{_prefix} --with-pdo-mysql=shared,%{_prefix} --with-pdo-pgsql=shared,%{_prefix} --with-pdo-sqlite=shared,%{_prefix} \
|
|
|
- --with-pgsql=shared \
|
|
|
+ --with-pgsql=shared --with-pdo-pgsql=shared,%{_prefix} \
|
|
|
--with-pic \
|
|
|
--with-snmp=shared,%{_prefix} \
|
|
|
- --with-sqlite=shared --enable-sqlite-utf8 \
|
|
|
- --with-unixODBC=shared,%{_prefix} \
|
|
|
+ --with-sqlite=shared --enable-sqlite-utf8 --with-pdo-sqlite=shared,%{_prefix} \
|
|
|
+ --with-unixODBC=shared,%{_prefix} --with-pdo-odbc=shared,unixODBC,%{_prefix} \
|
|
|
--with-xmlrpc=shared \
|
|
|
--with-xsl \
|
|
|
--with-zlib \
|
|
@@ -467,6 +485,13 @@ build \
|
|
|
--with-readline
|
|
|
popd
|
|
|
|
|
|
+#----------------------------------------------------------------------
|
|
|
+# Build /usr/sbin/php-fpm
|
|
|
+pushd build-fpm
|
|
|
+build \
|
|
|
+ --enable-fpm
|
|
|
+popd
|
|
|
+
|
|
|
#----------------------------------------------------------------------
|
|
|
# Build Apache1 module
|
|
|
%if %{?_dist_release} == "vl5"
|
|
@@ -477,11 +502,12 @@ popd
|
|
|
%endif
|
|
|
#----------------------------------------------------------------------
|
|
|
# Build Apache2 module
|
|
|
+%if %{with apache2}
|
|
|
pushd build-apache2
|
|
|
build \
|
|
|
--with-apxs2=%{_bindir}/apxs
|
|
|
popd
|
|
|
-
|
|
|
+%endif
|
|
|
#======================================================================
|
|
|
%install
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|
@@ -526,7 +552,7 @@ cp $RPM_BUILD_ROOT%{_mandir}/man1/phpize{%{majorver},}.1
|
|
|
|
|
|
# fix path in phar
|
|
|
|
|
|
-perl -pi -e 's|^#!/.+/build-cgi/sapi/cli/php$|#!/usr/bin/php5|' %{buildroot}%{_bindir}/phar.phar
|
|
|
+perl -pi -e 's|^#!/.+/build-cgi/sapi/cli/php$|#!/usr/bin/%{_name}|' %{buildroot}%{_bindir}/phar.phar
|
|
|
|
|
|
|
|
|
%if %{with_pear}
|
|
@@ -540,9 +566,23 @@ done
|
|
|
%endif
|
|
|
|
|
|
# Install cgi/fcgi binaries
|
|
|
-mv $RPM_BUILD_ROOT%{_bindir}/php-cgi%{majorver} $RPM_BUILD_ROOT%{_bindir}/%{_name}-cgi
|
|
|
-
|
|
|
-# Install the Apache1 module, CGI SAPI, config fragment
|
|
|
+mv $RPM_BUILD_ROOT%{_bindir}/php-cgi%{majorver} %{buildroot}%{_bindir}/%{_name}-cgi
|
|
|
+
|
|
|
+# Install fpm binaries
|
|
|
+%{__install} -d %{buildroot}%{_sbindir}
|
|
|
+%{__install} -d %{buildroot}%{_initdir}
|
|
|
+%{__install} -m 755 -d %{buildroot}%{php_confdir}/fpm.d
|
|
|
+%{__install} -d %{buildroot}%{_mandir}/man8
|
|
|
+%{__install} -d %{buildroot}%{_sysconfdir}/logrotate.d
|
|
|
+%{__install} -m 755 build-fpm/sapi/fpm/php-fpm %{buildroot}%{_sbindir}/%{_name}-fpm
|
|
|
+%{__install} -m 755 %{SOURCE25} %{buildroot}%{_initdir}/php-fpm
|
|
|
+%{__install} -m 644 build-fpm/sapi/fpm/php-fpm.8 %{buildroot}%{_mandir}/man8/
|
|
|
+%{__install} -m 644 %{SOURCE26} %{buildroot}%{php_confdir}/
|
|
|
+%{__install} -m 644 %{SOURCE27} %{buildroot}%{php_confdir}/fpm.d/
|
|
|
+%{__install} -m 644 %{SOURCE28} %{buildroot}%{_sysconfdir}/logrotate.d/php-fpm
|
|
|
+
|
|
|
+
|
|
|
+# 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}
|
|
@@ -555,6 +595,7 @@ ln -sf %{_bindir}/%{_name}-cgi $RPM_BUILD_ROOT%{apache1_fcgidir}/%{_name}-fcgi
|
|
|
%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}
|
|
@@ -563,6 +604,7 @@ 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
|
|
|
+%endif
|
|
|
|
|
|
%{__install} -m 755 -d $RPM_BUILD_ROOT%{php_confdir}/php.d
|
|
|
%{__install} -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/%{_name}
|
|
@@ -575,7 +617,7 @@ ln -sf %{_bindir}/%{_name}-cgi $RPM_BUILD_ROOT%{apache2_fcgidir}/%{_name}-fcgi
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
# Generate files lists and stub .ini files for each subpackage
|
|
|
-for mod in dba imap ldap mcrypt snmp xmlrpc intl\
|
|
|
+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
|
|
@@ -639,6 +681,23 @@ if [ "$1" = 0 ]; then
|
|
|
/sbin/update-alternatives --auto php
|
|
|
fi
|
|
|
|
|
|
+%post fpm
|
|
|
+/sbin/update-alternatives --install %{_sbindir}/php-fpm \
|
|
|
+ php-fpm %{_sbindir}/php%{majorver}-fpm %{majorver}0
|
|
|
+
|
|
|
+# fix broken symlink if it's there
|
|
|
+if [ ! -f %{_sbindir}/php-fpm ] ; then
|
|
|
+ /sbin/update-alternatives --auto php-fpm
|
|
|
+fi
|
|
|
+/sbin/chkconfig --add php-fpm
|
|
|
+
|
|
|
+%preun fpm
|
|
|
+if [ "$1" = 0 ]; then
|
|
|
+ /sbin/chkconfig --del php-fpm
|
|
|
+ /sbin/update-alternatives --remove php-fpm %{_sbindir}/php%{majorver}-fpm
|
|
|
+ /sbin/update-alternatives --auto php-fpm
|
|
|
+fi
|
|
|
+
|
|
|
%post pear
|
|
|
/sbin/update-alternatives \
|
|
|
--install %{_bindir}/pear pear %{_bindir}/pear%{majorver} %{majorver}0 \
|
|
@@ -664,6 +723,7 @@ fi
|
|
|
chown root:apache %{_localstatedir}/%{_name}/session 2>/dev/null || true
|
|
|
%endif
|
|
|
|
|
|
+%if %{with apache2}
|
|
|
%post apache2
|
|
|
chown root:apache %{_localstatedir}/%{_name}/session 2>/dev/null || true
|
|
|
|
|
@@ -678,6 +738,7 @@ prefork MPM. Run the following command as root to switch MPM:
|
|
|
|
|
|
EOF
|
|
|
fi
|
|
|
+%endif
|
|
|
|
|
|
%clean
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
|
@@ -735,13 +796,26 @@ rm -f files.*
|
|
|
%{apache1_fcgidir}/%{_name}-fcgi
|
|
|
%endif
|
|
|
|
|
|
+%if %{with apache2}
|
|
|
%files apache2
|
|
|
%defattr(-,root,root)
|
|
|
-%doc php5-apache2/README.vine
|
|
|
+%doc %{_name}-apache2/README.vine
|
|
|
%config %{apache2_confdir}/%{_name}.conf
|
|
|
%{apache2_moduledir}/lib%{_name}.so
|
|
|
%{apache2_cgidir}/%{_name}-cgi
|
|
|
%{apache2_fcgidir}/%{_name}-fcgi
|
|
|
+%endif
|
|
|
+
|
|
|
+%files fpm
|
|
|
+%defattr(-,root,root)
|
|
|
+%{_sbindir}/%{_name}-fpm
|
|
|
+%{_initdir}/php-fpm
|
|
|
+%{_mandir}/man8/php-fpm.8*
|
|
|
+%dir %{php_confdir}/fpm.d
|
|
|
+%config(noreplace) %{php_confdir}/php-fpm.conf
|
|
|
+%config(noreplace) %{php_confdir}/fpm.d/*.conf
|
|
|
+%config(noreplace) %{_sysconfdir}/logrotate.d/php-fpm
|
|
|
+
|
|
|
|
|
|
%files dba -f files.dba
|
|
|
%files imap -f files.imap
|
|
@@ -758,8 +832,15 @@ rm -f files.*
|
|
|
|
|
|
#======================================================================
|
|
|
%changelog
|
|
|
+* Thu Jan 12 2012 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.3.9-1
|
|
|
+- new upstream release.
|
|
|
+
|
|
|
+* Sat Oct 29 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.3.8-1
|
|
|
+- new upstream release.
|
|
|
+- added a subpackage "php5-fpm".
|
|
|
+
|
|
|
* Tue Aug 23 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.3.7-2
|
|
|
-- fix bug#55439.
|
|
|
+- fixed bug#55439.
|
|
|
|
|
|
* Thu Aug 18 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.3.7-1
|
|
|
- new upstream release.
|