# Shell function to configure and build a PHP tree. build() { # bison-1.875-2 seems to produce a broken parser; workaround. mkdir Zend && cp ../Zend/zend_{language,ini}_{parser,scanner}.[ch] Zend ln -sf ../configure ./configure \ --prefix=/usr/local/php5 \ --bindir=/usr/local/php5/bin \ --mandir=%{_mandir} \ --localstatedir=%{_localstatedir}/php5 \ --libdir=%{_libdir}/php5 \ --datadir=%{_datadir} \ --includedir=%{_includedir}/php5 \ --sysconfdir=%{_sysconfdir}/php5 \ --cache-file=../config.cache \ --with-config-file-path=%{_sysconfdir}/php5 \ --with-config-file-scan-dir=%{_sysconfdir}/php5/php.d \ --disable-debug \ --disable-rpath \ --with-bz2 \ %if %{with_db4} --with-db4=%{_prefix} \ %endif --with-curl \ --with-exec-dir=%{_bindir} \ --with-freetype-dir=%{_prefix} \ --with-png-dir=%{_prefix} \ --with-gd \ --with-gdbm \ --with-gettext \ --with-ncurses=shared \ --with-gmp \ --with-iconv \ --with-jpeg-dir=%{_prefix} \ --with-openssl \ --with-png \ --with-expat-dir=%{_prefix} \ --with-xml \ --with-xsl \ --with-xmlrpc=shared \ --with-readline \ --with-pcre=%{_prefix} \ --with-zlib \ --with-layout=GNU \ --with-pear=/usr/share/pear \ --with-imap=shared \ --with-imap-ssl \ --with-kerberos \ --with-ldap=shared \ --with-mcrypt=shared \ --with-mhash=shared \ --with-pdo-mysql=%{_prefix} \ --with-pdo-pgsql=%{_prefix} \ --with-mysql=shared,%{_prefix} \ %if %{with_mysqli} --with-mysqli \ %endif --with-unixODBC=shared,%{_prefix} \ --with-pgsql=shared \ --with-snmp=shared,%{_prefix} \ %if %{with_pfpro} --with-pfpro=shared,%{_prefix}/local/verisign/payflowpro/linuxrh9 \ %endif --enable-mbstr-enc-trans \ %if %{with_tidy} --with-tidy=shared \ %endif %if %{with_pdflib} --with-pdflib=%{_prefix} \ %endif --enable-mbregex \ --enable-mbstring=shared \ --enable-exif \ --without-oci8 \ --enable-bcmath \ --enable-ftp \ --enable-soap \ --enable-magic-quotes \ --enable-safe-mode \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-discard-path \ --enable-track-vars \ --enable-trans-sid \ --enable-yp \ --enable-wddx \ --enable-memory-limit \ --enable-bcmath \ --enable-shmop \ --enable-calendar \ --enable-dbx \ --enable-dio \ --enable-mcal \ --enable-inline-optimization \ --enable-gd-native-ttf \ --enable-pic \ --disable-wddx \ --with-dom=shared,%{_prefix} \ --with-dom-xslt=%{_prefix} \ --with-dom-exslt=%{_prefix} \ $* # --enable-ucd-snmp-hack \ # --disable-libxml \ %{__make} %{?_smp_mflags} } # Build standalone /usr/bin/php pushd build-cgi build --enable-force-cgi-redirect popd # Build Apache module #pushd build-apache #build --with-apxs2=%{_sbindir}/apxs #popd %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} # temp fix for php5, it wants the httpd.conf to exist #install -m 755 -d %{buildroot}%{_sysconfdir}/httpd/conf #echo 'LoadModule blah_module blah_module.so' > %{buildroot}%{_sysconfdir}/httpd/conf/httpd.conf #echo 'LoadModule blah_module2 blah_module2.so' >> %{buildroot}%{_sysconfdir}/httpd/conf/httpd.conf #chmod 644 %{buildroot}%{_sysconfdir}/httpd/conf/httpd.conf # Install from CGI tree pushd build-cgi %{__make} \ install \ INSTALL_ROOT=%{buildroot} cp -f sapi/cli/php %{buildroot}/usr/local/php5/bin/php5-cli cp -f sapi/cgi/php %{buildroot}/usr/local/php5/bin/php5-cgi #rm -f %{buildroot}%{_bindir}/php pushd %{buildroot}%{_bindir} ln -fs %{buildroot}/usr/local/php5/bin/php5-cgi php5 ln -fs %{buildroot}/usr/local/php5/bin/php5-cli php5-cli ln -fs %{buildroot}/usr/local/php5/bin/php5-cgi php5-cgi popd popd # Install the Apache module #pushd build-apache #%{__make} \ # install-sapi \ # INSTALL_ROOT=%{buildroot} #popd # end temp php5 fix #rm -f %{buildroot}%{_sysconfdir}/httpd/conf/httpd.conf* #mkdir -p -m0755 %{buildroot}{%{_sysconfdir}/httpd,%{_libdir}/httpd/modules} install -m 755 -d %{buildroot}{%{_sysconfdir}/php5 %ifarch x86_64 install -m0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/php5/php.ini install -m0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/php5/php-cli.ini install -m0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/php5/php-cgi.ini %else install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/php5/php.ini install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/php5/php-cli.ini install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/php5/php-cgi.ini %endif strip --strip-unneeded -R .comment %{buildroot}%{_bindir}/* || : strip --strip-debug -R .comment %{buildroot}%{_libdir}/php5/*.so || : #strip --strip-debug -R .comment %{buildroot}%{_libdir}/httpd/modules/*.so || : # install the DSO #install -m 755 -d %{buildroot}%{_libdir}/httpd/modules #install -m 755 build-apache/libs/libphp5.so %{buildroot}%{_libdir}/httpd/modules # Apache config fragment install -m 755 -d %{buildroot}%{_sysconfdir}/httpd/conf.d install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d install -m 755 -d %{buildroot}%{_sysconfdir}/php5/php.d install -m 755 -d %{buildroot}%{_localstatedir}/lib/php5 install -m 700 -d %{buildroot}%{_localstatedir}/lib/php5/session # install devel PKO #install -m 755 -d %{buildroot}%{_libdir}/php # Generate files lists and stub .ini files for each subpackage for mod in pgsql mysql odbc ldap xmlrpc \ snmp mbstring mcrypt ncurses imap mhash \ %{?_with_oci8:oci8} %{?_with_mssql:mssql} %{?_with_pfpro:pfpro} %{?_with_tidy:tidy}; do cat > %{buildroot}%{_sysconfdir}/php5/php.d/${mod}.ini < files.${mod} < - Added pdflib * Tue Sep 27 2005 Chris Wells - updated for 5.0.5 - made work with x86_64 with mega patch to kill exits from the configure script - made tweaks for all platforms to better handle conditional mods * Fri Apr 15 2005 Chris Wells - update for 5.0.3 and added tidy support * Fri Sep 24 2004 Chris Wells - update for php 5.0.2 - added disable-libxml for compat (wouldn't build on rh9) - added disable-wddx for compat (wouldn't build on rh9) * Tue Jun 28 2004 Chris Wells - Initial packaging as part of InterWorx-HAL OS