%define contentdir /var/www/htdocs %define _libdir64 /opt/freeware/lib64 Summary: The PHP HTML-embedded scripting language Name: php Version: 7.2.16 Release: 1 License: The PHP License v3.01 Group: Development/Languages URL: http://www.php.net/ Source0: http://php.net/downloads.php/php-%{version}.tar.gz Source1: %{name}.conf Source2: %{name}.ini Source3: %{name}64.ini Source4: %{name}.conf_64 Patch0: %{name}-%{version}-aixconfig.patch Patch2: %{name}-%{version}-aix-build.patch Patch3: %{name}-%{version}-aix-network.patch Patch4: %{name}-%{version}-aix-setrlimit.patch Patch6: %{name}-%{version}-aix-tests.patch Patch7: %{name}-%{version}-aix-trailing-slash.patch Patch8: %{name}-%{version}-phpini.patch BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildRequires: make BuildRequires: httpd >= 2.4.38 httpd-devel >= 2.4.38 BuildRequires: libiconv >= 1.14-1 Provides: mod_php = %{version}-%{release} Requires: libxml2 >= 2.9.5-1 Requires: openldap >= 2.4.45-1 Requires: httpd >= 2.4.38 Requires: libgcc >= 6.3.0 Requires: libiconv >= 1.14-1 Requires: xz-libs >= 5.2.3-1 %description PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly. %package cli Group: Development/Languages Summary: Command-line interface for PHP Provides: %{name}-cgi = %{version}-%{release} Requires: libiconv >= 1.14-1 Requires: openldap >= 2.4.45-1 Requires: xz-libs >= 5.2.3-1 Requires: libxml2 >= 2.9.5-1 Requires: cyrus-sasl >= 2.1.26-3 Requires: %{name}-common = %{version}-%{release} %description cli The php-cli package contains the command-line interface executing PHP scripts, %{_bindir}/php, and the CGI interface. %package common Group: Development/Languages Summary: Common files for PHP %description common The php-common package contains files used by both the php package and the php-cli package. %package devel Group: Development/Libraries Summary: Files needed for building PHP extensions %description devel The php-devel package contains the files needed for building PHP extensions. If you need to compile your own PHP extensions, you will need to install this package. %prep %setup -q %patch0 -p1 -b .aixconfig %patch2 -p1 -b .build %patch3 -p1 -b .network %patch4 -p1 -b .setrlimit %patch6 -p1 -b .tests %patch7 -p1 -b .trailing-slash rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit %build # Seems to help build faster, using bash export CC="/opt/freeware/bin/gcc -fPIC" export CXX="/opt/freeware/bin/g++" # build on 64bit mode export OBJECT_MODE=64 cd 64bit export CFLAGS="-Wl,-bbigtoc -I/usr/include/openssl -O2 -maix64" export LDFLAGS="-L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" export PHP_LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib" patch -p0 < %{PATCH8} # install extension modules in %{_libdir}/php/modules. export EXTENSION_DIR=%{_libdir64}/php/modules # shell function to configure and build a PHP tree buildphp() { ln -sf ../configure ./configure --prefix=%{_prefix} \ --libdir=%{_libdir64}/php \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --enable-shared \ --enable-cli \ --mandir=%{_mandir} \ --with-ldap=/opt/freeware \ --disable-debug \ --enable-dom \ --enable-json \ --enable-soap=shared \ --enable-ftp \ --without-pear \ --with-openssl=/usr \ --with-iconv=/opt/freeware \ $* make } # build the command line and the CGI version of PHP mkdir build-cgi cd build-cgi buildphp gmake -k test || true cd .. # build the Apache module mkdir build-apache cd build-apache buildphp \ --with-apxs2=%{_prefix}/bin/apxs_64 \ --libdir=%{_libdir64}/php gmake -k test || true cd .. # build on 32bit mode cd ../32bit export OBJECT_MODE=32 export CFLAGS="-Wl,-bbigtoc -I/usr/include/openssl -O2" export LDFLAGS="-L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export PHP_LDFLAGS="-L/opt/freeware/lib" # install extension modules in %{_libdir}/php/modules. export EXTENSION_DIR=%{_libdir}/php/modules # shell function to configure and build a PHP tree buildphp() { ln -sf ../configure ./configure --prefix=%{_prefix} \ --libdir=%{_libdir}/php \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --enable-shared \ --enable-cli \ --mandir=%{_mandir} \ --with-ldap=/opt/freeware \ --disable-debug \ --enable-dom \ --enable-json \ --enable-soap=shared \ --enable-ftp \ --without-pear \ --with-openssl=/usr \ --with-iconv=/opt/freeware \ $* make } # build the command line and the CGI version of PHP mkdir build-cgi cd build-cgi buildphp gmake -k test || true cd .. # build the Apache module mkdir build-apache cd build-apache buildphp \ --with-apxs2=%{_prefix}/bin/apxs gmake -k test || true cd .. %install export CONFIG_SHELL=/opt/freeware/bin/bash export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} # install on 64bit mode export OBJECT_MODE=64 cd 64bit # unfortunately 'make install-sapi' does not seem to work for use, therefore # we have to install the targets separately cd build-cgi for TARGET in install-cli install-build install-headers install-programs ; do make INSTALL_ROOT=${RPM_BUILD_ROOT} ${TARGET} done # install the php-cgi binary cp sapi/cgi/php-cgi ${RPM_BUILD_ROOT}%{_bindir} chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/php-cgi # install the DSO cd ../build-apache mkdir -p ${RPM_BUILD_ROOT}%{_libdir64}/httpd/modules chmod 755 ${RPM_BUILD_ROOT}%{_libdir64}/httpd/modules cp .libs/libphp7.so ${RPM_BUILD_ROOT}%{_libdir64}/httpd/modules chmod 755 ${RPM_BUILD_ROOT}%{_libdir64}/httpd/modules/libphp7.so cd .. # strip binaries /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/php /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/php-cgi #/usr/bin/strip ${RPM_BUILD_ROOT}%{_libdir64}/httpd/modules/libphp7.so # install the Apache httpd config file for PHP mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra chmod 755 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-php.conf cp %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-php.conf_64 chmod 644 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-php.conf chmod 644 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-php.conf_64 # install the default configuration file and directories mkdir -p ${RPM_BUILD_ROOT}/etc cp %{SOURCE2} ${RPM_BUILD_ROOT}/etc/php.ini cp %{SOURCE3} ${RPM_BUILD_ROOT}/etc/php64.ini mkdir -p ${RPM_BUILD_ROOT}/etc/php.d # create the PHP extension modules directory mkdir -p ${RPM_BUILD_ROOT}%{_libdir64}/php/modules # copy soap to php modules directory cd build-apache cp modules/soap.so ${RPM_BUILD_ROOT}%{_libdir64}/php/modules chmod 755 ${RPM_BUILD_ROOT}%{_libdir64}/php/modules/soap.so cd .. # for third-party packaging: mkdir -p ${RPM_BUILD_ROOT}%{_libdir64}/php/pear chmod 755 ${RPM_BUILD_ROOT}%{_libdir64}/php/pear mkdir -p ${RPM_BUILD_ROOT}/var/lib64/php chmod 755 ${RPM_BUILD_ROOT}/var/lib64/php mkdir -p ${RPM_BUILD_ROOT}/var/lib64/php/session chmod 700 ${RPM_BUILD_ROOT}/var/lib64/php/session ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_64 done ) # install on 32bit mode export OBJECT_MODE=32 cd ../32bit # unfortunately 'make install-sapi' does not seem to work for use, therefore # we have to install the targets separately cd build-cgi for TARGET in install-cli install-build install-headers install-programs ; do make INSTALL_ROOT=${RPM_BUILD_ROOT} ${TARGET} done # install the php-cgi binary cp sapi/cgi/php-cgi ${RPM_BUILD_ROOT}%{_bindir} chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/php-cgi # install the DSO cd ../build-apache mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/httpd/modules chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/httpd/modules cp .libs/libphp7.so ${RPM_BUILD_ROOT}%{_libdir}/httpd/modules chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/httpd/modules/libphp7.so cd .. # strip binaries /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/php /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/php-cgi #/usr/bin/strip ${RPM_BUILD_ROOT}%{_libdir}/httpd/modules/libphp7.so # install the Apache httpd config file for PHP mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra chmod 755 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-php.conf chmod 644 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/httpd-php.conf # install the default configuration file and directories mkdir -p ${RPM_BUILD_ROOT}/etc cp %{SOURCE2} ${RPM_BUILD_ROOT}/etc/php.ini mkdir -p ${RPM_BUILD_ROOT}/etc/php.d # create the PHP extension modules directory mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/php/modules # copy soap to php modules directory cd build-apache cp modules/soap.so ${RPM_BUILD_ROOT}%{_libdir}/php/modules chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/php/modules/soap.so cd .. # install the default icons mkdir -p ${RPM_BUILD_ROOT}%{contentdir}/icons chmod 755 ${RPM_BUILD_ROOT}%{contentdir}/icons cp php.gif ${RPM_BUILD_ROOT}%{contentdir}/icons # for third-party packaging: mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/php/pear chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/php/pear mkdir -p ${RPM_BUILD_ROOT}/var/lib/php chmod 755 ${RPM_BUILD_ROOT}/var/lib/php mkdir -p ${RPM_BUILD_ROOT}/var/lib/php/session chmod 700 ${RPM_BUILD_ROOT}/var/lib/php/session ( cd ${RPM_BUILD_ROOT} for dir in bin include do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %preun if [ "$1" = 0 ]; then cat %{_prefix}/etc/httpd/conf/httpd.conf | \ grep -v "# PHP settings" | \ grep -v "Include conf/extra/httpd-php.conf" \ > %{_prefix}/etc/httpd/conf/tmp_httpd.conf mv -f %{_prefix}/etc/httpd/conf/tmp_httpd.conf %{_prefix}/etc/httpd/conf/httpd.conf cat %{_prefix}/etc/httpd/conf/httpd.conf_64 | \ grep -v "# PHP settings" | \ grep -v "Include conf/extra/httpd-php.conf_64" \ > %{_prefix}/etc/httpd/conf/tmp_httpd.conf_64 mv -f %{_prefix}/etc/httpd/conf/tmp_httpd.conf_64 %{_prefix}/etc/httpd/conf/httpd.conf_64 echo "Please restart your web server using: '/opt/freeware/sbin/apachectl restart'" fi # remove some files to work with apache2 if [ -f %{_prefix}/sbin/httpd -a -d %{_prefix}/etc/httpd/conf ] then [ -f %{_prefix}/etc/httpd/conf/php.ini ] && rm -f %{_prefix}/etc/httpd/conf/php.ini grep -v "LoadModule php7_module" %{_prefix}/etc/httpd/conf/httpd.conf >%{_prefix}/etc/httpd/conf/httpd.conf.tmp [ -s %{_prefix}/etc/httpd/conf/httpd.conf.tmp ] && \ mv -f %{_prefix}/etc/httpd/conf/httpd.conf.tmp %{_prefix}/etc/httpd/conf/httpd.conf grep -v "LoadModule php7_module" %{_prefix}/etc/httpd/conf/httpd.conf_64 >%{_prefix}/etc/httpd/conf/httpd.conf.tmp_64 [ -s %{_prefix}/etc/httpd/conf/httpd.conf.tmp_64 ] && \ mv -f %{_prefix}/etc/httpd/conf/httpd.conf.tmp_64 %{_prefix}/etc/httpd/conf/httpd.conf_64 fi %post slibclean echo "" echo "This version of php has 32bit and 64bit support" echo "64bit php uses /etc/php64.ini" echo "" if [ -f %{_prefix}/etc/httpd/conf/httpd.conf ] then cat %{_prefix}/etc/httpd/conf/httpd.conf | \ grep -v "# PHP settings" | \ grep -v "Include conf/extra/httpd-php.conf" \ > %{_prefix}/etc/httpd/conf/tmp_httpd.conf mv -f %{_prefix}/etc/httpd/conf/tmp_httpd.conf %{_prefix}/etc/httpd/conf/httpd.conf fi if [ -f %{_prefix}/etc/httpd/conf/httpd.conf_64 ] then cat %{_prefix}/etc/httpd/conf/httpd.conf_64 | \ grep -v "# PHP settings" | \ grep -v "Include conf/extra/httpd-php.conf_64" \ > %{_prefix}/etc/httpd/conf/tmp_httpd.conf_64 mv -f %{_prefix}/etc/httpd/conf/tmp_httpd.conf_64 %{_prefix}/etc/httpd/conf/httpd.conf_64 fi echo "extension=soap.so" >> /etc/php.ini echo "extension=soap.so" >> /etc/php64.ini echo "# PHP settings" >> %{_prefix}/etc/httpd/conf/httpd.conf echo "# PHP settings" >> %{_prefix}/etc/httpd/conf/httpd.conf_64 echo "Include conf/extra/httpd-php.conf" >> %{_prefix}/etc/httpd/conf/httpd.conf echo "Include conf/extra/httpd-php.conf_64" >> %{_prefix}/etc/httpd/conf/httpd.conf_64 echo "Please restart your web server using: '/opt/freeware/sbin/apachectl restart'" %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %{_prefix}/lib/httpd/modules/libphp7.so %{_prefix}/lib64/httpd/modules/libphp7.so %{_prefix}/lib/php/modules/soap.so %{_prefix}/lib64/php/modules/soap.so %attr(0770,root,nobody) %dir /var/lib/php/session %attr(0770,root,nobody) %dir /var/lib64/php/session %config(noreplace) %{_prefix}/etc/httpd/conf/extra/httpd-php.conf %config(noreplace) %{_prefix}/etc/httpd/conf/extra/httpd-php.conf_64 %config(noreplace) /etc/php.ini %config(noreplace) /etc/php64.ini %{contentdir}/icons/php.gif %files common %defattr(-,root,system) %doc 32bit/CODING_STANDARDS 32bit/CREDITS 32bit/EXTENSIONS 32bit/INSTALL 32bit/LICENSE 32bit/NEWS 32bit/README* #%doc Zend/ZEND_* %dir /etc/php.d %dir %{_libdir}/php %dir %{_libdir64}/php %dir %{_libdir}/php/modules %dir %{_libdir64}/php/modules %dir /var/lib/php %dir /var/lib64/php %dir %{_libdir}/php/pear %dir %{_libdir64}/php/pear %files cli %defattr(-,root,system) %{_bindir}/php* #%{_bindir}/php-cgi %{_mandir}/man1/php.1 /usr/bin/php* #/usr/bin/php-cgi %files devel %defattr(-,root,system) %dir %{_libdir}/php %dir %{_libdir64}/php %{_bindir}/php-config* %{_bindir}/phpize* %{_includedir}/php %{_libdir}/php/build %{_libdir64}/php/build %{_mandir}/man1/php-config.1 %{_mandir}/man1/phpize.1 /usr/bin/php-config* /usr/bin/phpize* /usr/include/* %changelog * Mon Apr 29 2019 Reshma V Kumar 7.2.16-1 - Update to fix the following CVE - CVE-2019-9640 - CVE-2019-9024 - CVE-2019-9641 - CVE-2019-9025 - CVE-2019-9637 - CVE-2019-9639 - CVE-2019-9638 - This version has 64bit support as well * Wed Jan 16 2019 Reshma V Kumar 7.2.14-1 - Update to fix the following CVE - CVE-2018-19396 - CVE-2018-19395 - CVE-2018-19518 - CVE-2018-19935 * Tue Nov 13 2018 Reshma V Kumar 7.0.32-1 - Update to fix security vulnerabilities * Mon Oct 15 2018 Reshma V Kumar 7.0.31-2 - Rebuild with libiconv 1.14 rpm * Thu Aug 31 2018 Reshma V Kumar 7.0.31-1 - Update to fix security vulnerabilities * Wed Jun 6 2018 Nitish K Mishra 7.0.30-1 - Update to fix security vulnerabilities * Tue Apr 10 2018 Reshma V Kumar 7.0.27-1 - Update to fix security vulnerabilities * Thu Mar 08 2018 Reshma V Kumar 7.0.27-1 - Update to fix security vulnerabilities * Wed Aug 16 2017 Reshma V Kumar 7.0.21-1 - Update to fix CVE-2017-11628 * Thu Nov 25 2016 Nitish K Mishra 7.0.13-1 - Updated to 7.0.13 to enable soap with php * Thu Nov 03 2016 Nitish K Mishra 7.0.12-1 - Updated to 7.0.12 which fixes multiple security vulnerabilities. * Wed Aug 31 2016 Sangamesh Mallayya 7.0.10-1 - Update to 7.0.10 which fixes multiple security vulnerabilities. * Tue Jun 07 2016 Ayappan P 7.0.7-1 - Update to 7.0.7 version * Wed Mar 23 2016 Ayappan P 7.0.3-1 - Built with httpd-2.4.18 * Tue Nov 25 2014 Sangamesh Mallayya 5.3.11-4 - Built with httpd-2.4.7 * Fri May 11 2012 Gerard Visiedo 5.3.10-1 - Port on Aix61 * Fri Feb 17 2012 Michael Perzl - 5.3.10-1 - updated to version 5.3.10 * Wed Aug 24 2011 Michael Perzl - 5.3.8-1 - updated to version 5.3.8 * Tue Aug 23 2011 Michael Perzl - 5.3.7-1 - updated to version 5.3.7, added patch for php_crypt_r() * Tue Aug 23 2011 Michael Perzl - 5.3.6-2 - added "--enable-sockets" and "--with-mysqli=mysqlnd" to configure options * Wed May 18 2011 Michael Perzl - 5.3.6-1 - updated to version 5.3.6 * Wed May 18 2011 Michael Perzl - 5.3.5-2 - fixed wrong dependency on bzip2-devel of php-devel (needs bzip2 only) * Fri Jan 07 2011 Michael Perzl - 5.3.5-1 - updated to version 5.3.5 * Tue Dec 14 2010 Michael Perzl - 5.3.4-1 - updated to version 5.3.4 * Fri Jul 23 2010 Michael Perzl - 5.3.3-1 - updated to version 5.3.3 * Tue Apr 13 2010 Michael Perzl - 5.3.2-1 - updated to version 5.3.2 * Tue Mar 02 2010 Michael Perzl - 5.2.13-1 - updated to version 5.2.13 * Thu Feb 18 2010 Michael Perzl - 5.2.12-2 - enable fastcgi for the CLI version * Tue Jan 19 2010 Michael Perzl - 5.2.12-1 - updated to version 5.2.12 * Fri Nov 27 2009 Michael Perzl - 5.2.11-1 - updated to version 5.2.11 * Thu Nov 26 2008 Michael Perzl - 5.2.8-1 - updated to version 5.2.8 * Fri May 02 2008 Michael Perzl - 5.2.6-1 - updated to version 5.2.6 * Wed Apr 23 2008 Michael Perzl - 5.2.5-2 - some minor spec file fixes * Mon Dec 03 2007 Michael Perzl - 5.2.5-1 - first version for AIX V5.1 and higher