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

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

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

%define php5_sapi apache2-mod_php
%define so_file  mod_php5.so

Name: apache2-mod_php5
Version: %php5_version
Release: %php5_release

Summary: The PHP5 HTML-embedded scripting language for use with Apache2
Group: System/Servers
License: PHP
Url: http://www.php.net/

Prereq: php5 = %php5_version-%php5_release
Prereq: apache2-httpd-prefork-like
Requires(post): apache2-httpd-prefork-like

# the next dependency should be moved to php5-libs package

Requires: php-base >= 2.5

Conflicts: apache2-mod_php
Provides: php-engine = %php5_version-%php5_release

Source3: php.ini
Source4: %name-browscap.ini
Source5: php.control

Patch0: php-5.2.1-sapi-mod_php.patch
Patch1: php-alt-namespace.patch

BuildRequires(pre): rpm-build-php5 apache2-devel
# Automatically added by buildreq on Mon Jul 07 2008
BuildRequires: apache2-httpd-worker libmm-devel libxml2-devel
BuildRequires: php5-devel = %php5_version

%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. The mod_php module enables the Apache web server to
understand and process the embedded PHP language in web pages.

This package contains PHP version 5. You'll also need to install the
Apache2 web server.

%prep
%setup -T -c
%php5_sapi_prepare apache2handler
%patch0 -p1 -b .fix
%patch1 -p1 -b .fix1

%build
rm -f internal_functions.c

%apache2_apxs \
 $(php-config --includes) \
 $(php-config --ldflags) %php5_optflags \
 $(php-config --libs) \
 -I. -I./include -I/usr/include/apache -Iext/date/lib -I/usr/include/libxml2 \
 -DUSE_TRANSFER_TABLES=1 \
 -lphp-%_php5_version \
 -o %so_file -c *.c

%install
mkdir -p \
%buildroot/%apache2_mods_available \
%buildroot/%apache2_mods_start \
%buildroot/%apache2_moduledir \
%buildroot/%php5_servicedir/%php5_sapi \
%buildroot/%php5_sysconfdir/%php5_sapi/php.d \
%buildroot/%php5_sysconfdir/%php5_sapi/control.d \
%buildroot/%_sysconfdir/control.d/facilities \
%buildroot/%_rpmlibdir

cp .libs/%so_file %buildroot/%apache2_moduledir

cat > %buildroot/%apache2_mods_available/mod_php5.load <<EOF
LoadModule php5_module %apache2_moduledir/mod_php5.so
EOF

cat > %buildroot/%apache2_mods_available/mod_php5.conf <<EOF
<IfModule mod_php5.c>
   AddType    application/x-httpd-php5-source   .phps
   AddType    application/x-httpd-php5          .php .php5 .php4 .php3 .phtml
   AddHandler application/x-httpd-php5          .php .php5 .php4 .php3 .phtml
</IfModule>
EOF

cat > %buildroot/%apache2_mods_start/mod_php5.conf << EOF
mod_php5=yes
EOF

cat > %buildroot/%php5_servicedir/%php5_sapi/condrestart <<EOF
#!/bin/sh
%apache2_sbindir/a2chkconfig >/dev/null
%post_apache2conf
wait
EOF
chmod 700 %buildroot/%php5_servicedir/%php5_sapi/condrestart

cat > %buildroot/%_rpmlibdir/%name.filetrigger << EOF
#!/bin/sh
LC_ALL=C egrep -qs '^%php5_sysconfdir/%php5_sapi|^%php5_extdir' || exit 0
%apache2_sbindir/a2chkconfig >/dev/null
%post_apache2conf
EOF
chmod 755 %buildroot/%_rpmlibdir/%name.filetrigger

install -m 644 %SOURCE3 %buildroot/%php5_sysconfdir/%php5_sapi/php.ini
install -m 644 %SOURCE4 %buildroot/%php5_sysconfdir/%php5_sapi/browscap.ini
install -m 755 %SOURCE5 %buildroot/%_sysconfdir/control.d/facilities/%name

for f in \
%buildroot/%php5_sysconfdir/%php5_sapi/php.ini \
%buildroot/%_sysconfdir/control.d/facilities/%name
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 HTDOCSDIR at ,%apache2_htdocsdir,g' "$f"
 subst 's, at PHP_BROWSCAP at ,%php5_sysconfdir/%php5_sapi/browscap.ini,g' "$f"
 subst 's, at PHP_UPLOADDIR at ,%apache2_spooldir/uploads,g' "$f"
 subst 's, at PHP_SESSIONDIR at ,%apache2_spooldir/sessions,g' "$f"
done

%post
%php5_sapi_postin

%preun
%php5_sapi_preun

%postun
if [ $1 = 0 ]; then
%apache2_sbindir/a2chkconfig >/dev/null
%post_apache2conf
fi

%files
%_sysconfdir/control.d/facilities/*
%config(noreplace) %apache2_mods_available/*
%config(noreplace) %apache2_mods_start/*
%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
%apache2_moduledir/%so_file
%_rpmlibdir/%name.filetrigger
%doc CREDITS

%changelog

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

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