Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37735026
en ru br
Репозитории ALT
5.1: 5.2.14.20100721-alt0.M51.1
4.1: 5.2.5-alt1.M41.3
4.0: 5.2.2-alt1
3.0: 5.0.5-alt0.cvs20050729
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: php5-cgi

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define php5_sapi cgi

Name: php5-cgi
Version: %php5_version
Release: %php5_release
Summary: The PHP5 HTML-embedded scripting language as a CGI binary.
Group: System/Servers
Url: http://www.php.net/
License: PHP

Requires: php5 = %php5_version-%php5_release
Provides: php-engine = %php5_version-%php5_release

Source1: php.ini
Source2: %name-browscap.ini
Source3: php.cgi.control

Patch0: php-cgi-config9.m4.patch
Patch1: php-5.2.5-sapi-cgi.patch

BuildRequires(pre): rpm-build-php5
BuildRequires: php5-devel = %php5_version-%php5_release

# Automatically added by buildreq on Tue Jul 05 2005 (-bi)

BuildRequires: control libalternatives-devel libxml2-devel zlib-devel libfcgi-devel

%description
PHP is an HTML-embedded scripting language.  PHP attempts to make it
easy for developers to write dynamically generated web pages.  PHP
also offers built-in database integration for several commercial
and non-commercial database management systems, so writing a
database-enabled web page with PHP is fairly simple.  The most
common use of PHP coding is probably as a replacement for CGI
scripts.  
Using PHP as a CGI binary is an option for setups that for some reason
do not wish to integrate PHP as a module into server software (like Apache),
or will use PHP with different kinds of CGI wrappers to create safe
chroot and setuid environments for scripts.
This setup usually involves installing executable PHP binary to the
web server cgi-bin directory. CERT advisory CA-96.11 recommends
against placing any interpreters into cgi-bin.

%prep
%setup -T -c
%php5_sapi_prepare %php5_sapi
%__ln_s %php5_extsrcdir ext

%patch0 -p1 -b .fix
%patch1 -p1 -b .fix1

%build
%add_optflags -DPHP_FASTCGI -DDEBUG_FASTCGI -I/usr/include/libxml2 -Iext/date/lib

# fix simple bug.

%__mv config9.m4 config.m4

# some hackaround

%__mkdir_p sapi modules
%__ln_s ../ sapi/%php5_sapi
echo -n > modules/z

CGI_BUILD_VARS=" \
   PHP_SAPI=default \
   PHP_MODULES=sapi/%php5_sapi/php-cgi \
   EXTRA_LIBS=-lphp-%_php5_version \
   BUILD_DIR=. \
"

phpize
%configure \
--disable-static \
--enable-cgi \
--enable-fastcgi \
--with-php-config=%_bindir/php-config \
$CGI_BUILD_VARS

%php5_make

%install
%__mkdir_p \
%buildroot/%_bindir \
%buildroot/%php5_servicedir/%php5_sapi \
%buildroot/%php5_sysconfdir/%php5_sapi/php.d \
%buildroot/%php5_sysconfdir/%php5_sapi/control.d \
%buildroot/%_sysconfdir/control.d/facilities

%php5_make_install install-sapi program_suffix=-%_php5_version

%__ln_s php-%php5_sapi-%_php5_version %buildroot%_bindir/php5-%php5_sapi

%__install -m 644 %SOURCE1 %buildroot/%php5_sysconfdir/%php5_sapi/php.ini
%__install -m 644 %SOURCE2 %buildroot/%php5_sysconfdir/%php5_sapi/browscap.ini
%__install -m 755 %SOURCE3 %buildroot/%_sysconfdir/control.d/facilities/php5-%php5_sapi

for f in \
%buildroot/%php5_sysconfdir/%php5_sapi/php.ini \
%buildroot/%_sysconfdir/control.d/facilities/php5-%php5_sapi
do
 %__subst 's, at SAPI at ,%php5_sapi,g' "$f"
 %__subst 's, at PHP_VERSION at ,%_php5_version,g' "$f"
 %__subst 's, at PHP_LIBDIR at ,%_libdir/php,g' "$f"
 %__subst 's, at CGIBINDIR at ,%apache_cgibindir,g' "$f"
 %__subst 's, at PHP_BROWSCAP at ,%php5_sysconfdir/%php5_sapi/browscap.ini,g' "$f"
done

# Make alternatives support.

%__install -d %buildroot/%_altdir
php_weight="$(echo "%_php5_version" | sed 's,[^[:digit:]],,g')"

cat << EOF > %buildroot/%_altdir/php5-%php5_sapi
%_bindir/php-%php5_sapi %_bindir/php-%php5_sapi-%_php5_version $php_weight
EOF

%post
%php5_sapi_postin
%register_alternatives php5-%php5_sapi

%preun
%php5_sapi_preun
%unregister_alternatives php5-%php5_sapi

%files
%doc CREDITS README.FastCGI
%_bindir/php-%php5_sapi-%_php5_version
%_bindir/php5-%php5_sapi
%_altdir/php5-%php5_sapi
%_sysconfdir/control.d/facilities/*
%dir %php5_sysconfdir/%php5_sapi
%dir %php5_sysconfdir/%php5_sapi/php.d
%dir %php5_sysconfdir/%php5_sapi/control.d
%config(noreplace) %php5_sysconfdir/%php5_sapi/php.ini
%config(noreplace) %php5_sysconfdir/%php5_sapi/browscap.ini
%php5_servicedir/%php5_sapi

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin