Commit 1c0b0671 authored by Natanael Copa's avatar Natanael Copa

main/php5: renamed php to php5

parent 72241eb6
......@@ -2,7 +2,7 @@
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=php
pkgname=php5
pkgver=5.6.21
pkgrel=1
pkgdesc="The PHP language runtime engine"
......@@ -12,6 +12,7 @@ license="PHP-3"
depends="$pkgname-cli"
depends_dev="$pkgname-cli pcre-dev"
install="$pkgname.post-upgrade"
provides="php"
makedepends="
$depends_dev
apache2-dev
......@@ -116,8 +117,12 @@ source="http://php.net/distributions/php-$pkgver.tar.bz2
"
_apiver="20131106"
_extdir="/usr/lib/php/modules"
_srcdir="$srcdir"/$pkgname-$pkgver
_extdir="/usr/lib/$pkgname/modules"
_srcdir="$srcdir"/php-$pkgver
_confdir=/etc/$pkgname
# seems like pear hardcode /usr/share/pear directory
_peardir=/usr/share/pear
prepare() {
cd "$_srcdir"
......@@ -144,7 +149,7 @@ _do_build() {
mkdir -p "$_builddir"
cd "$_builddir"
export EXTENSION_DIR=$_extdir
export PEAR_INSTALLDIR=/usr/share/pear
export PEAR_INSTALLDIR="$_peardir"
"$_srcdir"/configure $@ || return 1
sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183
make || return 1
......@@ -155,11 +160,11 @@ build() {
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc/php \
--sysconfdir=$_confdir \
--localstatedir=/var \
--with-layout=GNU \
--with-config-file-path=/etc/php \
--with-config-file-scan-dir=/etc/php/conf.d \
--with-config-file-path=$_confdir \
--with-config-file-scan-dir=$_confdir/conf.d \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
......@@ -308,41 +313,38 @@ dev() {
doc() {
# man pages
default_doc || return 1
cd "$srcdir"/$pkgname-$pkgver
cd "$srcdir"/php-$pkgver
# doc files
_docs="CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE NEWS \
UPGRADING UPGRADING.INTERNALS"
for _doc in $_docs README.*; do
install -Dm644 "$srcdir"/$pkgname-$pkgver/$_doc \
install -Dm644 "$srcdir"/php-$pkgver/$_doc \
"$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1
done
}
common() {
pkgdesc="PHP Common Files"
replaces="$pkgname"
depends=""
arch="noarch"
cd "$srcdir"/$pkgname-$pkgver
install -D -m644 php.ini-production "$subpkgdir"/etc/php/php.ini
cd "$srcdir"/php-$pkgver
install -D -m644 php.ini-production "$subpkgdir"$_confdir/php.ini
sed -i -e "s:^; extension_dir = \"./\":extension_dir = \"$_extdir\":" "$subpkgdir"/etc/php/php.ini
sed -ri 's/;(date.timezone =)/\1 UTC/' "$subpkgdir"/etc/php/php.ini
sed -ri "s~^([;]*cgi\.rfc2616_headers.*)$~\1\n\n\; If this is enabled, the PHP CGI binary can safely be placed outside of the\n; web tree and people will not be able to circumvent .htaccess security.\ncgi\.discard_path = 1~" "$subpkgdir"/etc/php/php.ini
sed -ri 's/;(date.timezone =)/\1 UTC/' "$subpkgdir"$_confdir/php.ini
sed -ri "s~^([;]*cgi\.rfc2616_headers.*)$~\1\n\n\; If this is enabled, the PHP CGI binary can safely be placed outside of the\n; web tree and people will not be able to circumvent .htaccess security.\ncgi\.discard_path = 1~" "$subpkgdir"$_confdir/php.ini
}
cgi() {
pkgdesc="PHP Common Gateway Interface (CGI)"
replaces="php"
depends="php-common"
depends="$pkgname-common"
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/php-cgi "$subpkgdir"/usr/bin/
}
cli() {
pkgdesc="PHP Command Line Interface (CLI)"
replaces="php-dev"
depends="php-common"
depends="$pkgname-common"
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/php "$subpkgdir"/usr/bin/ || return 1
# provide phpize here instead of -dev due to pecl command
......@@ -351,25 +353,25 @@ cli() {
fpm() {
pkgdesc="PHP FastCGI Process Manager (FPM)"
depends="php-common"
mkdir -p "$subpkgdir"/etc/php/fpm.d
depends="$pkgname-common"
mkdir -p "$subpkgdir"$_confdir/fpm.d
install -D -m755 "$srcdir"/build-fpm/sapi/fpm/php-fpm \
"$subpkgdir"/usr/bin/php-fpm || return 1
install -D -m644 "$srcdir"/build-fpm/sapi/fpm/php-fpm.conf \
"$subpkgdir"/etc/php/php-fpm.conf || return 1
"$subpkgdir"$_confdir/php-fpm.conf || return 1
install -D -m755 "$srcdir"/php-fpm.initd "$subpkgdir"/etc/init.d/php-fpm
# enable some default options
sed -ri -e "s~^;(error_log)(.*)~\1 = /var/log/php-fpm.log~" \
-e "s~^;(include)(.*)~\1 = /etc/php/fpm.d/*.conf~" \
-e "s~^;(include)(.*)~\1 = $_confdir/fpm.d/*.conf~" \
-e "s/^;(pm.start_servers)/\1/" \
-e "s/^;(pm.min_spare_servers)/\1/" \
-e "s/^;(pm.max_spare_servers)/\1/" \
"$subpkgdir"/etc/php/php-fpm.conf || return 1
"$subpkgdir"$_confdir/php-fpm.conf || return 1
}
apache2() {
pkgdesc="PHP Module for Apache2"
depends="php-common apache2"
depends="$pkgname-common apache2"
install -D -m755 "$srcdir"/build-apache2/libs/libphp5.so \
"$subpkgdir"/usr/lib/apache2/libphp5.so || return 1
install -D -m644 "$srcdir"/php5-module.conf \
......@@ -378,24 +380,24 @@ apache2() {
embed() {
pkgdesc="PHP Embed Library"
depends="php-common"
depends="$pkgname-common"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libphp5.so "$subpkgdir"/usr/lib/
}
pear() {
pkgdesc="PHP Extension and Application Repository (PEAR)"
depends="php-cli php-xml"
depends="$pkgname-cli $pkgname-xml"
arch="noarch"
mkdir -p "$subpkgdir"/usr/share "$subpkgdir"/etc/php \
mkdir -p "$subpkgdir"/usr/share "$subpkgdir"$_confdir \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/pecl \
"$pkgdir"/usr/bin/pear \
"$pkgdir"/usr/bin/peardev \
"$subpkgdir"/usr/bin/ || return 1
mv "$pkgdir"/etc/php/pear.conf \
"$subpkgdir"/etc/php/ || return 1
mv "$pkgdir"/usr/share/pear \
mv "$pkgdir"$_confdir/pear.conf \
"$subpkgdir"$_confdir/ || return 1
mv "$pkgdir"${_peardir} \
"$subpkgdir"/usr/share/ || return 1
}
......@@ -424,13 +426,13 @@ _mv_ext() {
mkdir -p "$subpkgdir"/$_extdir
mv "$pkgdir"/$_extdir/${ext}.so "$subpkgdir"/$_extdir/ || return 1
mkdir -p "$subpkgdir"/etc/php/conf.d
mkdir -p "$subpkgdir"$_confdir/conf.d
case "$1" in
opcache)
echo "zend_extension=${ext}.so" > "$subpkgdir"/etc/php/conf.d/$ini
echo "zend_extension=${ext}.so" > "$subpkgdir"$_confdir/conf.d/$ini
;;
*)
echo "extension=${ext}.so" > "$subpkgdir"/etc/php/conf.d/$ini
echo "extension=${ext}.so" > "$subpkgdir"$_confdir/conf.d/$ini
;;
esac
}
......@@ -460,10 +462,10 @@ odbc() { _mv_ext odbc unixodbc; }
openssl() { _mv_ext openssl; }
pcntl() { _mv_ext pcntl; }
pdo() { _mv_ext pdo; }
pdo_mysql() { _mv_ext pdo_mysql php-pdo; }
pdo_odbc() { _mv_ext pdo_odbc php-pdo; }
pdo_pgsql() { _mv_ext pdo_pgsql php-pdo; }
pdo_sqlite() { _mv_ext pdo_sqlite php-pdo; }
pdo_mysql() { _mv_ext pdo_mysql $pkgname-pdo; }
pdo_odbc() { _mv_ext pdo_odbc $pkgname-pdo; }
pdo_pgsql() { _mv_ext pdo_pgsql $pkgname-pdo; }
pdo_sqlite() { _mv_ext pdo_sqlite $pkgname-pdo; }
pgsql() { _mv_ext pgsql; }
phar() {
_mv_ext phar
......@@ -481,13 +483,13 @@ sysvmsg() { _mv_ext sysvmsg; }
sysvsem() { _mv_ext sysvsem; }
sysvshm() { _mv_ext sysvshm; }
xml() { _mv_ext xml; }
xmlreader() { _mv_ext xmlreader php-dom; }
xmlrpc() { _mv_ext xmlrpc php-xml; }
xsl() { _mv_ext xsl php-dom; }
xmlreader() { _mv_ext xmlreader $pkgname-dom; }
xmlrpc() { _mv_ext xmlrpc $pkgname-xml; }
xsl() { _mv_ext xsl $pkgname-dom; }
zip() { _mv_ext zip; }
zlib() { _mv_ext zlib; }
mssql() { _mv_ext mssql; }
pdo_dblib() { _mv_ext pdo_dblib "php-pdo freetds"; }
pdo_dblib() { _mv_ext pdo_dblib "$pkgname-pdo freetds"; }
wddx() { _mv_ext wddx; }
opcache() { _mv_ext opcache; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment