Sisyphus repositório
Última atualização: 25 maio 2019 | SRPMs: 17693 | Visitas: 13597037
en ru br
ALT Linux repositórios

Group :: Sistema/Servidores
RPM: apache2-mod_php7

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

%define php7_sapi apache2-mod_php
%define so_file

Name: apache2-mod_php7
Version: %php7_version
Release: %php7_release

Summary: The php7 HTML-embedded scripting language for use with Apache2
Group: System/Servers
License: PHP

Prereq: php7 = %php7_version
Prereq: php7 >= %php7_version-%php7_release
Prereq: apache2-httpd-prefork-like
Requires(post): apache2-httpd-prefork-like
Requires(post): apache2-base

Conflicts: apache2-mod_php5
Provides: php-engine = %php7_version-%php7_release

Source0: %{name}-control.tar
Source3: php.ini
Source4: %name-browscap.ini

Patch0: apache2-mod_php7-7.1.0.patch
Patch1: php-alt-namespace.patch

BuildRequires(pre): rpm-build-php7 apache2-devel
# Automatically added by buildreq on Wed Mar 23 2011
BuildRequires: apache2-devel apache2-httpd-worker libmm-devel libxml2-devel php7-devel zlib-devel
BuildRequires: php7-devel = %php7_version

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.

%package control
Summary: Control facility and profiles for %name
Group: System/Servers
Requires: %name = %version-%release
Requires: php-base >= 2.6

%description control
Control facility and profiles for %name to easily switch
between predefined php.ini profiles

%setup -c
%php7_sapi_prepare apache2handler
%patch0 -p1 -b .fix
%patch1 -p1 -b .fix1

rm -f internal_functions.c

%apache2_apxs \
 $(php-config7 --includes) \
 $(php-config7 --ldflags) %php7_optflags \
 $(php-config7 --libs) \
 -I. -I./include -I/usr/include/apache -Iext/date/lib -I/usr/include/libxml2 \
 -lphp-%_php7_version \
 -o %so_file -c *.c

mkdir -p \
%buildroot/%apache2_mods_available \
%buildroot/%apache2_mods_start \
%buildroot/%apache2_moduledir \
%buildroot/%php7_sysconfdir/%php7_sapi/php.d \
%buildroot/%php7_sysconfdir/%php7_sapi/control.d \
%buildroot/%_sysconfdir/control.d/facilities \

cp .libs/%so_file %buildroot/%apache2_moduledir

cat > %buildroot/%apache2_mods_available/mod_php7.load <<EOF
LoadModule php7_module %apache2_moduledir/

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

cat > %buildroot/%apache2_mods_start/mod_php7.conf << EOF

cat > %buildroot/%_rpmlibdir/%name.filetrigger << EOF
LC_ALL=C sed 's|^%php7_sysconfdir/%php7_sapi/control.d||' |
egrep -qs '^%php7_sysconfdir/%php7_sapi|^%php7_extdir' || exit 0
%apache2_sbindir/a2chkconfig >/dev/null
chmod 755 %buildroot/%_rpmlibdir/%name.filetrigger

install -m 644 %SOURCE3 %buildroot/%php7_sysconfdir/%php7_sapi/php.ini
install -m 644 %SOURCE4 %buildroot/%php7_sysconfdir/%php7_sapi/browscap.ini
install -m 755 php.control %buildroot/%_sysconfdir/control.d/facilities/%name
install -m 644 modes/* %buildroot/%php7_sysconfdir/%php7_sapi/control.d/

for f in \
%buildroot/%php7_sysconfdir/%php7_sapi/php.ini \
 subst 's, at SAPI at ,%php7_sapi,g' "$f"
 subst 's, at PHP_VERSION at ,%_php7_version,g' "$f"
 subst 's, at PHP_MAJOR at ,%_php7_major,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 ,%php7_sysconfdir/%php7_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"


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

%config(noreplace) %apache2_mods_available/*
%config(noreplace) %apache2_mods_start/*
%dir %php7_sysconfdir/%php7_sapi
%dir %php7_sysconfdir/%php7_sapi/php.d
%config(noreplace) %php7_sysconfdir/%php7_sapi/php.ini
%config(noreplace) %php7_sysconfdir/%php7_sapi/browscap.ini

%files control
%config %_sysconfdir/control.d/facilities/*
%dir %php7_sysconfdir/%php7_sapi/control.d/
%config(noreplace) %php7_sysconfdir/%php7_sapi/control.d/*


Todas as alterações você pod ver aqui

projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009