############################################################### # This SPEC file is a configurable skeleton for PHP modules # which are distributed with PHP4 tarball. # Copyright (c) 2001 Alexander Bokovoy # This SPEC file is available under terms of GNU GPL license # versions 2 or greater ############################################################### # #_/---------------\____________________________________________ # Package should be added into mod_php and/or console php? # Some modules can be used under both, others (like php_gtk # or midgard) are not. %define use_mod_php 1 %define use_con_php 1 # # Package name without php prefix %define package_name curl ############################################################### %define php_version %(rpm -q --queryformat '%{VERSION}' php) %define php_release %(rpm -q --queryformat '%{RELEASE}' php) Name: php-%package_name Version: %php_version Release: alt0.1RC1 Group: System/Servers Requires: libcurl >= 7.7.3-alt2 License: PHP Licence Prereq: php = %php_version-%php_release, perl # Automatically added by buildreq on Thu Mar 08 2001 BuildRequires: libbfd, libpam, php-devel = %php_version, libcurl-devel >= 7.7.3-alt2 Summary: cURL module for PHP4 %add_serial php-devel %description The php-%package_name includes a dynamic shared object (DSO) that adds cURL support to PHP4. cURL is a library that enables you to send and receive files through various protocols, including HTTP, FTP, TELNET, LDAP, DICT, and GOPHER. PHP4 is an HTML-embedded scripting language. If you need cURL support for PHP4 applications, you will need to install this package in addition to the php package. %prep %setup -T -c cp -pr /usr/src/php-devel/extensions/%package_name/* . %build # Fix includes so that local config header file will always supercede global options for j in `ls *.c` ; do perl -pi -e "s/#include \"php.h\"/#include \"php.h\"\n#include \"config.h\"/" $j done phpize BUILD_HAVE=`echo %package_name | tr '[:lower:]-' '[:upper:]_'` CFLAGS="$RPM_OPT_FLAGS -fPIC -L%{_libdir} -DHAVE_${BUILD_HAVE}=1 -DCOMPILE_DL_${BUILD_HAVE}=1"; export CFLAGS %configure --with-%package_name=/usr BUILD_ENV_VARS="top_srcdir=$RPM_BUILD_DIR/%name-%version \ bindir=$RPM_BUILD_ROOT/usr/bin \ sbindir=$RPM_BUILD_ROOT/usr/sbin \ includedir=$RPM_BUILD_ROOT/usr/include \ exec_prefix=$RPM_BUILD_ROOT/usr \ libdir=$RPM_BUILD_ROOT/usr/lib \ prefix=$RPM_BUILD_ROOT/usr \ localstatedir=$RPM_BUILD_ROOT/var/lib \ PEAR_INSTALLDIR=$RPM_BUILD_ROOT/usr/lib/php \ EXTENSION_DIR=$RPM_BUILD_ROOT/usr/lib/php/extensions" make $BUILD_ENV_VARS %install # Set them again because this is _different_ script BUILD_ENV_VARS="top_srcdir=$RPM_BUILD_DIR/%name-%version \ bindir=$RPM_BUILD_ROOT/usr/bin \ sbindir=$RPM_BUILD_ROOT/usr/sbin \ includedir=$RPM_BUILD_ROOT/usr/include \ exec_prefix=$RPM_BUILD_ROOT/usr \ libdir=$RPM_BUILD_ROOT/usr/lib \ prefix=$RPM_BUILD_ROOT/usr \ localstatedir=$RPM_BUILD_ROOT/var/lib \ PEAR_INSTALLDIR=$RPM_BUILD_ROOT/usr/lib/php \ EXTENSION_DIR=$RPM_BUILD_ROOT/usr/lib/php/extensions" make $BUILD_ENV_VARS install %clean %files %{_libdir}/php/extensions/* %doc CREDITS %post # Common part: all modules need to if [ `uname` = "Linux" ]; then perl="%{_bindir}/perl"; fi if [ `uname` = "SunOS" ]; then perl="%{_prefix}/local/bin/perl"; fi %if %use_con_php if [ -f %{_sysconfdir}/php.ini ] ; then unset LC_ALL $perl -pi -e 's|^;extension=%{package_name}.so|extension=%{package_name}.so|g' %{_sysconfdir}/php.ini fi %endif %if %use_mod_php if [ -f %{_sysconfdir}/httpd/conf/php.ini ] ; then unset LC_ALL $perl -pi -e 's|^;extension=%{package_name}.so|extension=%{package_name}.so|g' %{_sysconfdir}/httpd/conf/php.ini fi %endif %if %use_mod_php %{_sbindir}/apachectl update %endif # Local script, specific to package %preun if [ `uname` = "Linux" ]; then perl="%{_bindir}/perl"; fi if [ `uname` = "SunOS" ]; then perl="%{_prefix}/local/bin/perl"; fi if [ $1 = "0" ]; then %if %use_con_php if [ -f %{_sysconfdir}/php.ini ] ; then unset LC_ALL $perl -pi -e 's|^extension=%{package_name}.so|;extension=%{package_name}.so|g' %{_sysconfdir}/php.ini fi %endif %if %use_mod_php if [ -f %{_sysconfdir}/httpd/conf/php.ini ] ; then unset LC_ALL $perl -pi -e 's|^extension=%{package_name}.so|;extension=%{package_name}.so|g' %{_sysconfdir}/httpd/conf/php.ini fi %endif fi %postun %if %use_mod_php %{_sbindir}/apachectl update %endif %changelog * Tue May 22 2001 Alexander Bokovoy 4.0.6-alt0.1RC1 - PHP 4.0.6 Release Candidate 1 - Dependencies fixed because curl >= 7.7.3-alt2 is required now * Tue May 08 2001 Alexander Bokovoy 4.0.5-alt1 - PHP 4.0.5 release * Thu Apr 05 2001 Alexander Bokovoy 4.0.5.RC6-alt1 - ALTification - Last release candidate for 4.0.5 - SPEC file changes: + Reference to PHP source removed, php-devel is used to acquire sources of module + locale-specific info unset during installation + nosrc -> src because NoSource tag cannot be used without corresponding Source one * Sat Mar 17 2001 Alexander Bokovoy 4.0.5-ipl1 - First stable build * Thu Mar 15 2001 Alexander Bokovoy 4.0.5-ipl0.4 - Rebuild with fixed version of PHP4 * Sun Mar 11 2001 Alexander Bokovoy 4.0.5-ipl0.3 - Fixed: + Build process for self-contained shared modules in PHP is generally broken, fixed by automatically adding -DHAVE_{MODULE}=1 -DCOMPILE_DL_{MODULE}=1 to configure * Sat Mar 10 2001 Alexander Bokovoy 4.0.5-ipl0.2 - More enhancements in SPEC file: + Automatically gather PHP version, so no need to synchronize spec file's Version: field when new version of PHP is installed * Thu Mar 08 2001 Alexander Bokovoy 4.0.5-ipl0.1 - Created new generalized spec file for nosrc.rpm for PHP modules - Added ability to tune module installation for Console/Apache-based PHP Some modules cannot work in Web-server environment (php_gtk), some -- in Console mode (midgard), some will be happy in both environments