parent
fbf2df78d7
commit
3977d21745
@ -0,0 +1,17 @@
|
|||||||
|
https://github.com/liske/needrestart/pull/34
|
||||||
|
---
|
||||||
|
Makefile | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index c432772..8cc2fe0 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -64,5 +64,5 @@ po/needrestart-notify/messages.pot: ex/notify.d/*-*
|
||||||
|
|
||||||
|
|
||||||
|
mo-files:
|
||||||
|
- make -C po/needrestart
|
||||||
|
- make -C po/needrestart-notify
|
||||||
|
+ $(MAKE) -C po/needrestart
|
||||||
|
+ $(MAKE) -C po/needrestart-notify
|
@ -0,0 +1,11 @@
|
|||||||
|
--- a/src/init.c 2016-07-08 12:00:17.705356781 +0200
|
||||||
|
+++ b/src/init.c 2016-07-08 12:02:35.914358133 +0200
|
||||||
|
@@ -790,7 +790,7 @@
|
||||||
|
debug = 0;
|
||||||
|
oldfontcode = 0;
|
||||||
|
*altdevscan = 1;
|
||||||
|
- no_versioncheck = 0;
|
||||||
|
+ no_versioncheck = 1;
|
||||||
|
support_ontheflyaudio = 0;
|
||||||
|
c_locale_is_utf8 = 0;
|
||||||
|
ignoreProDVD = 0;
|
@ -0,0 +1,11 @@
|
|||||||
|
--- xcdroast-0.98alpha16/src/setup.c.orig 2008-08-21 12:07:18.000000000 +0400
|
||||||
|
+++ xcdroast-0.98alpha16/src/setup.c 2016-07-09 11:26:54.724084818 +0300
|
||||||
|
@@ -4468,7 +4468,7 @@
|
||||||
|
if (!textonly) {
|
||||||
|
show_dialog(ICO_ERROR,tmp, T_OK, NULL, NULL, 0);
|
||||||
|
} else {
|
||||||
|
- g_warning(tmp);
|
||||||
|
+ g_warning("%s",tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,74 +0,0 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=2
|
|
||||||
inherit gnome2-utils eutils
|
|
||||||
|
|
||||||
DESCRIPTION="Lightweight cdrtools front-end for CD and DVD writing"
|
|
||||||
HOMEPAGE="http://www.xcdroast.org/"
|
|
||||||
SRC_URI="mirror://sourceforge/xcdroast/${P/_/}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
|
|
||||||
IUSE="nls"
|
|
||||||
|
|
||||||
RDEPEND=">=x11-libs/gtk+-2:2
|
|
||||||
app-cdr/cdrtools"
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
sys-devel/gettext
|
|
||||||
virtual/pkgconfig"
|
|
||||||
|
|
||||||
S=${WORKDIR}/${P/_/}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/cdda2wav_version.patch \
|
|
||||||
"${FILESDIR}"/fix_cddb_hidden_tracks.patch \
|
|
||||||
"${FILESDIR}"/io_compile.patch
|
|
||||||
|
|
||||||
# fix Norwegian locales
|
|
||||||
mv po/{no,nb}.po || die
|
|
||||||
mv po/{no,nb}.gmo || die
|
|
||||||
sed -i -e 's/no/nb/' po/LINGUAS || die
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
econf \
|
|
||||||
$(use_enable nls) \
|
|
||||||
--enable-gtk2 \
|
|
||||||
--disable-dependency-tracking \
|
|
||||||
--mandir=/usr/share/man \
|
|
||||||
--sysconfdir=/etc
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
emake PREFIX=/usr || die
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake PREFIX=/usr DESTDIR="${D}" install || die
|
|
||||||
|
|
||||||
dodoc AUTHORS ChangeLog README doc/{README*,DOCUMENTATION,FAQ,TRANS*} \
|
|
||||||
doc/manual/README.txt
|
|
||||||
|
|
||||||
insinto /usr/share/doc/${PF}/manual
|
|
||||||
doins doc/manual/xcdroast-manual.pdf
|
|
||||||
|
|
||||||
insinto /usr/share/icons/hicolor/48x48/apps
|
|
||||||
newins xpms/xcdricon.xpm xcdroast.xpm
|
|
||||||
|
|
||||||
make_desktop_entry xcdroast "X-CD-Roast" xcdroast "AudioVideo;DiscBurning"
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_preinst() {
|
|
||||||
gnome2_icon_savelist
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
gnome2_icon_cache_update
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postrm() {
|
|
||||||
gnome2_icon_cache_update
|
|
||||||
}
|
|
@ -1 +1 @@
|
|||||||
DIST certbot-0.6.0.tar.gz 686826 SHA256 58eaa6be4ae90af07d682296e42dbac924b5602c51002445059596313e182a09 SHA512 966fdbff13ac9651ebb5fafae86a58a45538d57a43eb6d157358bbecef4286634bb61dd13b94e0ca5b006980a35cc5fe55b4a12efdeadc2530653d844516c926 WHIRLPOOL 0bd424395b9002a04f6c900b208aea758f74e9864d75f6aa87fc30573f046c63f9791aa8bcce0a5452831192d1579e9b52fda5ed77befd6e4f361dab976d6369
|
DIST certbot-0.8.1.tar.gz 698305 SHA256 1fb4834eba306a656f26257f86ed298df354cdecb1b0bde316a9d23a1e19db01 SHA512 8b21d270b5ee847086369b956b3346fdddd50ab0e4490d988e7ca535f4d4101e2859e99bc5f77ac920afd3a6a9210e407b155c89c28d282dc0544735a27e3eaa WHIRLPOOL 909a3f6f63fac84bf6fe8fb35b9aba46c06912af01d5f702eee5b6aeab49d4f2a92fa05e4f060da11ac6cbc89047e92457f626d6c82aa0de0f1127ca79924fc7
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
DIST libvirt-1.2.21-20151222.tar.xz 1684 SHA256 6c97f288470ec58bcbe98507563c6a191892c6f8813a7b9688c09b823934cbe5 SHA512 4fd43f0e12434b78ac3e671ad8eb0e402d384cff6278f6d0db322a068c2c8807c7c7f7e5774aa9d19e2a85e49f6d9888908b32fca5fc04980134edaccba0afe2 WHIRLPOOL 2bfbc3cbf1ca44a2bb06ddf2e8eabeb116165560b9c73d649d7b8cc9baba851f5e9246414bfc2c4740f27d0d0d42b6176eaec43b05e8c1e54de2804150c2cde1
|
DIST libvirt-1.2.21-20160709.tar.xz 3048 SHA256 c2bef1c300099c3ff6ce81488a2678e588d18ca46a27916df160c8304239ca80 SHA512 fdf0cd5e1cc3e0144fa99577c1a8c2d5e69ab610c923071b645465fb58076b2ce7a8e4e7747f3a6c59716917c6d41f369d77565c0f9fe10907a76d9b39edede6 WHIRLPOOL 2816d54588e4a49efd6773982b2b8a281572607c86c5a57c45b1736ce22836ea4cb91cee8d59b8fddcaafd2e552d0422ef5ed4b33d19a1705d4a38f270b9d39d
|
||||||
DIST libvirt-1.2.21.tar.gz 29848954 SHA256 8d406582f5fe88d739d1d83e0ba7ac7f91f5a8da4be82162ab85631744d8925b SHA512 5c15d0ba5d75c13f735c6a60dfdbad007426f77e113f95894d520f7fc358fa4361d5cce7bb9a548a436f323b845f13b8940abbad568b8b146418430068bb970e WHIRLPOOL d53bbb07c85b3aa2d9b0f38ff2edd3cd0a2a5300627f3e2f0a82bc057303617cab9d6f1d8a9a771bd968b0496d38d3a39a0154f88bdca44dda359a65fdc2c650
|
DIST libvirt-1.2.21.tar.gz 29848954 SHA256 8d406582f5fe88d739d1d83e0ba7ac7f91f5a8da4be82162ab85631744d8925b SHA512 5c15d0ba5d75c13f735c6a60dfdbad007426f77e113f95894d520f7fc358fa4361d5cce7bb9a548a436f323b845f13b8940abbad568b8b146418430068bb970e WHIRLPOOL d53bbb07c85b3aa2d9b0f38ff2edd3cd0a2a5300627f3e2f0a82bc057303617cab9d6f1d8a9a771bd968b0496d38d3a39a0154f88bdca44dda359a65fdc2c650
|
||||||
|
DIST libvirt-1.3.5-20160709.tar.xz 1336 SHA256 d14b14661e9bd89a8805dd84d8ee5f8b39f428a4dcbf70693eea593328e28033 SHA512 08ad8c691f145a3a8c27b594b486b9265777f756099c127e58fd76bac7249a0e84181a3f15da4cf64ffdcf35ff7e3a2f1f1ee50f3882df5d980ad7250a30e44e WHIRLPOOL 8d8106314c2bed984db3947b51b90dadd45680a07d568cc980c6534ba2229bfff8d041ecf40898131030f3db8d6e223fe30ba3dc72b3fe7fedc02a77b5c37331
|
||||||
DIST libvirt-1.3.5.tar.gz 35109092 SHA256 93a23c44eb431da46c9458f95a66e29c9b98e37515d44b6be09e75b35ec94ac8 SHA512 6c6a09623d3d4d426311bfa7039f5e39584d5f891b8e761bbdb3022601ea066b8e1c3f8d609326e8ba4081ae40b7b03086fbc8ba5759d218b8616ec98200a89d WHIRLPOOL 88ac308cc461efff842c27e40263a3b25ce0bc0ca310fb6e9def9126ab893fe43aed01bda9fc3615439ee797c36e2800f741b346e0b3d96aac64e7909c269879
|
DIST libvirt-1.3.5.tar.gz 35109092 SHA256 93a23c44eb431da46c9458f95a66e29c9b98e37515d44b6be09e75b35ec94ac8 SHA512 6c6a09623d3d4d426311bfa7039f5e39584d5f891b8e761bbdb3022601ea066b8e1c3f8d609326e8ba4081ae40b7b03086fbc8ba5759d218b8616ec98200a89d WHIRLPOOL 88ac308cc461efff842c27e40263a3b25ce0bc0ca310fb6e9def9126ab893fe43aed01bda9fc3615439ee797c36e2800f741b346e0b3d96aac64e7909c269879
|
||||||
|
DIST libvirt-2.0.0.tar.xz 13161096 SHA256 10e90af55e613953c0ddc60b4ac3a10c73c0f3493d7014259e3f012b2ffc9acb SHA512 1182346e9268ec50cfd191a18172ad8ca80615a111547cc72fbe227cbbe9579263a1236f80cb36542272bdbf092e2184c9060b65c56dc2098076bbd1a89dd66c WHIRLPOOL 3d6d9e307228f54993c6082f7787d678b2afe84d96b47889d1565e38da489fb99691aeb598831dff04cd9fe47448ea35dc1f5a44b3c6638816cf61533155688c
|
||||||
|
@ -1,72 +0,0 @@
|
|||||||
From bb848feec0f3f10e92dd8e5231ae7aa89b5598f3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jiri Denemark <jdenemar@redhat.com>
|
|
||||||
Date: Tue, 28 Jun 2016 14:39:58 +0200
|
|
||||||
Subject: [PATCH] qemu: Let empty default VNC password work as documented
|
|
||||||
|
|
||||||
CVE-2016-5008
|
|
||||||
|
|
||||||
Setting an empty graphics password is documented as a way to disable
|
|
||||||
VNC/SPICE access, but QEMU does not always behaves like that. VNC would
|
|
||||||
happily accept the empty password. Let's enforce the behavior by setting
|
|
||||||
password expiration to "now".
|
|
||||||
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=1180092
|
|
||||||
|
|
||||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
||||||
---
|
|
||||||
src/qemu/qemu_hotplug.c | 14 +++++++-------
|
|
||||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
|
||||||
index e0b8230..bf6430d 100644
|
|
||||||
--- a/src/qemu/qemu_hotplug.c
|
|
||||||
+++ b/src/qemu/qemu_hotplug.c
|
|
||||||
@@ -3933,6 +3933,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|
||||||
time_t now = time(NULL);
|
|
||||||
char expire_time [64];
|
|
||||||
const char *connected = NULL;
|
|
||||||
+ const char *password;
|
|
||||||
int ret = -1;
|
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
@@ -3940,16 +3941,14 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|
||||||
ret = 0;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
+ password = auth->passwd ? auth->passwd : defaultPasswd;
|
|
||||||
|
|
||||||
if (auth->connected)
|
|
||||||
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
|
|
||||||
|
|
||||||
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
- ret = qemuMonitorSetPassword(priv->mon,
|
|
||||||
- type,
|
|
||||||
- auth->passwd ? auth->passwd : defaultPasswd,
|
|
||||||
- connected);
|
|
||||||
+ ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
|
|
||||||
|
|
||||||
if (ret == -2) {
|
|
||||||
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
|
||||||
@@ -3957,14 +3956,15 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|
||||||
_("Graphics password only supported for VNC"));
|
|
||||||
ret = -1;
|
|
||||||
} else {
|
|
||||||
- ret = qemuMonitorSetVNCPassword(priv->mon,
|
|
||||||
- auth->passwd ? auth->passwd : defaultPasswd);
|
|
||||||
+ ret = qemuMonitorSetVNCPassword(priv->mon, password);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ret != 0)
|
|
||||||
goto end_job;
|
|
||||||
|
|
||||||
- if (auth->expires) {
|
|
||||||
+ if (password[0] == '\0') {
|
|
||||||
+ snprintf(expire_time, sizeof(expire_time), "now");
|
|
||||||
+ } else if (auth->expires) {
|
|
||||||
time_t lifetime = auth->validTo - now;
|
|
||||||
if (lifetime <= 0)
|
|
||||||
snprintf(expire_time, sizeof(expire_time), "now");
|
|
||||||
--
|
|
||||||
2.7.3
|
|
||||||
|
|
@ -0,0 +1,390 @@
|
|||||||
|
# Copyright 1999-2016 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
EAPI=5
|
||||||
|
|
||||||
|
inherit eutils user autotools-utils linux-info systemd readme.gentoo
|
||||||
|
|
||||||
|
BACKPORTS=""
|
||||||
|
|
||||||
|
if [[ ${PV} = *9999* ]]; then
|
||||||
|
inherit git-r3
|
||||||
|
EGIT_REPO_URI="git://libvirt.org/libvirt.git"
|
||||||
|
SRC_URI=""
|
||||||
|
KEYWORDS=""
|
||||||
|
SLOT="0"
|
||||||
|
else
|
||||||
|
# Versions with 4 numbers are stable updates:
|
||||||
|
if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
|
||||||
|
SRC_URI="http://libvirt.org/sources/stable_updates/${P}.tar.xz"
|
||||||
|
else
|
||||||
|
SRC_URI="http://libvirt.org/sources/${P}.tar.xz"
|
||||||
|
fi
|
||||||
|
SRC_URI+=" ${BACKPORTS:+
|
||||||
|
https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
|
||||||
|
https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
|
||||||
|
KEYWORDS="~amd64 ~x86"
|
||||||
|
SLOT="0/${PV}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
DESCRIPTION="C toolkit to manipulate virtual machines"
|
||||||
|
HOMEPAGE="http://www.libvirt.org/"
|
||||||
|
LICENSE="LGPL-2.1"
|
||||||
|
IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
|
||||||
|
lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
|
||||||
|
selinux systemd +udev uml +vepa virtualbox virt-network wireshark-plugins \
|
||||||
|
xen"
|
||||||
|
|
||||||
|
REQUIRED_USE="
|
||||||
|
firewalld? ( virt-network )
|
||||||
|
libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
|
||||||
|
lxc? ( caps libvirtd )
|
||||||
|
openvz? ( libvirtd )
|
||||||
|
qemu? ( libvirtd )
|
||||||
|
uml? ( libvirtd )
|
||||||
|
vepa? ( macvtap )
|
||||||
|
virt-network? ( libvirtd )
|
||||||
|
virtualbox? ( libvirtd )
|
||||||
|
xen? ( libvirtd )"
|
||||||
|
|
||||||
|
# gettext.sh command is used by the libvirt command wrappers, and it's
|
||||||
|
# non-optional, so put it into RDEPEND.
|
||||||
|
# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
|
||||||
|
# package will use 3 by default. Since we don't have slot pinning in an API,
|
||||||
|
# we must go with the most recent
|
||||||
|
RDEPEND="
|
||||||
|
app-misc/scrub
|
||||||
|
dev-libs/libgcrypt:0
|
||||||
|
dev-libs/libnl:3
|
||||||
|
>=dev-libs/libxml2-2.7.6
|
||||||
|
|| ( >=net-analyzer/netcat6-1.0-r2 >=net-analyzer/openbsd-netcat-1.105-r1 )
|
||||||
|
>=net-libs/gnutls-1.0.25:0=
|
||||||
|
net-libs/libssh2
|
||||||
|
>=net-misc/curl-7.18.0
|
||||||
|
sys-apps/dmidecode
|
||||||
|
>=sys-apps/util-linux-2.17
|
||||||
|
sys-devel/gettext
|
||||||
|
sys-libs/ncurses:0=
|
||||||
|
sys-libs/readline:=
|
||||||
|
apparmor? ( sys-libs/libapparmor )
|
||||||
|
audit? ( sys-process/audit )
|
||||||
|
avahi? ( >=net-dns/avahi-0.6[dbus] )
|
||||||
|
caps? ( sys-libs/libcap-ng )
|
||||||
|
firewalld? ( net-firewall/firewalld )
|
||||||
|
fuse? ( >=sys-fs/fuse-2.8.6 )
|
||||||
|
glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
|
||||||
|
iscsi? ( sys-block/open-iscsi )
|
||||||
|
lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
|
||||||
|
lxc? ( !systemd? ( sys-power/pm-utils ) )
|
||||||
|
nfs? ( net-fs/nfs-utils )
|
||||||
|
numa? (
|
||||||
|
>sys-process/numactl-2.0.2
|
||||||
|
sys-process/numad
|
||||||
|
)
|
||||||
|
openvz? ( sys-kernel/openvz-sources:* )
|
||||||
|
parted? (
|
||||||
|
>=sys-block/parted-1.8[device-mapper]
|
||||||
|
sys-fs/lvm2
|
||||||
|
)
|
||||||
|
pcap? ( >=net-libs/libpcap-1.0.0 )
|
||||||
|
policykit? ( >=sys-auth/polkit-0.9 )
|
||||||
|
qemu? (
|
||||||
|
>=app-emulation/qemu-0.13.0
|
||||||
|
dev-libs/yajl
|
||||||
|
!systemd? ( sys-power/pm-utils )
|
||||||
|
)
|
||||||
|
rbd? ( sys-cluster/ceph )
|
||||||
|
sasl? ( dev-libs/cyrus-sasl )
|
||||||
|
selinux? ( >=sys-libs/libselinux-2.0.85 )
|
||||||
|
systemd? ( sys-apps/systemd )
|
||||||
|
virt-network? (
|
||||||
|
net-dns/dnsmasq[script]
|
||||||
|
net-firewall/ebtables
|
||||||
|
>=net-firewall/iptables-1.4.10[ipv6]
|
||||||
|
net-misc/radvd
|
||||||
|
sys-apps/iproute2[-minimal]
|
||||||
|
)
|
||||||
|
virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
|
||||||
|
wireshark-plugins? ( net-analyzer/wireshark:= )
|
||||||
|
xen? (
|
||||||
|
app-emulation/xen
|
||||||
|
app-emulation/xen-tools:=
|
||||||
|
)
|
||||||
|
udev? (
|
||||||
|
virtual/udev
|
||||||
|
>=x11-libs/libpciaccess-0.10.9
|
||||||
|
)"
|
||||||
|
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
app-text/xhtml1
|
||||||
|
dev-lang/perl
|
||||||
|
dev-libs/libxslt
|
||||||
|
dev-perl/XML-XPath
|
||||||
|
virtual/pkgconfig"
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
enewgroup qemu 77
|
||||||
|
enewuser qemu 77 -1 -1 qemu kvm
|
||||||
|
|
||||||
|
# Some people used the masked ebuild which was not adding the qemu
|
||||||
|
# user to the kvm group originally. This results in VMs failing to
|
||||||
|
# start for some users. bug #430808
|
||||||
|
egetent group kvm | grep -q qemu
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
gpasswd -a qemu kvm
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check kernel configuration:
|
||||||
|
CONFIG_CHECK=""
|
||||||
|
use fuse && CONFIG_CHECK+="
|
||||||
|
~FUSE_FS"
|
||||||
|
|
||||||
|
use lvm && CONFIG_CHECK+="
|
||||||
|
~BLK_DEV_DM
|
||||||
|
~DM_MULTIPATH
|
||||||
|
~DM_SNAPSHOT"
|
||||||
|
|
||||||
|
use lxc && CONFIG_CHECK+="
|
||||||
|
~BLK_CGROUP
|
||||||
|
~CGROUP_CPUACCT
|
||||||
|
~CGROUP_DEVICE
|
||||||
|
~CGROUP_FREEZER
|
||||||
|
~CGROUP_NET_PRIO
|
||||||
|
~CGROUP_PERF
|
||||||
|
~CGROUPS
|
||||||
|
~CGROUP_SCHED
|
||||||
|
~CPUSETS
|
||||||
|
~DEVPTS_MULTIPLE_INSTANCES
|
||||||
|
~IPC_NS
|
||||||
|
~MACVLAN
|
||||||
|
~NAMESPACES
|
||||||
|
~NET_CLS_CGROUP
|
||||||
|
~NET_NS
|
||||||
|
~PID_NS
|
||||||
|
~POSIX_MQUEUE
|
||||||
|
~SECURITYFS
|
||||||
|
~USER_NS
|
||||||
|
~UTS_NS
|
||||||
|
~VETH
|
||||||
|
~!GRKERNSEC_CHROOT_MOUNT
|
||||||
|
~!GRKERNSEC_CHROOT_DOUBLE
|
||||||
|
~!GRKERNSEC_CHROOT_PIVOT
|
||||||
|
~!GRKERNSEC_CHROOT_CHMOD
|
||||||
|
~!GRKERNSEC_CHROOT_CAPS"
|
||||||
|
# Handle specific kernel versions for different features
|
||||||
|
kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
|
||||||
|
if $(kernel_is ge 3 6); then
|
||||||
|
CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP "
|
||||||
|
if $(kernel_is lt 4 5); then
|
||||||
|
CONFIG_CHECK+=" ~MEMCG_KMEM "
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
use macvtap && CONFIG_CHECK+="
|
||||||
|
~MACVTAP"
|
||||||
|
|
||||||
|
use virt-network && CONFIG_CHECK+="
|
||||||
|
~BRIDGE_EBT_MARK_T
|
||||||
|
~BRIDGE_NF_EBTABLES
|
||||||
|
~NETFILTER_ADVANCED
|
||||||
|
~NETFILTER_XT_CONNMARK
|
||||||
|
~NETFILTER_XT_MARK
|
||||||
|
~NETFILTER_XT_TARGET_CHECKSUM"
|
||||||
|
# Bandwidth Limiting Support
|
||||||
|
use virt-network && CONFIG_CHECK+="
|
||||||
|
~BRIDGE_EBT_T_NAT
|
||||||
|
~NET_ACT_POLICE
|
||||||
|
~NET_CLS_FW
|
||||||
|
~NET_CLS_U32
|
||||||
|
~NET_SCH_HTB
|
||||||
|
~NET_SCH_INGRESS
|
||||||
|
~NET_SCH_SFQ"
|
||||||
|
|
||||||
|
ERROR_USER_NS="Optional depending on LXC configuration."
|
||||||
|
|
||||||
|
if [[ -n ${CONFIG_CHECK} ]]; then
|
||||||
|
linux-info_pkg_setup
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
touch "${S}/.mailmap"
|
||||||
|
|
||||||
|
if [[ ${PV} = *9999* ]]; then
|
||||||
|
# git checkouts require bootstrapping to create the configure script.
|
||||||
|
# Additionally the submodules must be cloned to the right locations
|
||||||
|
# bug #377279
|
||||||
|
./bootstrap || die "bootstrap failed"
|
||||||
|
(
|
||||||
|
git submodule status | sed 's/^[ +-]//;s/ .*//'
|
||||||
|
git hash-object bootstrap.conf
|
||||||
|
) >.git-module-status
|
||||||
|
fi
|
||||||
|
|
||||||
|
epatch \
|
||||||
|
"${FILESDIR}"/${PN}-1.3.0-do_not_use_sysconf.patch \
|
||||||
|
"${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
|
||||||
|
"${FILESDIR}"/${PN}-1.3.1-fix_paths_for_apparmor.patch \
|
||||||
|
"${FILESDIR}"/${PN}-1.3.4-glibc-2.23.patch
|
||||||
|
|
||||||
|
[[ -n ${BACKPORTS} ]] &&
|
||||||
|
EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
|
||||||
|
EPATCH_SOURCE="${WORKDIR}/patches" epatch
|
||||||
|
|
||||||
|
epatch_user
|
||||||
|
|
||||||
|
# Tweak the init script:
|
||||||
|
cp "${FILESDIR}/libvirtd.init-r16" "${S}/libvirtd.init" || die
|
||||||
|
sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
|
||||||
|
-e "s/USE_FLAG_AVAHI/$(usex avahi 'use avahi-daemon' '')/" \
|
||||||
|
-e "s/USE_FLAG_ISCSI/$(usex iscsi 'use iscsid' '')/" \
|
||||||
|
-e "s/USE_FLAG_RBD/$(usex rbd 'use ceph' '')/" \
|
||||||
|
-i "${S}/libvirtd.init" || die "sed failed"
|
||||||
|
|
||||||
|
AUTOTOOLS_AUTORECONF=true
|
||||||
|
autotools-utils_src_prepare
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
local myeconfargs=(
|
||||||
|
$(use_with apparmor)
|
||||||
|
$(use_with apparmor apparmor-profiles)
|
||||||
|
$(use_with audit)
|
||||||
|
$(use_with avahi)
|
||||||
|
$(use_with caps capng)
|
||||||
|
$(use_with firewalld)
|
||||||
|
$(use_with fuse)
|
||||||
|
$(use_with glusterfs)
|
||||||
|
$(use_with glusterfs storage-gluster)
|
||||||
|
$(use_with iscsi storage-iscsi)
|
||||||
|
$(use_with libvirtd)
|
||||||
|
$(use_with lvm storage-lvm)
|
||||||
|
$(use_with lvm storage-mpath)
|
||||||
|
$(use_with lxc)
|
||||||
|
$(use_with macvtap)
|
||||||
|
$(use_enable nls)
|
||||||
|
$(use_with numa numactl)
|
||||||
|
$(use_with numa numad)
|
||||||
|
$(use_with openvz)
|
||||||
|
$(use_with parted storage-disk)
|
||||||
|
$(use_with pcap libpcap)
|
||||||
|
$(use_with phyp)
|
||||||
|
$(use_with policykit polkit)
|
||||||
|
$(use_with qemu)
|
||||||
|
$(use_with qemu yajl)
|
||||||
|
$(use_with rbd storage-rbd)
|
||||||
|
$(use_with sasl)
|
||||||
|
$(use_with selinux)
|
||||||
|
$(use_with systemd systemd-daemon)
|
||||||
|
$(usex systemd --with-init-script=systemd '')
|
||||||
|
$(use_with udev)
|
||||||
|
$(use_with uml)
|
||||||
|
$(use_with vepa virtualport)
|
||||||
|
$(use_with virt-network network)
|
||||||
|
$(use_with wireshark-plugins wireshark-dissector)
|
||||||
|
$(use_with xen)
|
||||||
|
$(use_with xen xen-inotify)
|
||||||
|
$(usex xen --with-libxl '')
|
||||||
|
|
||||||
|
--without-hal
|
||||||
|
--without-netcf
|
||||||
|
--without-sanlock
|
||||||
|
--without-xenapi
|
||||||
|
--with-esx
|
||||||
|
--with-qemu-group=$(usex caps qemu root)
|
||||||
|
--with-qemu-user=$(usex caps qemu root)
|
||||||
|
--with-remote
|
||||||
|
--with-storage-fs
|
||||||
|
--with-vmware
|
||||||
|
|
||||||
|
--disable-static
|
||||||
|
--disable-werror
|
||||||
|
|
||||||
|
--with-html-subdir=${PF}/html
|
||||||
|
--localstatedir=/var
|
||||||
|
)
|
||||||
|
|
||||||
|
if use virtualbox && has_version app-emulation/virtualbox-ose; then
|
||||||
|
myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
|
||||||
|
else
|
||||||
|
myeconfargs+=( $(use_with virtualbox vbox) )
|
||||||
|
fi
|
||||||
|
|
||||||
|
autotools-utils_src_configure
|
||||||
|
|
||||||
|
if [[ ${PV} = *9999* ]]; then
|
||||||
|
# Restore gnulib's config.sub and config.guess
|
||||||
|
# bug #377279
|
||||||
|
(cd .gnulib && git reset --hard > /dev/null)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Workaround: Sometimes this subdirectory is missing and leads to a
|
||||||
|
# build failure.
|
||||||
|
mkdir -p "${BUILD_DIR}"/docs/internals
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
# Explicitly allow parallel build of tests
|
||||||
|
export VIR_TEST_DEBUG=1
|
||||||
|
HOME="${T}" emake check || die "tests failed"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
autotools-utils_src_compile install \
|
||||||
|
DESTDIR="${D}" \
|
||||||
|
SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)"
|
||||||
|
|
||||||
|
find "${D}" -name '*.la' -delete || die
|
||||||
|
|
||||||
|
# Remove bogus, empty directories. They are either not used, or
|
||||||
|
# libvirtd is able to create them on demand
|
||||||
|
rm -rf "${D}"/etc/sysconfig
|
||||||
|
rm -rf "${D}"/var/cache
|
||||||
|
rm -rf "${D}"/var/run
|
||||||
|
rm -rf "${D}"/var/log
|
||||||
|
|
||||||
|
use libvirtd || return 0
|
||||||
|
# From here, only libvirtd-related instructions, be warned!
|
||||||
|
|
||||||
|
use systemd && systemd_install_serviced \
|
||||||
|
"${FILESDIR}"/libvirtd.service.conf libvirtd.service
|
||||||
|
|
||||||
|
systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
|
||||||
|
|
||||||
|
newinitd "${S}/libvirtd.init" libvirtd || die
|
||||||
|
newinitd "${FILESDIR}/libvirt-guests.init-r2" libvirt-guests || die
|
||||||
|
newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
|
||||||
|
newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die
|
||||||
|
|
||||||
|
newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
|
||||||
|
newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
|
||||||
|
|
||||||
|
DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
|
||||||
|
DISABLE_AUTOFORMATTING=true
|
||||||
|
readme.gentoo_create_doc
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_preinst() {
|
||||||
|
# we only ever want to generate this once
|
||||||
|
if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
|
||||||
|
rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
|
||||||
|
touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
|
||||||
|
fi
|
||||||
|
|
||||||
|
use libvirtd || return 0
|
||||||
|
# From here, only libvirtd-related instructions, be warned!
|
||||||
|
|
||||||
|
if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.18-r2 ${REPLACING_VERSIONS} ]]; then
|
||||||
|
FORCE_PRINT_ELOG=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
|
||||||
|
DISABLE_AUTOFORMATTING=true
|
||||||
|
readme.gentoo_print_elog
|
||||||
|
}
|
@ -1,2 +1,3 @@
|
|||||||
DIST livecd-tools-2.0.4.tar.xz 10580 SHA256 a819344ce79c9d0dce4a8339fe09b485b169b42063dbe1f6d2245ef57c867e51 SHA512 242d0d27d141af7c4a0c9be390d4faf9fc97b840a55f76e0a804838b98ba95a644be8a4f2ff1353bf7782b8db24b72b8f24a2fe01f60449c9687efbbfad4d6f3 WHIRLPOOL 591457dd46190b72a2f8fc50bc3869163c604f6850944fdf74bad4d145c0c214c89336547f3daaa2942088b83c86254c7289cd34a897da79130888248c661283
|
DIST livecd-tools-2.0.4.tar.xz 10580 SHA256 a819344ce79c9d0dce4a8339fe09b485b169b42063dbe1f6d2245ef57c867e51 SHA512 242d0d27d141af7c4a0c9be390d4faf9fc97b840a55f76e0a804838b98ba95a644be8a4f2ff1353bf7782b8db24b72b8f24a2fe01f60449c9687efbbfad4d6f3 WHIRLPOOL 591457dd46190b72a2f8fc50bc3869163c604f6850944fdf74bad4d145c0c214c89336547f3daaa2942088b83c86254c7289cd34a897da79130888248c661283
|
||||||
DIST livecd-tools-2.1.tar.gz 11418 SHA256 5490c76d02ba571c2549114c8ea55cd36b78b3c065372c28e3bcd1ee2ad493e9 SHA512 feb8946c70baeb5b2e4adcc26f76f5fcf146353dcfcfd411cf68242512ab587b0c31c916c6f2a47ab35dcd4bb87ca879e5a91b95d8237c4ac3bbd9104f31e0c2 WHIRLPOOL 2199ef6cf7667cbdfa943c18c2e41ec5ba2f276a685eb2162fdb42552e80daf7bd53258932d8f80a38ee1995edfe3934884413358e4eef3059acc04047cf9121
|
DIST livecd-tools-2.1.tar.gz 11418 SHA256 5490c76d02ba571c2549114c8ea55cd36b78b3c065372c28e3bcd1ee2ad493e9 SHA512 feb8946c70baeb5b2e4adcc26f76f5fcf146353dcfcfd411cf68242512ab587b0c31c916c6f2a47ab35dcd4bb87ca879e5a91b95d8237c4ac3bbd9104f31e0c2 WHIRLPOOL 2199ef6cf7667cbdfa943c18c2e41ec5ba2f276a685eb2162fdb42552e80daf7bd53258932d8f80a38ee1995edfe3934884413358e4eef3059acc04047cf9121
|
||||||
|
DIST livecd-tools-2.2.tar.gz 11419 SHA256 65275aad174ac9c129617768f693830ed696d209cbf4d252553a280374b4de89 SHA512 62891c132b0f392b775116d90740ea30a546a75736b17d10e5915ededa72ed730934555cab9a0b81a6def49e687c13db3e92e1e4f325854151569ad3e814bec0 WHIRLPOOL 658b65dffa992505cd354cdaf2edd1ae2f0f421fdda6fc7afe59a3a3028bdfddfc02302f763aeb940b4281823cd38f41bb9ee2f12f5b5185c5ac593a20a0c9df
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
# Copyright 1999-2015 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
EAPI=6
|
||||||
|
|
||||||
|
if [[ ${PV} == "9999" ]]; then
|
||||||
|
EGIT_REPO_URI="git://anongit.gentoo.org/proj/livecd-tools.git"
|
||||||
|
inherit git-r3
|
||||||
|
else
|
||||||
|
SRC_URI="https://dev.gentoo.org/~williamh/dist/${P}.tar.gz"
|
||||||
|
KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 sparc x86"
|
||||||
|
fi
|
||||||
|
|
||||||
|
DESCRIPTION="Gentoo LiveCD tools for autoconfiguration of hardware"
|
||||||
|
HOMEPAGE="http://wolf31o2.org/projects/livecd-tools"
|
||||||
|
|
||||||
|
SLOT="0"
|
||||||
|
LICENSE="GPL-2"
|
||||||
|
IUSE=""
|
||||||
|
|
||||||
|
RDEPEND="dev-util/dialog
|
||||||
|
net-dialup/mingetty
|
||||||
|
>=sys-apps/baselayout-2
|
||||||
|
>=sys-apps/openrc-0.8.2-r1
|
||||||
|
sys-apps/pciutils
|
||||||
|
sys-apps/gawk
|
||||||
|
sys-apps/sed"
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
ewarn "This package is designed for use on the LiveCD only and will do"
|
||||||
|
ewarn "unspeakably horrible and unexpected things on a normal system."
|
||||||
|
ewarn "YOU HAVE BEEN WARNED!!!"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
doconfd conf.d/*
|
||||||
|
doinitd init.d/*
|
||||||
|
dosbin net-setup
|
||||||
|
into /
|
||||||
|
dosbin livecd-functions.sh
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
DIST gentoolkit-0.3.0.8.tar.gz 3192497 SHA256 0338dee7c295c32b60a84e529b764d2bc61536fa3aca021cd5a75c6e534864a6 SHA512 50efd701d0d056740bcf7c7cdce652ae7c9e2786f799f5d30946e752b8aa735489d3e0dc5c7664a5810a0f22cec05b9bc7ccc10292b07ac4dd0777658651f72d WHIRLPOOL 5a2455e50d4e0f4df8abab5b81deb6bb00e078dfed1687ae046ce97a0427eafea2d3de9b83ac6de8155d207653d001c6684ac92226fa2320515c6e14c8fea6e0
|
DIST gentoolkit-0.3.0.8.tar.gz 3192497 SHA256 0338dee7c295c32b60a84e529b764d2bc61536fa3aca021cd5a75c6e534864a6 SHA512 50efd701d0d056740bcf7c7cdce652ae7c9e2786f799f5d30946e752b8aa735489d3e0dc5c7664a5810a0f22cec05b9bc7ccc10292b07ac4dd0777658651f72d WHIRLPOOL 5a2455e50d4e0f4df8abab5b81deb6bb00e078dfed1687ae046ce97a0427eafea2d3de9b83ac6de8155d207653d001c6684ac92226fa2320515c6e14c8fea6e0
|
||||||
DIST gentoolkit-0.3.0.9.tar.gz 3194703 SHA256 c660d150dfccbaea6f291fb7fc2659c8e0e38eaebe6e68f92dee728c8c7e320d SHA512 75b2d15b2b9ed08055840b56b239ed5d63838a10e8d31ec3ed8822cf1d3ef32841609763433736e17f93a5fdd293ccbda4a3dfa0f007241321aec3333bcde847 WHIRLPOOL 5e9dc038c161361eb2dd8f0cd17e8efaa41183a281d6fcf620c1631c6da661673d085c60572424cd48504222c29613473591f8dd276792ab96ba3cfda88f1fe1
|
DIST gentoolkit-0.3.0.9.tar.gz 3194703 SHA256 c660d150dfccbaea6f291fb7fc2659c8e0e38eaebe6e68f92dee728c8c7e320d SHA512 75b2d15b2b9ed08055840b56b239ed5d63838a10e8d31ec3ed8822cf1d3ef32841609763433736e17f93a5fdd293ccbda4a3dfa0f007241321aec3333bcde847 WHIRLPOOL 5e9dc038c161361eb2dd8f0cd17e8efaa41183a281d6fcf620c1631c6da661673d085c60572424cd48504222c29613473591f8dd276792ab96ba3cfda88f1fe1
|
||||||
DIST gentoolkit-0.3.1.1.tar.gz 3198269 SHA256 e3743ac526a8b9dd78af8ebc88ccf26cf487f2c31483b283b0e5df36bab881ce SHA512 24736713761ead819da8f65148d7f8cae5e12414cbffafa1bcf0ce4f59587b6c589fed02edb48f054f24f015e4fe151333ebbba4ccfa9b1164a547717bee7a74 WHIRLPOOL c33a468ca8fb01e4e236cd104abc10a7a570fc6a3372314407ee341672202ed2cef70e2647743ba4301277f01201a5999e6251167d66f7b1ffae5eb0872a5375
|
DIST gentoolkit-0.3.1.1.tar.gz 3198269 SHA256 e3743ac526a8b9dd78af8ebc88ccf26cf487f2c31483b283b0e5df36bab881ce SHA512 24736713761ead819da8f65148d7f8cae5e12414cbffafa1bcf0ce4f59587b6c589fed02edb48f054f24f015e4fe151333ebbba4ccfa9b1164a547717bee7a74 WHIRLPOOL c33a468ca8fb01e4e236cd104abc10a7a570fc6a3372314407ee341672202ed2cef70e2647743ba4301277f01201a5999e6251167d66f7b1ffae5eb0872a5375
|
||||||
DIST gentoolkit-0.3.1.tar.gz 3195571 SHA256 ec494d81c8d24e1a69347464733459c0dba0e4c1881d7d5bdc34f7c770f9e3a6 SHA512 6593bc3cad4b9716b9b126bd17fd6662b9aad05b89941297a23deca4651fe4c1552c8fd92b0e284b5a5eeb3f76b1c350d753966abbcc6d2ce8a9e8341f5de794 WHIRLPOOL 82064735ebb64b3cac9ac80f31f24524e9180c78b37472189c1aa72baa698a7eec79009e95ae6e26dbda4c3fd77c1b9dc6f949513511f96fe7cf79d25ac37e28
|
DIST gentoolkit-0.3.2.tar.gz 3198294 SHA256 f3bb38d663c1b153447556b5265df5a11b6ed78411e761335b692111c823d9dd SHA512 e174ac7f12d45703515876ea558a661e1d0c5d4cc71d2d64ee793786e2a2d3d2b309500b6e1891774e3415de74922efc77553c0103d695f5dda91def9a6ac637 WHIRLPOOL 67192702f72f437cc31aeeef8bf005c83a4a9322e9fa0de3c1e0d229bfb95d7363f14a8902da5ffbf49dee45cd587286899ea1ead017cd7d18d0f852cc7fd9fb
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
# Copyright 1999-2015 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
PYTHON_COMPAT=(python{2_7,3_3} pypy)
|
|
||||||
PYTHON_REQ_USE="xml(+),threads(+)"
|
|
||||||
|
|
||||||
inherit distutils-r1
|
|
||||||
|
|
||||||
DESCRIPTION="Collection of administration scripts for Gentoo"
|
|
||||||
HOMEPAGE="https://www.gentoo.org/proj/en/portage/tools/index.xml"
|
|
||||||
SRC_URI="mirror://gentoo/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
|
|
||||||
|
|
||||||
DEPEND="sys-apps/portage[${PYTHON_USEDEP}]"
|
|
||||||
RDEPEND="${DEPEND}
|
|
||||||
!<=app-portage/gentoolkit-dev-0.2.7
|
|
||||||
|| ( >=sys-apps/coreutils-8.15 app-misc/realpath sys-freebsd/freebsd-bin )
|
|
||||||
sys-apps/gawk
|
|
||||||
sys-apps/gentoo-functions
|
|
||||||
sys-apps/grep"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${PV}-revdep-rebuild-py-504654-1.patch
|
|
||||||
"${FILESDIR}"/${PV}-revdep-rebuild-py-504654-2.patch
|
|
||||||
)
|
|
||||||
|
|
||||||
python_prepare_all() {
|
|
||||||
python_setup
|
|
||||||
echo VERSION="${PVR}" "${PYTHON}" setup.py set_version
|
|
||||||
VERSION="${PVR}" "${PYTHON}" setup.py set_version
|
|
||||||
mv ./bin/revdep-rebuild{,.py} || die
|
|
||||||
distutils-r1_python_prepare_all
|
|
||||||
}
|
|
||||||
|
|
||||||
python_install_all() {
|
|
||||||
distutils-r1_python_install_all
|
|
||||||
|
|
||||||
# Rename the python versions of revdep-rebuild, since we are not ready
|
|
||||||
# to switch to the python version yet. Link /usr/bin/revdep-rebuild to
|
|
||||||
# revdep-rebuild.sh. Leaving the python version available for potential
|
|
||||||
# testing by a wider audience.
|
|
||||||
dosym revdep-rebuild.sh /usr/bin/revdep-rebuild
|
|
||||||
|
|
||||||
# TODO: Fix this as it is now a QA violation
|
|
||||||
# Create cache directory for revdep-rebuild
|
|
||||||
keepdir /var/cache/revdep-rebuild
|
|
||||||
use prefix || fowners root:0 /var/cache/revdep-rebuild
|
|
||||||
fperms 0700 /var/cache/revdep-rebuild
|
|
||||||
|
|
||||||
# remove on Gentoo Prefix platforms where it's broken anyway
|
|
||||||
if use prefix; then
|
|
||||||
elog "The revdep-rebuild command is removed, the preserve-libs"
|
|
||||||
elog "feature of portage will handle issues."
|
|
||||||
rm "${ED}"/usr/bin/revdep-rebuild*
|
|
||||||
rm "${ED}"/usr/share/man/man1/revdep-rebuild.1
|
|
||||||
rm -rf "${ED}"/etc/revdep-rebuild
|
|
||||||
rm -rf "${ED}"/var
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Only show the elog information on a new install
|
|
||||||
if [[ ! ${REPLACING_VERSIONS} ]]; then
|
|
||||||
elog
|
|
||||||
elog "For further information on gentoolkit, please read the gentoolkit"
|
|
||||||
elog "guide: https://www.gentoo.org/doc/en/gentoolkit.xml"
|
|
||||||
elog
|
|
||||||
elog "Another alternative to equery is app-portage/portage-utils"
|
|
||||||
elog
|
|
||||||
elog "Additional tools that may be of interest:"
|
|
||||||
elog
|
|
||||||
elog " app-admin/eclean-kernel"
|
|
||||||
elog " app-portage/diffmask"
|
|
||||||
elog " app-portage/flaggie"
|
|
||||||
elog " app-portage/install-mask"
|
|
||||||
elog " app-portage/portpeek"
|
|
||||||
elog " app-portage/smart-live-rebuild"
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,83 +0,0 @@
|
|||||||
# Copyright 1999-2015 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI="5"
|
|
||||||
|
|
||||||
PYTHON_COMPAT=(python{2_7,3_3})
|
|
||||||
PYTHON_REQ_USE="xml(+),threads(+)"
|
|
||||||
|
|
||||||
inherit distutils-r1
|
|
||||||
|
|
||||||
DESCRIPTION="Collection of administration scripts for Gentoo"
|
|
||||||
HOMEPAGE="https://www.gentoo.org/proj/en/portage/tools/index.xml"
|
|
||||||
SRC_URI="mirror://gentoo/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
|
|
||||||
|
|
||||||
DEPEND="sys-apps/portage"
|
|
||||||
RDEPEND="${DEPEND}
|
|
||||||
!<=app-portage/gentoolkit-dev-0.2.7
|
|
||||||
|| ( >=sys-apps/coreutils-8.15 app-misc/realpath sys-freebsd/freebsd-bin )
|
|
||||||
sys-apps/gawk
|
|
||||||
sys-apps/grep"
|
|
||||||
|
|
||||||
PATCHES=()
|
|
||||||
|
|
||||||
python_prepare_all() {
|
|
||||||
python_setup
|
|
||||||
echo VERSION="${PVR}" "${PYTHON}" setup.py set_version
|
|
||||||
VERSION="${PVR}" "${PYTHON}" setup.py set_version
|
|
||||||
mv ./bin/revdep-rebuild{,.py} || die
|
|
||||||
distutils-r1_python_prepare_all
|
|
||||||
}
|
|
||||||
|
|
||||||
python_install_all() {
|
|
||||||
distutils-r1_python_install_all
|
|
||||||
|
|
||||||
# Rename the python versions of revdep-rebuild, since we are not ready
|
|
||||||
# to switch to the python version yet. Link /usr/bin/revdep-rebuild to
|
|
||||||
# revdep-rebuild.sh. Leaving the python version available for potential
|
|
||||||
# testing by a wider audience.
|
|
||||||
dosym revdep-rebuild.sh /usr/bin/revdep-rebuild
|
|
||||||
|
|
||||||
# TODO: Fix this as it is now a QA violation
|
|
||||||
# Create cache directory for revdep-rebuild
|
|
||||||
keepdir /var/cache/revdep-rebuild
|
|
||||||
use prefix || fowners root:0 /var/cache/revdep-rebuild
|
|
||||||
fperms 0700 /var/cache/revdep-rebuild
|
|
||||||
|
|
||||||
# remove on Gentoo Prefix platforms where it's broken anyway
|
|
||||||
if use prefix; then
|
|
||||||
elog "The revdep-rebuild command is removed, the preserve-libs"
|
|
||||||
elog "feature of portage will handle issues."
|
|
||||||
rm "${ED}"/usr/bin/revdep-rebuild*
|
|
||||||
rm "${ED}"/usr/share/man/man1/revdep-rebuild.1
|
|
||||||
rm -rf "${ED}"/etc/revdep-rebuild
|
|
||||||
rm -rf "${ED}"/var
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Only show the elog information on a new install
|
|
||||||
if [[ ! ${REPLACING_VERSIONS} ]]; then
|
|
||||||
elog
|
|
||||||
elog "For further information on gentoolkit, please read the gentoolkit"
|
|
||||||
elog "guide: https://www.gentoo.org/doc/en/gentoolkit.xml"
|
|
||||||
elog
|
|
||||||
elog "Another alternative to equery is app-portage/portage-utils"
|
|
||||||
elog
|
|
||||||
elog "Additional tools that may be of interest:"
|
|
||||||
elog
|
|
||||||
elog " app-admin/eclean-kernel"
|
|
||||||
elog " app-portage/diffmask"
|
|
||||||
elog " app-portage/flaggie"
|
|
||||||
elog " app-portage/install-mask"
|
|
||||||
elog " app-portage/portpeek"
|
|
||||||
elog " app-portage/smart-live-rebuild"
|
|
||||||
fi
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
PYTHON_COMPAT=(python{2_7,3_4})
|
|
||||||
|
|
||||||
inherit distutils-r1
|
|
||||||
|
|
||||||
DESCRIPTION="Magnificent app which corrects your previous console command"
|
|
||||||
HOMEPAGE="https://github.com/nvbn/thefuck"
|
|
||||||
SRC_URI="https://github.com/nvbn/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
|
||||||
KEYWORDS="~amd64"
|
|
||||||
|
|
||||||
LICENSE="MIT"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="test"
|
|
||||||
|
|
||||||
RDEPEND="dev-python/pathlib[${PYTHON_USEDEP}]
|
|
||||||
dev-python/psutil[${PYTHON_USEDEP}]
|
|
||||||
dev-python/six[${PYTHON_USEDEP}]
|
|
||||||
dev-python/decorator[${PYTHON_USEDEP}]
|
|
||||||
dev-python/colorama[${PYTHON_USEDEP}]"
|
|
||||||
DEPEND="test? ( ${RDEPEND}
|
|
||||||
dev-python/pytest[${PYTHON_USEDEP}] )
|
|
||||||
dev-python/setuptools[${PYTHON_USEDEP}]"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
sed -i -e "/import pip/s/^/#/" -e "/pip.__version__/,+3 s/^/#/" setup.py || die
|
|
||||||
distutils-r1_src_prepare
|
|
||||||
}
|
|
||||||
|
|
||||||
python_test() {
|
|
||||||
py.test || die
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
PYTHON_COMPAT=(python{2_7,3_4})
|
|
||||||
|
|
||||||
inherit distutils-r1
|
|
||||||
|
|
||||||
DESCRIPTION="Magnificent app which corrects your previous console command"
|
|
||||||
HOMEPAGE="https://github.com/nvbn/thefuck"
|
|
||||||
SRC_URI="https://github.com/nvbn/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
|
||||||
KEYWORDS="~amd64"
|
|
||||||
|
|
||||||
LICENSE="MIT"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="test"
|
|
||||||
|
|
||||||
RDEPEND="dev-python/pathlib[${PYTHON_USEDEP}]
|
|
||||||
dev-python/psutil[${PYTHON_USEDEP}]
|
|
||||||
dev-python/six[${PYTHON_USEDEP}]
|
|
||||||
dev-python/decorator[${PYTHON_USEDEP}]
|
|
||||||
dev-python/colorama[${PYTHON_USEDEP}]"
|
|
||||||
DEPEND="test? ( ${RDEPEND}
|
|
||||||
dev-python/pytest[${PYTHON_USEDEP}] )
|
|
||||||
dev-python/setuptools[${PYTHON_USEDEP}]"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
sed -i -e "/import pip/s/^/#/" -e "/pip.__version__/,+3 s/^/#/" setup.py || die
|
|
||||||
distutils-r1_src_prepare
|
|
||||||
}
|
|
||||||
|
|
||||||
python_test() {
|
|
||||||
py.test || die
|
|
||||||
}
|
|
@ -1,77 +0,0 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=4
|
|
||||||
|
|
||||||
MY_PN="tidy"
|
|
||||||
MY_P="${MY_PN}-${PV}"
|
|
||||||
|
|
||||||
inherit eutils autotools
|
|
||||||
|
|
||||||
DESCRIPTION="Tidy the layout and correct errors in HTML and XML documents"
|
|
||||||
HOMEPAGE="http://tidy.sourceforge.net/"
|
|
||||||
SRC_URI="mirror://gentoo/${MY_P}.tar.bz2
|
|
||||||
mirror://gentoo/${MY_P}-doc.tar.bz2"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
IUSE="debug doc static-libs"
|
|
||||||
|
|
||||||
DEPEND="doc? ( app-doc/doxygen )"
|
|
||||||
RDEPEND=""
|
|
||||||
|
|
||||||
S="${WORKDIR}"/${MY_P}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# Required to setup the source dist for autotools
|
|
||||||
einfo "Setting up autotools for source build"
|
|
||||||
cp -R ./build/gnuauto/* . || die "could not prepare autotools environment"
|
|
||||||
|
|
||||||
# Stop tidy from appending -O2 to our CFLAGS
|
|
||||||
epatch "${FILESDIR}"/htmltidy-5.10.26-strip-O2-flag.patch
|
|
||||||
|
|
||||||
# Define /etc/tidyrc for system wide config, bug 154834
|
|
||||||
epatch "${FILESDIR}"/htmltidy-20090325-tidyrc.patch
|
|
||||||
|
|
||||||
eautoreconf
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
default
|
|
||||||
|
|
||||||
if use doc ; then
|
|
||||||
doxygen htmldoc/doxygen.cfg || die "error making apidocs"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
econf \
|
|
||||||
$(use_enable debug) \
|
|
||||||
$(use_enable static-libs static)
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
default
|
|
||||||
|
|
||||||
find "${ED}" -name '*.la' -exec rm -f {} +
|
|
||||||
|
|
||||||
# Now the man page is provided as an xsl file, which
|
|
||||||
# we can't use until htmltidy is merged.
|
|
||||||
# I have generated the man page and quickref which is on
|
|
||||||
# the mirrors. (bug #132429)
|
|
||||||
doman "${WORKDIR}"/"${MY_P}"-doc/tidy.1
|
|
||||||
|
|
||||||
# Fix name before installing
|
|
||||||
mv "${WORKDIR}"/"${MY_P}"-doc/quickref-html \
|
|
||||||
"${WORKDIR}"/"${MY_P}"-doc/quickref.html
|
|
||||||
|
|
||||||
cd "${S}"/htmldoc
|
|
||||||
# Install basic html documentation
|
|
||||||
dohtml *.html *.css *.gif "${WORKDIR}"/"${MY_P}"-doc/quickref.html
|
|
||||||
|
|
||||||
# If use 'doc' is set, then we also want to install the
|
|
||||||
# api documentation
|
|
||||||
use doc && dohtml -r api
|
|
||||||
}
|
|
@ -1,2 +1,2 @@
|
|||||||
DIST libspectre-0.2.6.tar.gz 358088 SHA256 2f637c62322c8040514284c00f63a5c310a28801e7dcfbe2ba2791be4fac0dd3 SHA512 4f99afe68293e188f70a5043f0c5199123d6ab0936f196b198f1c66eff980d54a6fba093be39839180dcef82db5fd9780a9d50887e453352d7b90b986829dfb6 WHIRLPOOL 0335575a7a5a5fa5724b35456105badcb845202b0d48b03a03f292aab10959e1a4ba9d94189c935667114878f20f7a5b8cbb892bf52533b4846a5afebb1eecb7
|
|
||||||
DIST libspectre-0.2.7.tar.gz 387947 SHA256 e81b822a106beed14cf0fec70f1b890c690c2ffa150fa2eee41dc26518a6c3ec SHA512 2e60905f7eeed9ac6ec3b5f8b47a7dad85178c8c35a63ba097ef6088dd334f7fde5797ecb05cf67532b759d07a65006427914d2cd6b09107ecc90620c9541794 WHIRLPOOL b59a1fea4ebd0cac13d4b5c7e76247de214761929bd71cf7879832acc4779786d764ddf2d38c5dea070f6e05c41f0d8460b8a8b11a51c35492827228740fb604
|
DIST libspectre-0.2.7.tar.gz 387947 SHA256 e81b822a106beed14cf0fec70f1b890c690c2ffa150fa2eee41dc26518a6c3ec SHA512 2e60905f7eeed9ac6ec3b5f8b47a7dad85178c8c35a63ba097ef6088dd334f7fde5797ecb05cf67532b759d07a65006427914d2cd6b09107ecc90620c9541794 WHIRLPOOL b59a1fea4ebd0cac13d4b5c7e76247de214761929bd71cf7879832acc4779786d764ddf2d38c5dea070f6e05c41f0d8460b8a8b11a51c35492827228740fb604
|
||||||
|
DIST libspectre-0.2.8.tar.gz 421791 SHA256 65256af389823bbc4ee4d25bfd1cc19023ffc29ae9f9677f2d200fa6e98bc7a8 SHA512 ebbe7f6adcbc7f7d6af61f24e23b114116c878755dbe90f1163546c1284a005b4d539be01986c1f940611e84141ca19768b8effc2abf1013606da7c93547da86 WHIRLPOOL 6e454fe6d16d8f01b45e82424b62a333876edfe44772fafafa1915caefdcbf857975814fd3d14294c5abebe3d1a80842a9ce212e43825bf144ebef96a60af32e
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
# Copyright 1999-2015 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils multilib pax-utils user
|
|
||||||
|
|
||||||
DESCRIPTION="Apache CouchDB is a distributed, fault-tolerant and schema-free document-oriented database."
|
|
||||||
HOMEPAGE="http://couchdb.apache.org/"
|
|
||||||
SRC_URI="mirror://apache/couchdb/source/${PV}/apache-${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="Apache-2.0"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~amd64 ~ppc ~x86"
|
|
||||||
IUSE="selinux test"
|
|
||||||
|
|
||||||
RDEPEND=">=dev-libs/icu-4.3.1:=
|
|
||||||
dev-lang/erlang[ssl]
|
|
||||||
>=dev-libs/openssl-0.9.8j:0
|
|
||||||
>=net-misc/curl-7.18.2
|
|
||||||
<dev-lang/spidermonkey-1.8.7
|
|
||||||
selinux? ( sec-policy/selinux-couchdb )"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}"
|
|
||||||
RESTRICT=test
|
|
||||||
|
|
||||||
S="${WORKDIR}/apache-${P}"
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
enewgroup couchdb
|
|
||||||
enewuser couchdb -1 -1 /var/lib/couchdb couchdb
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
sed -i ./src/couchdb/priv/Makefile.* -e 's|-Werror||g'
|
|
||||||
epatch "${FILESDIR}/${PV}-erlang-18.patch"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
econf \
|
|
||||||
--with-erlang="${EPREFIX}"/usr/$(get_libdir)/erlang/usr/include \
|
|
||||||
--localstatedir="${EPREFIX}"/var \
|
|
||||||
--with-js-lib="${EPREFIX}"/usr/$(get_libdir)
|
|
||||||
# bug 296609, upstream bug #COUCHDB-621
|
|
||||||
sed -e "s#localdocdir = /usr/share/doc/couchdb#localdocdir = "${EPREFIX}"/usr/share/doc/${PF}#" -i Makefile || die "sed failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
emake
|
|
||||||
# bug 442616
|
|
||||||
pax-mark mr src/couchdb/priv/couchjs
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
emake distcheck
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" install
|
|
||||||
|
|
||||||
fowners couchdb:couchdb \
|
|
||||||
/var/lib/couchdb \
|
|
||||||
/var/log/couchdb
|
|
||||||
|
|
||||||
for f in "${ED}"/etc/couchdb/*.ini ; do
|
|
||||||
fowners root:couchdb "${f#${ED}}"
|
|
||||||
fperms 660 "${f#${ED}}"
|
|
||||||
done
|
|
||||||
fperms 664 /etc/couchdb/default.ini
|
|
||||||
|
|
||||||
newinitd "${FILESDIR}/couchdb.init-4" couchdb
|
|
||||||
newconfd "${FILESDIR}/couchdb.conf-2" couchdb
|
|
||||||
|
|
||||||
sed -i -e "s:LIBDIR:$(get_libdir):" "${ED}/etc/conf.d/couchdb"
|
|
||||||
}
|
|
@ -0,0 +1,88 @@
|
|||||||
|
From 4eb8b813d0086a6eca9627ab64721378b07aa030 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Luke Bakken <lbakken@basho.com>
|
||||||
|
Date: Sat, 9 Jul 2016 07:43:41 -0700
|
||||||
|
Subject: [PATCH] OTP 19 support via compilation of CT suite. This defines
|
||||||
|
namespaced_types. Disable CT auto-compile. Fix warnings. Update to proper
|
||||||
|
v1.2
|
||||||
|
|
||||||
|
---
|
||||||
|
.gitignore | 8 ++++++++
|
||||||
|
test.config | 16 +++++++++++++---
|
||||||
|
test/hamcrest_matchers_SUITE.erl | 4 ++--
|
||||||
|
3 files changed, 23 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/.gitignore b/.gitignore
|
||||||
|
index 59ac5eb..d6882d0 100755
|
||||||
|
--- a/.gitignore
|
||||||
|
+++ b/.gitignore
|
||||||
|
@@ -4,6 +4,7 @@
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
|
*.swp
|
||||||
|
+.rebar/
|
||||||
|
build/*
|
||||||
|
^build$
|
||||||
|
Emakefile
|
||||||
|
@@ -15,3 +16,10 @@ ebin/*.beam
|
||||||
|
logs/*
|
||||||
|
include/hamcrest.hrl
|
||||||
|
qc.hrl
|
||||||
|
+deps/
|
||||||
|
+ct_*/
|
||||||
|
+all_runs.html
|
||||||
|
+ct_*
|
||||||
|
+jquery-latest.js
|
||||||
|
+jquery.tablesorter.min.js
|
||||||
|
+variables-ct@localhost
|
||||||
|
diff --git a/test.config b/test.config
|
||||||
|
index bff1a63..f206e37 100644
|
||||||
|
--- a/test.config
|
||||||
|
+++ b/test.config
|
||||||
|
@@ -1,9 +1,19 @@
|
||||||
|
-
|
||||||
|
{cover_enabled, true}.
|
||||||
|
+
|
||||||
|
{deps, [
|
||||||
|
- %% TODO: bind to a specific commit or tag instead of 'master'
|
||||||
|
- {proper, ".*", {git, "http://github.com/manopapad/proper.git", "v1.1"}}
|
||||||
|
+ {proper, "1.*", {git, "http://github.com/manopapad/proper.git", "v1.2"}}
|
||||||
|
]}.
|
||||||
|
|
||||||
|
+{erl_opts, [
|
||||||
|
+ debug_info,
|
||||||
|
+ fail_on_warning,
|
||||||
|
+ {src_dirs, ["test"]},
|
||||||
|
+ {platform_define, "^[0-9]+", namespaced_types}
|
||||||
|
+ ]}.
|
||||||
|
+
|
||||||
|
+{validate_app_modules, false}.
|
||||||
|
+
|
||||||
|
+{ct_extra_params, "-no_auto_compile"}.
|
||||||
|
+
|
||||||
|
{plugin_dir, "priv/build/plugins"}.
|
||||||
|
{plugins, [eqc_resolver]}.
|
||||||
|
diff --git a/test/hamcrest_matchers_SUITE.erl b/test/hamcrest_matchers_SUITE.erl
|
||||||
|
index f2889e2..6726425 100644
|
||||||
|
--- a/test/hamcrest_matchers_SUITE.erl
|
||||||
|
+++ b/test/hamcrest_matchers_SUITE.erl
|
||||||
|
@@ -69,7 +69,7 @@ is_not_evaluates_to_logical_negation_of_underlying_matcher(_) ->
|
||||||
|
?EQC(P).
|
||||||
|
|
||||||
|
is_not_provides_convenient_shortcut_for_not_equal_to(_) ->
|
||||||
|
- P = ?FORALL({X, Y}, {binary(), binary()},
|
||||||
|
+ P = ?FORALL({X, _Y}, {binary(), binary()},
|
||||||
|
begin
|
||||||
|
#'hamcrest.matchspec'{matcher=F1} = equal_to(X),
|
||||||
|
#'hamcrest.matchspec'{matcher=F2} = is_not(X),
|
||||||
|
@@ -240,7 +240,7 @@ ends_with_should_only_match_last_portion_of_string(_) ->
|
||||||
|
?IMPLIES(length(Xs) > 0,
|
||||||
|
begin
|
||||||
|
Y = round(length(Xs) / 2),
|
||||||
|
- LStr = string:left(Xs, Y),
|
||||||
|
+ _LStr = string:left(Xs, Y),
|
||||||
|
RStr = string:right(Xs, Y),
|
||||||
|
case (assert_that(Xs, ends_with(RStr))) of
|
||||||
|
true -> true;
|
||||||
|
--
|
||||||
|
2.9.0
|
||||||
|
|
@ -1 +1,2 @@
|
|||||||
DIST tiled-0.16.1.tar.gz 4506022 SHA256 c666627fc243d27fb879d85b9de841b5c82d1363f93204e5f72afd50a1373168 SHA512 425cbdc66132312326b9edc0cf4aa24116cfb0a2f89c1a51107f8bdfbf4f8c41ba450a8a3737867b2fc8bda43cfb66669e488b3c540911e60860086365939d62 WHIRLPOOL 2aea640f6a725194d7b980481d01b8b1802349a031cf8b07baf6f58cf8bc668516ef03cc1feb1275a8ea565ba0b3e200494fc677add7ada0fc20b6ddae74009b
|
DIST tiled-0.16.1.tar.gz 4506022 SHA256 c666627fc243d27fb879d85b9de841b5c82d1363f93204e5f72afd50a1373168 SHA512 425cbdc66132312326b9edc0cf4aa24116cfb0a2f89c1a51107f8bdfbf4f8c41ba450a8a3737867b2fc8bda43cfb66669e488b3c540911e60860086365939d62 WHIRLPOOL 2aea640f6a725194d7b980481d01b8b1802349a031cf8b07baf6f58cf8bc668516ef03cc1feb1275a8ea565ba0b3e200494fc677add7ada0fc20b6ddae74009b
|
||||||
|
DIST tiled-0.16.2.tar.gz 4503339 SHA256 801f607ae1eb306cbffd5d3e42ac1131dca0c0be9511118e126c8cc842474351 SHA512 a8cd9aee4111586de16935e00824b4adcea69a8e610578fa1f0cf417d2320f5e60aa97796221c9962bfbb7a0198bcfc79c47cde6f43531165d93ab6c0263060f WHIRLPOOL b1960db6c7d70ff8be7a4fa0e03df3bfe779eecbc25562e4e6d5c61c7a4963d01f42b6f716f70d23b2cd14bf16a1a5a9fee42c806f49a08cecaf88dec61eeb83
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
# Copyright 1999-2016 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
EAPI=6
|
||||||
|
|
||||||
|
PYTHON_COMPAT=( python2_7 )
|
||||||
|
inherit fdo-mime gnome2-utils multilib python-single-r1 qmake-utils
|
||||||
|
|
||||||
|
DESCRIPTION="A general purpose tile map editor"
|
||||||
|
HOMEPAGE="http://www.mapeditor.org/"
|
||||||
|
SRC_URI="https://github.com/bjorn/tiled/archive/v${PV}/${P}.tar.gz"
|
||||||
|
|
||||||
|
LICENSE="BSD BSD-2 GPL-2+"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~amd64"
|
||||||
|
IUSE="examples python"
|
||||||
|
|
||||||
|
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||||
|
|
||||||
|
RDEPEND="
|
||||||
|
>=dev-qt/qtcore-5.6:5
|
||||||
|
>=dev-qt/qtgui-5.6:5
|
||||||
|
>=dev-qt/qtnetwork-5.6:5
|
||||||
|
>=dev-qt/qtopengl-5.6:5
|
||||||
|
>=dev-qt/qtwidgets-5.6:5
|
||||||
|
sys-libs/zlib
|
||||||
|
python? ( ${PYTHON_DEPS} )
|
||||||
|
"
|
||||||
|
DEPEND="${RDEPEND}
|
||||||
|
dev-qt/linguist-tools:5
|
||||||
|
"
|
||||||
|
|
||||||
|
DOCS=( AUTHORS COPYING NEWS.md README.md )
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
use python && python-single-r1_pkg_setup
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
eqmake5 LIBDIR="/usr/$(get_libdir)" PREFIX="/usr" DISABLE_PYTHON_PLUGIN="$(usex !python)"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
emake INSTALL_ROOT="${D}" install
|
||||||
|
|
||||||
|
einstalldocs
|
||||||
|
|
||||||
|
if use examples ; then
|
||||||
|
docompress -x /usr/share/doc/${PF}/examples
|
||||||
|
dodoc -r examples
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_preinst() {
|
||||||
|
gnome2_icon_savelist
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
gnome2_icon_cache_update
|
||||||
|
fdo-mime_desktop_database_update
|
||||||
|
fdo-mime_mime_database_update
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postrm() {
|
||||||
|
gnome2_icon_cache_update
|
||||||
|
fdo-mime_desktop_database_update
|
||||||
|
fdo-mime_mime_database_update
|
||||||
|
}
|
@ -1,11 +1,3 @@
|
|||||||
DIST php-5.5.33.tar.bz2 13686486 SHA256 c490b1ed4df596b48eb68f630d89ca512945e2650840e7dace1119cc7e600aa9 SHA512 a0ac57adcc4b0caec153265a8d1ded8d4d0f71b44f08158feb0add9c8fdd36826767882e85dd03399cf146800eddcb6b6cc1b21051d4fc4371e3f61b1169132b WHIRLPOOL 373c61677adb89506cc4621d1c7a0732f6454a8679a797807631f2286188bb990dfcaf34b4108edf7b1819424100fa0d7060f0f792a65dc5f1c130cfa00e6b45
|
|
||||||
DIST php-5.5.34.tar.bz2 13686681 SHA256 af88884416a92619de842ad0fd23f7f7e8140efb0b9194f98a38a78781e5851c SHA512 c4269f79f5acaac64e9d2e20feef4bbd5aa7a84e69445dee64bf068197d611aa8ceb3697ae6461d8c96068be7839f22eeaff61f201f6e7a8749d284eaa68c0f8 WHIRLPOOL f4771f614176242a9a3e27185c98822493ca1b1982b5b11b3ee53d952534c69a73e0625b589723cc153da0978b27a8e55c7f9056b81b7a282dc385d22f4fdf02
|
|
||||||
DIST php-5.5.35.tar.bz2 13690152 SHA256 2d648dd648e820fd64693ce72f9bf07064d147220e594e39fb9f6310238258d7 SHA512 cfa62f83cd79b678c55ffdb1325906962bb7dae23fdbe963d57c3b24d13223229448f4c45727df1ab042bbd2db85804051c66993c28c68c0c873481cfe7e6834 WHIRLPOOL e7b765b6d99e7f9c0e18cae64577d0e7e7eb136debf565f49ab02a962046437064f810d1a407546e2f83d69cfb3104244424ae5a34bc83c3778aaff95984a9f7
|
|
||||||
DIST php-5.5.36.tar.bz2 13686345 SHA256 2484edfaa3de606d74f927b55c5206f51b1ae24ea8e428aa9fc15474c7bb71bb SHA512 5521ef8bec1720e3df49f5b002c93726d1b52a7b551acf414e32dfd8ca88f8d661b9f011408d7f9f451fb29b06385365d2975bb14ed6d3c10cdc5546543af485 WHIRLPOOL 687818ee021cb473a92ff7c5b67c6b110360227aaecbb6832f0f8383d0a4878f038d45c49518aa38e2b99d96e2eaa6e5de7f535c1fcce05f41024ca7423e2783
|
|
||||||
DIST php-5.5.37.tar.bz2 13699851 SHA256 d2380ebe46caf17f2c4cd055867d00a82e6702dc5f62dc29ce864a5742905d88 SHA512 d2da921f3efd858e1cb8004873e377ca9c5821d5269d5b8e7c9be830b183f4d18f737b14653f65a43c0957bdca994e09a476d77e3a29a11e357abc24618c4c0f WHIRLPOOL 8db12b1d090bc1bfb3f5b20c661ba05588b8f988484d1887a959f943dd6f1756cb62bac811c809af516e6c3582b64388443546a3b4a17f0527a69fcbafc0452c
|
DIST php-5.5.37.tar.bz2 13699851 SHA256 d2380ebe46caf17f2c4cd055867d00a82e6702dc5f62dc29ce864a5742905d88 SHA512 d2da921f3efd858e1cb8004873e377ca9c5821d5269d5b8e7c9be830b183f4d18f737b14653f65a43c0957bdca994e09a476d77e3a29a11e357abc24618c4c0f WHIRLPOOL 8db12b1d090bc1bfb3f5b20c661ba05588b8f988484d1887a959f943dd6f1756cb62bac811c809af516e6c3582b64388443546a3b4a17f0527a69fcbafc0452c
|
||||||
DIST php-5.6.19.tar.bz2 14100438 SHA256 2a24a3f84971680ac0a4c71050067de4f76ee235aa4a041fae21bfa69975c168 SHA512 c8c2b3bdfc1a8abe834612c33123b4f103e841c230b53934fb7bafe11af7f1175f02ca54c92f33e8e603485e6283897bebb51acc55d1213b7433024684215c14 WHIRLPOOL f026e8779c531f887b1e292e5f1d6eafd0e3ae46f83ae8efb830ad8e0f91d86e5b002dda9e6a02987db6230557ff773d8c52dd2db423d792aed1aca292e5b92b
|
|
||||||
DIST php-5.6.20.tar.bz2 14162188 SHA256 5ac7bf7caec7a79b18cf458e786fd1609ad2da771224b80bc15cc6f01b22bf1f SHA512 9e26f2564ee7329ab50d4d8d27f029c4f88317ea761888138e60d13a3cf51e49676ded406a3ec18433be2ec5d2a49c904eaa9f32d473b99d11550025e026a61c WHIRLPOOL 679c8ee4b3ddf18d94598982969fd12d053493fbe70d4b9f8d3eda4ed9ab0bb6f83d912bb7f8ebd99264beea992cce7c1083d257576551fadf537b5655d23d57
|
|
||||||
DIST php-5.6.21.tar.bz2 14165919 SHA256 b4ed7ab574b689fd6d6494fde954826c06efc85c505e017b8d776c7c7f479590 SHA512 028d62434e7932b4a07fa7d404b8ad938f0ca7968ae2b23386038f77482984d2b6145523e11f37b9e72621c8bf40f08e38a6db1d209493770ac99e13e2fac0d0 WHIRLPOOL e5e606f0a3df1af12c9c0148a29336de0d00a8d7cedbb42727a3e1b6a700e0dcda63c7086e59f175ec060cbf910c2b12815ae3c08bb73d43a84b4f3aaa5d2ed6
|
|
||||||
DIST php-5.6.22.tar.bz2 14170522 SHA256 90da8a80cc52fa699cf2bfa4c6fa737c772df7c92b81ef483460aa3b1e9f88c6 SHA512 9d21104832a1053a350ff31196e2c41cef713a9dfe207491236219954cf2eea216049b2f40313fb2a8e9ef641aad0af3f69456bbcebdf8fee312b0dd4a7df320 WHIRLPOOL 2163f683c2e572ddd9a7368e070b172f6b2f2fcb0128ac7db0b8639e0b14b0b1fa7050cb6082b627006e700099c1ca4144b20a2c5cd637ecad697e99a125e284
|
|
||||||
DIST php-5.6.23.tar.bz2 14178077 SHA256 facd280896d277e6f7084b60839e693d4db68318bfc92085d3dc0251fd3558c7 SHA512 92be3685926f302223465e9673496971f0ee1b05c7b3a09682d4ef93a27b4c17e5c53c36acab15d26f38508f6d65bebe11a6f0f0fc98b27eafe95b02b4d9897d WHIRLPOOL 71375395742a83ec0f55bd7edf5eeff732e4db24f77f436f519ca81a2ceeb0bac65549ca1ffd34cb7b593771b5f4ccb984900841a20c1620a6121e4fa14ab086
|
DIST php-5.6.23.tar.bz2 14178077 SHA256 facd280896d277e6f7084b60839e693d4db68318bfc92085d3dc0251fd3558c7 SHA512 92be3685926f302223465e9673496971f0ee1b05c7b3a09682d4ef93a27b4c17e5c53c36acab15d26f38508f6d65bebe11a6f0f0fc98b27eafe95b02b4d9897d WHIRLPOOL 71375395742a83ec0f55bd7edf5eeff732e4db24f77f436f519ca81a2ceeb0bac65549ca1ffd34cb7b593771b5f4ccb984900841a20c1620a6121e4fa14ab086
|
||||||
DIST php-7.0.8.tar.bz2 14105805 SHA256 66dc7ba388490e07b1313fe3a06b1fa822e1310585fe29f4909995f131e27c8d SHA512 a1a119ff95ad3902264dbc267753af0cf82b5dddbfcf09a8fc2bc519e16021cbf4bc7f2b33c4fec46d7be7bed8db315371ee11390a6055adf908a3b28a6a6921 WHIRLPOOL 5907158c1974715cda7abca0dec6736fb265372cd643d2699b91936c964b72334468eef778e485125df8fc7d21064a394c735510e0731321360e7272aa83d41d
|
DIST php-7.0.8.tar.bz2 14105805 SHA256 66dc7ba388490e07b1313fe3a06b1fa822e1310585fe29f4909995f131e27c8d SHA512 a1a119ff95ad3902264dbc267753af0cf82b5dddbfcf09a8fc2bc519e16021cbf4bc7f2b33c4fec46d7be7bed8db315371ee11390a6055adf908a3b28a6a6921 WHIRLPOOL 5907158c1974715cda7abca0dec6736fb265372cd643d2699b91936c964b72334468eef778e485125df8fc7d21064a394c735510e0731321360e7272aa83d41d
|
||||||
|
@ -1,784 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd
|
|
||||||
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
|
|
||||||
function php_get_uri ()
|
|
||||||
{
|
|
||||||
case "${1}" in
|
|
||||||
"php-pre")
|
|
||||||
echo "http://downloads.php.net/dsp/${2}"
|
|
||||||
;;
|
|
||||||
"php")
|
|
||||||
echo "http://www.php.net/distributions/${2}"
|
|
||||||
;;
|
|
||||||
"olemarkus")
|
|
||||||
echo "https://dev.gentoo.org/~olemarkus/php/${2}"
|
|
||||||
;;
|
|
||||||
"gentoo")
|
|
||||||
echo "mirror://gentoo/${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled case in php_get_uri"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_MV="$(get_major_version)"
|
|
||||||
SLOT="$(get_version_component_range 1-2)"
|
|
||||||
|
|
||||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
||||||
# betas, ...) w/o changing the whole ebuild
|
|
||||||
PHP_PV="${PV/_rc/RC}"
|
|
||||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
|
||||||
PHP_PV="${PHP_PV/_beta/beta}"
|
|
||||||
PHP_RELEASE="php"
|
|
||||||
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
PHP_P="${PN}-${PHP_PV}"
|
|
||||||
|
|
||||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
||||||
|
|
||||||
PHP_FPM_CONF_VER="1"
|
|
||||||
|
|
||||||
SRC_URI="${PHP_SRC_URI}"
|
|
||||||
|
|
||||||
DESCRIPTION="The PHP language runtime engine"
|
|
||||||
HOMEPAGE="http://php.net/"
|
|
||||||
LICENSE="PHP-3"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PHP_P}"
|
|
||||||
|
|
||||||
# We can build the following SAPIs in the given order
|
|
||||||
SAPIS="embed cli cgi fpm apache2"
|
|
||||||
|
|
||||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
||||||
IUSE="${IUSE}
|
|
||||||
${SAPIS/cli/+cli}
|
|
||||||
threads"
|
|
||||||
|
|
||||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
|
||||||
crypt +ctype curl debug
|
|
||||||
enchant exif frontbase +fileinfo +filter firebird
|
|
||||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
|
||||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash
|
|
||||||
mssql mysql libmysqlclient mysqli nls
|
|
||||||
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
|
||||||
readline recode selinux +session sharedmem
|
|
||||||
+simplexml snmp soap sockets spell sqlite ssl
|
|
||||||
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
|
|
||||||
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
|
|
||||||
>=dev-libs/libpcre-8.32[unicode]
|
|
||||||
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
|
|
||||||
<www-servers/apache-2.4[threads=] ) )
|
|
||||||
berkdb? ( =sys-libs/db-4* )
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
||||||
cjk? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
||||||
curl? ( >=net-misc/curl-7.10.5 )
|
|
||||||
enchant? ( app-text/enchant )
|
|
||||||
exif? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
firebird? ( dev-db/firebird )
|
|
||||||
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
||||||
gmp? ( >=dev-libs/gmp-4.1.2 )
|
|
||||||
iconv? ( virtual/libiconv )
|
|
||||||
imap? ( virtual/imap-c-client[ssl=] )
|
|
||||||
intl? ( dev-libs/icu:= )
|
|
||||||
iodbc? ( dev-db/libiodbc )
|
|
||||||
kerberos? ( virtual/krb5 )
|
|
||||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
|
||||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
|
||||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
||||||
mssql? ( dev-db/freetds[mssql] )
|
|
||||||
libmysqlclient? (
|
|
||||||
mysql? ( virtual/mysql )
|
|
||||||
mysqli? ( >=virtual/mysql-4.1 )
|
|
||||||
)
|
|
||||||
nls? ( sys-devel/gettext )
|
|
||||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
||||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
||||||
postgres? ( dev-db/postgresql )
|
|
||||||
qdbm? ( dev-db/qdbm )
|
|
||||||
readline? ( sys-libs/readline )
|
|
||||||
recode? ( app-text/recode )
|
|
||||||
sharedmem? ( dev-libs/mm )
|
|
||||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
||||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
spell? ( >=app-text/aspell-0.50 )
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
|
|
||||||
ssl? ( >=dev-libs/openssl-0.9.7 )
|
|
||||||
sybase-ct? ( dev-db/freetds )
|
|
||||||
tidy? ( app-text/htmltidy )
|
|
||||||
truetype? (
|
|
||||||
=media-libs/freetype-2*
|
|
||||||
>=media-libs/t1lib-5.0.0
|
|
||||||
!gd? (
|
|
||||||
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
)
|
|
||||||
unicode? ( dev-libs/oniguruma )
|
|
||||||
vpx? ( media-libs/libvpx )
|
|
||||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
||||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xpm? (
|
|
||||||
x11-libs/libXpm
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0= sys-libs/zlib
|
|
||||||
)
|
|
||||||
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
||||||
zip? ( sys-libs/zlib )
|
|
||||||
zlib? ( sys-libs/zlib )
|
|
||||||
virtual/mta
|
|
||||||
"
|
|
||||||
|
|
||||||
php="=${CATEGORY}/${PF}"
|
|
||||||
|
|
||||||
REQUIRED_USE="
|
|
||||||
truetype? ( gd )
|
|
||||||
vpx? ( gd )
|
|
||||||
cjk? ( gd )
|
|
||||||
exif? ( gd )
|
|
||||||
|
|
||||||
xpm? ( gd )
|
|
||||||
gd? ( zlib )
|
|
||||||
simplexml? ( xml )
|
|
||||||
soap? ( xml )
|
|
||||||
wddx? ( xml )
|
|
||||||
xmlrpc? ( || ( xml iconv ) )
|
|
||||||
xmlreader? ( xml )
|
|
||||||
xslt? ( xml )
|
|
||||||
ldap-sasl? ( ldap )
|
|
||||||
mhash? ( hash )
|
|
||||||
phar? ( hash )
|
|
||||||
libmysqlclient? ( || (
|
|
||||||
mysql
|
|
||||||
mysqli
|
|
||||||
pdo
|
|
||||||
) )
|
|
||||||
|
|
||||||
qdbm? ( !gdbm )
|
|
||||||
readline? ( !libedit )
|
|
||||||
recode? ( !imap !mysql !mysqli )
|
|
||||||
sharedmem? ( !threads )
|
|
||||||
|
|
||||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
RDEPEND="${RDEPEND}
|
|
||||||
fpm? (
|
|
||||||
selinux? ( sec-policy/selinux-phpfpm )
|
|
||||||
systemd? ( sys-apps/systemd ) )"
|
|
||||||
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-devel/m4-1.4.3
|
|
||||||
>=sys-devel/libtool-1.5.18"
|
|
||||||
|
|
||||||
# Allow users to install production version if they want to
|
|
||||||
|
|
||||||
case "${PHP_INI_VERSION}" in
|
|
||||||
production|development)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PHP_INI_VERSION="development"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
|
||||||
PHP_INI_FILE="php.ini"
|
|
||||||
|
|
||||||
want_apache
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
depend.apache_pkg_setup
|
|
||||||
}
|
|
||||||
|
|
||||||
php_install_ini() {
|
|
||||||
local phpsapi="${1}"
|
|
||||||
|
|
||||||
# work out where we are installing the ini file
|
|
||||||
php_set_ini_dir "${phpsapi}"
|
|
||||||
|
|
||||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
|
||||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
|
|
||||||
|
|
||||||
# default to /tmp for save_path, bug #282768
|
|
||||||
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}"
|
|
||||||
|
|
||||||
# Set the extension dir
|
|
||||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
|
|
||||||
|
|
||||||
# Set the include path to point to where we want to find PEAR packages
|
|
||||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}"
|
|
||||||
|
|
||||||
dodir "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
|
||||||
|
|
||||||
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
elog
|
|
||||||
|
|
||||||
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
|
|
||||||
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
|
|
||||||
|
|
||||||
if use_if_iuse opcache; then
|
|
||||||
elog "Adding opcache to $PHP_EXT_INI_DIR"
|
|
||||||
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
|
|
||||||
dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SAPI-specific handling
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "fpm" ]] ; then
|
|
||||||
[[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0
|
|
||||||
einfo "Installing FPM CGI config file php-fpm.conf"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf
|
|
||||||
|
|
||||||
# Remove bogus /etc/php-fpm.conf.default (bug 359906)
|
|
||||||
[[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install PHP ini files into /usr/share/php
|
|
||||||
|
|
||||||
dodoc php.ini-development
|
|
||||||
dodoc php.ini-production
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
php_set_ini_dir() {
|
|
||||||
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
|
|
||||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
|
||||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
|
|
||||||
# ([empty session.save_path]/session_mm_[sapi][gid].sem)
|
|
||||||
# there is no easy way to circumvent that, all php calls during
|
|
||||||
# install use -n, so no php.ini file will be used.
|
|
||||||
# As such, this is the easiest way to get around
|
|
||||||
addpredict /session_mm_cli250.sem
|
|
||||||
addpredict /session_mm_cli0.sem
|
|
||||||
|
|
||||||
# Change PHP branding
|
|
||||||
# Get the alpha/beta/rc version
|
|
||||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
|
|
||||||
-i configure.in || die "Unable to change PHP branding"
|
|
||||||
|
|
||||||
# Patch PHP to show Gentoo as the server platform
|
|
||||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
|
||||||
-i configure.in || die "Failed to fix server platform name"
|
|
||||||
|
|
||||||
# Prevent PHP from activating the Apache config,
|
|
||||||
# as we will do that ourselves
|
|
||||||
sed -i \
|
|
||||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4
|
|
||||||
|
|
||||||
# Patch PHP to support heimdal instead of mit-krb5
|
|
||||||
if has_version "app-crypt/heimdal" ; then
|
|
||||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal libname"
|
|
||||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal crypt library reference"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Add user patches #357637
|
|
||||||
epatch_user
|
|
||||||
|
|
||||||
#force rebuilding aclocal.m4
|
|
||||||
rm aclocal.m4
|
|
||||||
eautoreconf
|
|
||||||
|
|
||||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
|
||||||
# http://bugs.php.net/bug.php?id=48795, bug #343481
|
|
||||||
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
||||||
|
|
||||||
# This is a global variable and should be in caps. It isn't because the
|
|
||||||
# phpconfutils eclass relies on exactly this name...
|
|
||||||
# for --with-libdir see bug #327025
|
|
||||||
my_conf="
|
|
||||||
--prefix="${PHP_DESTDIR}"
|
|
||||||
--mandir="${PHP_DESTDIR}"/man
|
|
||||||
--infodir="${PHP_DESTDIR}"/info
|
|
||||||
--libdir="${PHP_DESTDIR}"/lib
|
|
||||||
--with-libdir=$(get_libdir)
|
|
||||||
--without-pear
|
|
||||||
$(use_enable threads maintainer-zts)"
|
|
||||||
|
|
||||||
# extension USE flag shared
|
|
||||||
my_conf+="
|
|
||||||
$(use_enable bcmath bcmath )
|
|
||||||
$(use_with bzip2 bz2 "${EPREFIX}"/usr)
|
|
||||||
$(use_enable calendar calendar )
|
|
||||||
$(use_enable ctype ctype )
|
|
||||||
$(use_with curl curl "${EPREFIX}"/usr)
|
|
||||||
$(use_enable xml dom )
|
|
||||||
$(use_with enchant enchant "${EPREFIX}"/usr)
|
|
||||||
$(use_enable exif exif )
|
|
||||||
$(use_enable fileinfo fileinfo )
|
|
||||||
$(use_enable filter filter )
|
|
||||||
$(use_enable ftp ftp )
|
|
||||||
$(use_with nls gettext "${EPREFIX}"/usr)
|
|
||||||
$(use_with gmp gmp "${EPREFIX}"/usr)
|
|
||||||
$(use_enable hash hash )
|
|
||||||
$(use_with mhash mhash "${EPREFIX}"/usr)
|
|
||||||
$(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr))
|
|
||||||
$(use_enable intl intl )
|
|
||||||
$(use_enable ipv6 ipv6 )
|
|
||||||
$(use_enable json json )
|
|
||||||
$(use_with kerberos kerberos "${EPREFIX}"/usr)
|
|
||||||
$(use_enable xml libxml )
|
|
||||||
$(use_with xml libxml-dir "${EPREFIX}"/usr)
|
|
||||||
$(use_enable unicode mbstring )
|
|
||||||
$(use_with crypt mcrypt "${EPREFIX}"/usr)
|
|
||||||
$(use_with mssql mssql "${EPREFIX}"/usr)
|
|
||||||
$(use_with unicode onig "${EPREFIX}"/usr)
|
|
||||||
$(use_with ssl openssl "${EPREFIX}"/usr)
|
|
||||||
$(use_with ssl openssl-dir "${EPREFIX}"/usr)
|
|
||||||
$(use_enable pcntl pcntl )
|
|
||||||
$(use_enable phar phar )
|
|
||||||
$(use_enable pdo pdo )
|
|
||||||
$(use_enable opcache opcache )
|
|
||||||
$(use_with postgres pgsql "${EPREFIX}"/usr)
|
|
||||||
$(use_enable posix posix )
|
|
||||||
$(use_with spell pspell "${EPREFIX}"/usr)
|
|
||||||
$(use_with recode recode "${EPREFIX}"/usr)
|
|
||||||
$(use_enable simplexml simplexml )
|
|
||||||
$(use_enable sharedmem shmop )
|
|
||||||
$(use_with snmp snmp "${EPREFIX}"/usr)
|
|
||||||
$(use_enable soap soap )
|
|
||||||
$(use_enable sockets sockets )
|
|
||||||
$(use_with sqlite sqlite3 "${EPREFIX}"/usr)
|
|
||||||
$(use_with sybase-ct sybase-ct "${EPREFIX}"/usr)
|
|
||||||
$(use_enable sysvipc sysvmsg )
|
|
||||||
$(use_enable sysvipc sysvsem )
|
|
||||||
$(use_enable sysvipc sysvshm )
|
|
||||||
$(use_with systemd fpm-systemd)
|
|
||||||
$(use_with tidy tidy "${EPREFIX}"/usr)
|
|
||||||
$(use_enable tokenizer tokenizer )
|
|
||||||
$(use_enable wddx wddx )
|
|
||||||
$(use_enable xml xml )
|
|
||||||
$(use_enable xmlreader xmlreader )
|
|
||||||
$(use_enable xmlwriter xmlwriter )
|
|
||||||
$(use_with xmlrpc xmlrpc)
|
|
||||||
$(use_with xslt xsl "${EPREFIX}"/usr)
|
|
||||||
$(use_enable zip zip )
|
|
||||||
$(use_with zlib zlib "${EPREFIX}"/usr)
|
|
||||||
$(use_enable debug debug )"
|
|
||||||
|
|
||||||
# DBA support
|
|
||||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
|
||||||
|| use qdbm ; then
|
|
||||||
my_conf="${my_conf} --enable-dba${shared}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DBA drivers support
|
|
||||||
my_conf+="
|
|
||||||
$(use_with cdb cdb)
|
|
||||||
$(use_with berkdb db4 ${EPREFIX}/usr)
|
|
||||||
$(use_enable flatfile flatfile )
|
|
||||||
$(use_with gdbm gdbm ${EPREFIX}/usr)
|
|
||||||
$(use_enable inifile inifile )
|
|
||||||
$(use_with qdbm qdbm ${EPREFIX}/usr)"
|
|
||||||
|
|
||||||
# Support for the GD graphics library
|
|
||||||
my_conf+="
|
|
||||||
$(use_with truetype freetype-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with truetype t1lib ${EPREFIX}/usr)
|
|
||||||
$(use_enable cjk gd-jis-conv )
|
|
||||||
$(use_with gd jpeg-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with gd png-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with xpm xpm-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with vpx vpx-dir ${EPREFIX}/usr)"
|
|
||||||
# enable gd last, so configure can pick up the previous settings
|
|
||||||
my_conf+="
|
|
||||||
$(use_with gd gd)"
|
|
||||||
|
|
||||||
# IMAP support
|
|
||||||
if use imap ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with imap imap ${EPREFIX}/usr)
|
|
||||||
$(use_with ssl imap-ssl ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Interbase/firebird support
|
|
||||||
|
|
||||||
if use firebird ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with firebird interbase ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# LDAP support
|
|
||||||
if use ldap ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with ldap ldap ${EPREFIX}/usr)
|
|
||||||
$(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# MySQL support
|
|
||||||
local mysqllib="mysqlnd"
|
|
||||||
local mysqlilib="mysqlnd"
|
|
||||||
use libmysqlclient && mysqllib="${EPREFIX}/usr"
|
|
||||||
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
|
|
||||||
|
|
||||||
my_conf+=" $(use_with mysql mysql $mysqllib)"
|
|
||||||
my_conf+=" $(use_with mysqli mysqli $mysqlilib)"
|
|
||||||
|
|
||||||
local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)"
|
|
||||||
if use mysql ; then
|
|
||||||
my_conf+="${mysqlsock}"
|
|
||||||
elif use mysqli ; then
|
|
||||||
my_conf+="${mysqlsock}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ODBC support
|
|
||||||
if use odbc ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with odbc unixODBC ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if use iodbc ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with iodbc iodbc ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Oracle support
|
|
||||||
if use oci8-instant-client ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with oci8-instant-client oci8)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# PDO support
|
|
||||||
if use pdo ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with mssql pdo-dblib )
|
|
||||||
$(use_with mysql pdo-mysql ${mysqllib})
|
|
||||||
$(use_with postgres pdo-pgsql )
|
|
||||||
$(use_with sqlite pdo-sqlite ${EPREFIX}/usr)
|
|
||||||
$(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)"
|
|
||||||
if use oci8-instant-client ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with oci8-instant-client pdo-oci)"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readline/libedit support
|
|
||||||
my_conf+="
|
|
||||||
$(use_with readline readline ${EPREFIX}/usr)
|
|
||||||
$(use_with libedit libedit ${EPREFIX}/usr)"
|
|
||||||
|
|
||||||
# Session support
|
|
||||||
if use session ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with sharedmem mm ${EPREFIX}/usr)"
|
|
||||||
else
|
|
||||||
my_conf+="
|
|
||||||
$(use_enable session session )"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use pic for shared modules such as apache2's mod_php
|
|
||||||
my_conf="${my_conf} --with-pic"
|
|
||||||
|
|
||||||
# we use the system copy of pcre
|
|
||||||
# --with-pcre-regex affects ext/pcre
|
|
||||||
# --with-pcre-dir affects ext/filter and ext/zip
|
|
||||||
my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr"
|
|
||||||
|
|
||||||
# Catch CFLAGS problems
|
|
||||||
# Fixes bug #14067.
|
|
||||||
# Changed order to run it in reverse for bug #32022 and #12021.
|
|
||||||
replace-cpu-flags "k6*" "i586"
|
|
||||||
|
|
||||||
# Support user-passed configuration parameters
|
|
||||||
my_conf="${my_conf} ${EXTRA_ECONF:-}"
|
|
||||||
|
|
||||||
# Support the Apache2 extras, they must be set globally for all
|
|
||||||
# SAPIs to work correctly, especially for external PHP extensions
|
|
||||||
|
|
||||||
mkdir -p "${WORKDIR}/sapis-build"
|
|
||||||
for one_sapi in $SAPIS ; do
|
|
||||||
use "${one_sapi}" || continue
|
|
||||||
php_set_ini_dir "${one_sapi}"
|
|
||||||
|
|
||||||
cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
|
|
||||||
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
|
|
||||||
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
|
|
||||||
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
case "$sapi" in
|
|
||||||
cli|cgi|embed|fpm)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf="${sapi_conf} --enable-${sapi}"
|
|
||||||
else
|
|
||||||
sapi_conf="${sapi_conf} --disable-${sapi}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
apache2)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs"
|
|
||||||
else
|
|
||||||
sapi_conf="${sapi_conf} --without-apxs2"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
econf ${sapi_conf}
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
# snmp seems to run during src_compile, too (bug #324739)
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
for sapi in ${SAPIS} ; do
|
|
||||||
if use "${sapi}"; then
|
|
||||||
cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
|
||||||
emake || die "emake failed"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# see bug #324739 for what happens when we don't have that
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
|
|
||||||
# grab the first SAPI that got built and install common files from there
|
|
||||||
local first_sapi=""
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
if use $sapi ; then
|
|
||||||
first_sapi=$sapi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Makefile forgets to create this before trying to write to it...
|
|
||||||
dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
|
|
||||||
|
|
||||||
# Install php environment (without any sapis)
|
|
||||||
cd "${WORKDIR}/sapis-build/$first_sapi"
|
|
||||||
emake INSTALL_ROOT="${D}" \
|
|
||||||
install-build install-headers install-programs \
|
|
||||||
|| die "emake install failed"
|
|
||||||
|
|
||||||
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
|
|
||||||
|
|
||||||
# Create the directory where we'll put version-specific php scripts
|
|
||||||
keepdir /usr/share/php${PHP_MV}
|
|
||||||
|
|
||||||
local sapi="", file=""
|
|
||||||
local sapi_list=""
|
|
||||||
|
|
||||||
for sapi in ${SAPIS}; do
|
|
||||||
if use "${sapi}" ; then
|
|
||||||
einfo "Installing SAPI: ${sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${sapi}"
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "apache2" ]] ; then
|
|
||||||
# We're specifically not using emake install-sapi as libtool
|
|
||||||
# may cause unnecessary relink failures (see bug #351266)
|
|
||||||
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
|
|
||||||
newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)"
|
|
||||||
keepdir "/usr/$(get_libdir)/apache2/modules"
|
|
||||||
else
|
|
||||||
# needed each time, php_install_ini would reset it
|
|
||||||
local dest="${PHP_DESTDIR#${EPREFIX}}"
|
|
||||||
into "${dest}"
|
|
||||||
case "$sapi" in
|
|
||||||
cli)
|
|
||||||
source="sapi/cli/php"
|
|
||||||
;;
|
|
||||||
cgi)
|
|
||||||
source="sapi/cgi/php-cgi"
|
|
||||||
;;
|
|
||||||
fpm)
|
|
||||||
source="sapi/fpm/php-fpm"
|
|
||||||
;;
|
|
||||||
embed)
|
|
||||||
source="libs/libphp${PHP_MV}$(get_libname)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled sapi in src_install"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ "${source}" == *"$(get_libname)" ]]; then
|
|
||||||
dolib.so "${source}" || die "Unable to install ${sapi} sapi"
|
|
||||||
else
|
|
||||||
dobin "${source}" || die "Unable to install ${sapi} sapi"
|
|
||||||
local name="$(basename ${source})"
|
|
||||||
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
php_install_ini "${sapi}"
|
|
||||||
|
|
||||||
# construct correct SAPI string for php-config
|
|
||||||
# thanks to ferringb for the bash voodoo
|
|
||||||
if [[ "${sapi}" == "apache2" ]]; then
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
|
||||||
else
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Installing opcache module
|
|
||||||
if use_if_iuse opcache ; then
|
|
||||||
dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install env.d files
|
|
||||||
newenvd "${FILESDIR}/20php5-envd" \
|
|
||||||
"20php${SLOT}"
|
|
||||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i \
|
|
||||||
"${ED}/etc/env.d/20php${SLOT}"
|
|
||||||
sed -e "s|php5|php${SLOT}|g" -i \
|
|
||||||
"${ED}/etc/env.d/20php${SLOT}"
|
|
||||||
|
|
||||||
# set php-config variable correctly (bug #278439)
|
|
||||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
|
||||||
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config"
|
|
||||||
|
|
||||||
if use fpm ; then
|
|
||||||
if use systemd; then
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service"
|
|
||||||
else
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
|
||||||
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
||||||
if [[ ! -x "${PHP_BIN}" ]] ; then
|
|
||||||
ewarn "Test phase requires USE=cli, skipping"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
|
|
||||||
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \
|
|
||||||
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}"
|
|
||||||
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null
|
|
||||||
done
|
|
||||||
|
|
||||||
local failed="$(find -name '*.out')"
|
|
||||||
if [[ ${failed} != "" ]] ; then
|
|
||||||
ewarn "The following test cases failed unexpectedly:"
|
|
||||||
for name in ${failed}; do
|
|
||||||
ewarn " ${name/.out/}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "No unexpected test failures, all fine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
|
||||||
local passed=""
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
[[ -f "${name}.diff" ]] && continue
|
|
||||||
passed="${passed} ${name}"
|
|
||||||
done
|
|
||||||
if [[ ${passed} != "" ]] ; then
|
|
||||||
einfo "The following test cases passed unexpectedly:"
|
|
||||||
for name in ${passed}; do
|
|
||||||
ewarn " ${passed}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "None of the known-to-fail tests passed, all fine"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Output some general info to the user
|
|
||||||
if use apache2 ; then
|
|
||||||
APACHE2_MOD_DEFINE="PHP"
|
|
||||||
APACHE2_MOD_CONF="70_mod_php" # provided by app-eselect/eselect-php
|
|
||||||
apache-module_pkg_postinst
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the symlinks for php
|
|
||||||
for m in ${SAPIS}; do
|
|
||||||
[[ ${m} == 'embed' ]] && continue;
|
|
||||||
if use $m ; then
|
|
||||||
local ci=$(eselect php show $m)
|
|
||||||
if [[ -z $ci ]]; then
|
|
||||||
eselect php set $m php${SLOT}
|
|
||||||
einfo "Switched ${m} to use php:${SLOT}"
|
|
||||||
einfo
|
|
||||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
|
||||||
elog "To switch $m to use php:${SLOT}, run"
|
|
||||||
elog " eselect php set $m php${SLOT}"
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order"
|
|
||||||
elog "to compile extensions for the ${SLOT} ABI"
|
|
||||||
elog
|
|
||||||
if ! use readline && use cli ; then
|
|
||||||
ewarn "Note that in order to use php interactivly, you need to enable"
|
|
||||||
ewarn "the readline USE flag or php -a will hang"
|
|
||||||
fi
|
|
||||||
elog
|
|
||||||
elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
|
|
||||||
elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
|
|
||||||
elog "'production' or 'development' in ${EPREFIX}/etc/make.conf"
|
|
||||||
elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}"
|
|
||||||
|
|
||||||
elog
|
|
||||||
elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
|
|
||||||
elog "https://www.gentoo.org/proj/en/php/php-upgrading.xml"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_prerm() {
|
|
||||||
eselect php cleanup
|
|
||||||
}
|
|
@ -1,784 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd
|
|
||||||
|
|
||||||
KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
|
|
||||||
function php_get_uri ()
|
|
||||||
{
|
|
||||||
case "${1}" in
|
|
||||||
"php-pre")
|
|
||||||
echo "http://downloads.php.net/dsp/${2}"
|
|
||||||
;;
|
|
||||||
"php")
|
|
||||||
echo "http://www.php.net/distributions/${2}"
|
|
||||||
;;
|
|
||||||
"olemarkus")
|
|
||||||
echo "https://dev.gentoo.org/~olemarkus/php/${2}"
|
|
||||||
;;
|
|
||||||
"gentoo")
|
|
||||||
echo "mirror://gentoo/${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled case in php_get_uri"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_MV="$(get_major_version)"
|
|
||||||
SLOT="$(get_version_component_range 1-2)"
|
|
||||||
|
|
||||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
||||||
# betas, ...) w/o changing the whole ebuild
|
|
||||||
PHP_PV="${PV/_rc/RC}"
|
|
||||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
|
||||||
PHP_PV="${PHP_PV/_beta/beta}"
|
|
||||||
PHP_RELEASE="php"
|
|
||||||
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
PHP_P="${PN}-${PHP_PV}"
|
|
||||||
|
|
||||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
||||||
|
|
||||||
PHP_FPM_CONF_VER="1"
|
|
||||||
|
|
||||||
SRC_URI="${PHP_SRC_URI}"
|
|
||||||
|
|
||||||
DESCRIPTION="The PHP language runtime engine"
|
|
||||||
HOMEPAGE="http://php.net/"
|
|
||||||
LICENSE="PHP-3"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PHP_P}"
|
|
||||||
|
|
||||||
# We can build the following SAPIs in the given order
|
|
||||||
SAPIS="embed cli cgi fpm apache2"
|
|
||||||
|
|
||||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
||||||
IUSE="${IUSE}
|
|
||||||
${SAPIS/cli/+cli}
|
|
||||||
threads"
|
|
||||||
|
|
||||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
|
||||||
crypt +ctype curl debug
|
|
||||||
enchant exif frontbase +fileinfo +filter firebird
|
|
||||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
|
||||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash
|
|
||||||
mssql mysql libmysqlclient mysqli nls
|
|
||||||
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
|
||||||
readline recode selinux +session sharedmem
|
|
||||||
+simplexml snmp soap sockets spell sqlite ssl
|
|
||||||
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
|
|
||||||
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
|
|
||||||
>=dev-libs/libpcre-8.32[unicode]
|
|
||||||
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
|
|
||||||
<www-servers/apache-2.4[threads=] ) )
|
|
||||||
berkdb? ( =sys-libs/db-4* )
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
||||||
cjk? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
||||||
curl? ( >=net-misc/curl-7.10.5 )
|
|
||||||
enchant? ( app-text/enchant )
|
|
||||||
exif? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
firebird? ( dev-db/firebird )
|
|
||||||
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
||||||
gmp? ( >=dev-libs/gmp-4.1.2 )
|
|
||||||
iconv? ( virtual/libiconv )
|
|
||||||
imap? ( virtual/imap-c-client[ssl=] )
|
|
||||||
intl? ( dev-libs/icu:= )
|
|
||||||
iodbc? ( dev-db/libiodbc )
|
|
||||||
kerberos? ( virtual/krb5 )
|
|
||||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
|
||||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
|
||||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
||||||
mssql? ( dev-db/freetds[mssql] )
|
|
||||||
libmysqlclient? (
|
|
||||||
mysql? ( virtual/mysql )
|
|
||||||
mysqli? ( >=virtual/mysql-4.1 )
|
|
||||||
)
|
|
||||||
nls? ( sys-devel/gettext )
|
|
||||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
||||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
||||||
postgres? ( dev-db/postgresql )
|
|
||||||
qdbm? ( dev-db/qdbm )
|
|
||||||
readline? ( sys-libs/readline )
|
|
||||||
recode? ( app-text/recode )
|
|
||||||
sharedmem? ( dev-libs/mm )
|
|
||||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
||||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
spell? ( >=app-text/aspell-0.50 )
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
|
|
||||||
ssl? ( >=dev-libs/openssl-0.9.7 )
|
|
||||||
sybase-ct? ( dev-db/freetds )
|
|
||||||
tidy? ( app-text/htmltidy )
|
|
||||||
truetype? (
|
|
||||||
=media-libs/freetype-2*
|
|
||||||
>=media-libs/t1lib-5.0.0
|
|
||||||
!gd? (
|
|
||||||
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
)
|
|
||||||
unicode? ( dev-libs/oniguruma )
|
|
||||||
vpx? ( media-libs/libvpx )
|
|
||||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
||||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xpm? (
|
|
||||||
x11-libs/libXpm
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0= sys-libs/zlib
|
|
||||||
)
|
|
||||||
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
||||||
zip? ( sys-libs/zlib )
|
|
||||||
zlib? ( sys-libs/zlib )
|
|
||||||
virtual/mta
|
|
||||||
"
|
|
||||||
|
|
||||||
php="=${CATEGORY}/${PF}"
|
|
||||||
|
|
||||||
REQUIRED_USE="
|
|
||||||
truetype? ( gd )
|
|
||||||
vpx? ( gd )
|
|
||||||
cjk? ( gd )
|
|
||||||
exif? ( gd )
|
|
||||||
|
|
||||||
xpm? ( gd )
|
|
||||||
gd? ( zlib )
|
|
||||||
simplexml? ( xml )
|
|
||||||
soap? ( xml )
|
|
||||||
wddx? ( xml )
|
|
||||||
xmlrpc? ( || ( xml iconv ) )
|
|
||||||
xmlreader? ( xml )
|
|
||||||
xslt? ( xml )
|
|
||||||
ldap-sasl? ( ldap )
|
|
||||||
mhash? ( hash )
|
|
||||||
phar? ( hash )
|
|
||||||
libmysqlclient? ( || (
|
|
||||||
mysql
|
|
||||||
mysqli
|
|
||||||
pdo
|
|
||||||
) )
|
|
||||||
|
|
||||||
qdbm? ( !gdbm )
|
|
||||||
readline? ( !libedit )
|
|
||||||
recode? ( !imap !mysql !mysqli )
|
|
||||||
sharedmem? ( !threads )
|
|
||||||
|
|
||||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
RDEPEND="${RDEPEND}
|
|
||||||
fpm? (
|
|
||||||
selinux? ( sec-policy/selinux-phpfpm )
|
|
||||||
systemd? ( sys-apps/systemd ) )"
|
|
||||||
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-devel/m4-1.4.3
|
|
||||||
>=sys-devel/libtool-1.5.18"
|
|
||||||
|
|
||||||
# Allow users to install production version if they want to
|
|
||||||
|
|
||||||
case "${PHP_INI_VERSION}" in
|
|
||||||
production|development)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PHP_INI_VERSION="development"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
|
||||||
PHP_INI_FILE="php.ini"
|
|
||||||
|
|
||||||
want_apache
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
depend.apache_pkg_setup
|
|
||||||
}
|
|
||||||
|
|
||||||
php_install_ini() {
|
|
||||||
local phpsapi="${1}"
|
|
||||||
|
|
||||||
# work out where we are installing the ini file
|
|
||||||
php_set_ini_dir "${phpsapi}"
|
|
||||||
|
|
||||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
|
||||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
|
|
||||||
|
|
||||||
# default to /tmp for save_path, bug #282768
|
|
||||||
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}"
|
|
||||||
|
|
||||||
# Set the extension dir
|
|
||||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
|
|
||||||
|
|
||||||
# Set the include path to point to where we want to find PEAR packages
|
|
||||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}"
|
|
||||||
|
|
||||||
dodir "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
|
||||||
|
|
||||||
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
elog
|
|
||||||
|
|
||||||
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
|
|
||||||
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
|
|
||||||
|
|
||||||
if use_if_iuse opcache; then
|
|
||||||
elog "Adding opcache to $PHP_EXT_INI_DIR"
|
|
||||||
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
|
|
||||||
dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SAPI-specific handling
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "fpm" ]] ; then
|
|
||||||
[[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0
|
|
||||||
einfo "Installing FPM CGI config file php-fpm.conf"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf
|
|
||||||
|
|
||||||
# Remove bogus /etc/php-fpm.conf.default (bug 359906)
|
|
||||||
[[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install PHP ini files into /usr/share/php
|
|
||||||
|
|
||||||
dodoc php.ini-development
|
|
||||||
dodoc php.ini-production
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
php_set_ini_dir() {
|
|
||||||
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
|
|
||||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
|
||||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
|
|
||||||
# ([empty session.save_path]/session_mm_[sapi][gid].sem)
|
|
||||||
# there is no easy way to circumvent that, all php calls during
|
|
||||||
# install use -n, so no php.ini file will be used.
|
|
||||||
# As such, this is the easiest way to get around
|
|
||||||
addpredict /session_mm_cli250.sem
|
|
||||||
addpredict /session_mm_cli0.sem
|
|
||||||
|
|
||||||
# Change PHP branding
|
|
||||||
# Get the alpha/beta/rc version
|
|
||||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
|
|
||||||
-i configure.in || die "Unable to change PHP branding"
|
|
||||||
|
|
||||||
# Patch PHP to show Gentoo as the server platform
|
|
||||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
|
||||||
-i configure.in || die "Failed to fix server platform name"
|
|
||||||
|
|
||||||
# Prevent PHP from activating the Apache config,
|
|
||||||
# as we will do that ourselves
|
|
||||||
sed -i \
|
|
||||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4
|
|
||||||
|
|
||||||
# Patch PHP to support heimdal instead of mit-krb5
|
|
||||||
if has_version "app-crypt/heimdal" ; then
|
|
||||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal libname"
|
|
||||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal crypt library reference"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Add user patches #357637
|
|
||||||
epatch_user
|
|
||||||
|
|
||||||
#force rebuilding aclocal.m4
|
|
||||||
rm aclocal.m4
|
|
||||||
eautoreconf
|
|
||||||
|
|
||||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
|
||||||
# http://bugs.php.net/bug.php?id=48795, bug #343481
|
|
||||||
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
||||||
|
|
||||||
# This is a global variable and should be in caps. It isn't because the
|
|
||||||
# phpconfutils eclass relies on exactly this name...
|
|
||||||
# for --with-libdir see bug #327025
|
|
||||||
my_conf="
|
|
||||||
--prefix="${PHP_DESTDIR}"
|
|
||||||
--mandir="${PHP_DESTDIR}"/man
|
|
||||||
--infodir="${PHP_DESTDIR}"/info
|
|
||||||
--libdir="${PHP_DESTDIR}"/lib
|
|
||||||
--with-libdir=$(get_libdir)
|
|
||||||
--without-pear
|
|
||||||
$(use_enable threads maintainer-zts)"
|
|
||||||
|
|
||||||
# extension USE flag shared
|
|
||||||
my_conf+="
|
|
||||||
$(use_enable bcmath bcmath )
|
|
||||||
$(use_with bzip2 bz2 "${EPREFIX}"/usr)
|
|
||||||
$(use_enable calendar calendar )
|
|
||||||
$(use_enable ctype ctype )
|
|
||||||
$(use_with curl curl "${EPREFIX}"/usr)
|
|
||||||
$(use_enable xml dom )
|
|
||||||
$(use_with enchant enchant "${EPREFIX}"/usr)
|
|
||||||
$(use_enable exif exif )
|
|
||||||
$(use_enable fileinfo fileinfo )
|
|
||||||
$(use_enable filter filter )
|
|
||||||
$(use_enable ftp ftp )
|
|
||||||
$(use_with nls gettext "${EPREFIX}"/usr)
|
|
||||||
$(use_with gmp gmp "${EPREFIX}"/usr)
|
|
||||||
$(use_enable hash hash )
|
|
||||||
$(use_with mhash mhash "${EPREFIX}"/usr)
|
|
||||||
$(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr))
|
|
||||||
$(use_enable intl intl )
|
|
||||||
$(use_enable ipv6 ipv6 )
|
|
||||||
$(use_enable json json )
|
|
||||||
$(use_with kerberos kerberos "${EPREFIX}"/usr)
|
|
||||||
$(use_enable xml libxml )
|
|
||||||
$(use_with xml libxml-dir "${EPREFIX}"/usr)
|
|
||||||
$(use_enable unicode mbstring )
|
|
||||||
$(use_with crypt mcrypt "${EPREFIX}"/usr)
|
|
||||||
$(use_with mssql mssql "${EPREFIX}"/usr)
|
|
||||||
$(use_with unicode onig "${EPREFIX}"/usr)
|
|
||||||
$(use_with ssl openssl "${EPREFIX}"/usr)
|
|
||||||
$(use_with ssl openssl-dir "${EPREFIX}"/usr)
|
|
||||||
$(use_enable pcntl pcntl )
|
|
||||||
$(use_enable phar phar )
|
|
||||||
$(use_enable pdo pdo )
|
|
||||||
$(use_enable opcache opcache )
|
|
||||||
$(use_with postgres pgsql "${EPREFIX}"/usr)
|
|
||||||
$(use_enable posix posix )
|
|
||||||
$(use_with spell pspell "${EPREFIX}"/usr)
|
|
||||||
$(use_with recode recode "${EPREFIX}"/usr)
|
|
||||||
$(use_enable simplexml simplexml )
|
|
||||||
$(use_enable sharedmem shmop )
|
|
||||||
$(use_with snmp snmp "${EPREFIX}"/usr)
|
|
||||||
$(use_enable soap soap )
|
|
||||||
$(use_enable sockets sockets )
|
|
||||||
$(use_with sqlite sqlite3 "${EPREFIX}"/usr)
|
|
||||||
$(use_with sybase-ct sybase-ct "${EPREFIX}"/usr)
|
|
||||||
$(use_enable sysvipc sysvmsg )
|
|
||||||
$(use_enable sysvipc sysvsem )
|
|
||||||
$(use_enable sysvipc sysvshm )
|
|
||||||
$(use_with systemd fpm-systemd)
|
|
||||||
$(use_with tidy tidy "${EPREFIX}"/usr)
|
|
||||||
$(use_enable tokenizer tokenizer )
|
|
||||||
$(use_enable wddx wddx )
|
|
||||||
$(use_enable xml xml )
|
|
||||||
$(use_enable xmlreader xmlreader )
|
|
||||||
$(use_enable xmlwriter xmlwriter )
|
|
||||||
$(use_with xmlrpc xmlrpc)
|
|
||||||
$(use_with xslt xsl "${EPREFIX}"/usr)
|
|
||||||
$(use_enable zip zip )
|
|
||||||
$(use_with zlib zlib "${EPREFIX}"/usr)
|
|
||||||
$(use_enable debug debug )"
|
|
||||||
|
|
||||||
# DBA support
|
|
||||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
|
||||||
|| use qdbm ; then
|
|
||||||
my_conf="${my_conf} --enable-dba${shared}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DBA drivers support
|
|
||||||
my_conf+="
|
|
||||||
$(use_with cdb cdb)
|
|
||||||
$(use_with berkdb db4 ${EPREFIX}/usr)
|
|
||||||
$(use_enable flatfile flatfile )
|
|
||||||
$(use_with gdbm gdbm ${EPREFIX}/usr)
|
|
||||||
$(use_enable inifile inifile )
|
|
||||||
$(use_with qdbm qdbm ${EPREFIX}/usr)"
|
|
||||||
|
|
||||||
# Support for the GD graphics library
|
|
||||||
my_conf+="
|
|
||||||
$(use_with truetype freetype-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with truetype t1lib ${EPREFIX}/usr)
|
|
||||||
$(use_enable cjk gd-jis-conv )
|
|
||||||
$(use_with gd jpeg-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with gd png-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with xpm xpm-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with vpx vpx-dir ${EPREFIX}/usr)"
|
|
||||||
# enable gd last, so configure can pick up the previous settings
|
|
||||||
my_conf+="
|
|
||||||
$(use_with gd gd)"
|
|
||||||
|
|
||||||
# IMAP support
|
|
||||||
if use imap ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with imap imap ${EPREFIX}/usr)
|
|
||||||
$(use_with ssl imap-ssl ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Interbase/firebird support
|
|
||||||
|
|
||||||
if use firebird ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with firebird interbase ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# LDAP support
|
|
||||||
if use ldap ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with ldap ldap ${EPREFIX}/usr)
|
|
||||||
$(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# MySQL support
|
|
||||||
local mysqllib="mysqlnd"
|
|
||||||
local mysqlilib="mysqlnd"
|
|
||||||
use libmysqlclient && mysqllib="${EPREFIX}/usr"
|
|
||||||
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
|
|
||||||
|
|
||||||
my_conf+=" $(use_with mysql mysql $mysqllib)"
|
|
||||||
my_conf+=" $(use_with mysqli mysqli $mysqlilib)"
|
|
||||||
|
|
||||||
local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)"
|
|
||||||
if use mysql ; then
|
|
||||||
my_conf+="${mysqlsock}"
|
|
||||||
elif use mysqli ; then
|
|
||||||
my_conf+="${mysqlsock}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ODBC support
|
|
||||||
if use odbc ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with odbc unixODBC ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if use iodbc ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with iodbc iodbc ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Oracle support
|
|
||||||
if use oci8-instant-client ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with oci8-instant-client oci8)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# PDO support
|
|
||||||
if use pdo ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with mssql pdo-dblib )
|
|
||||||
$(use_with mysql pdo-mysql ${mysqllib})
|
|
||||||
$(use_with postgres pdo-pgsql )
|
|
||||||
$(use_with sqlite pdo-sqlite ${EPREFIX}/usr)
|
|
||||||
$(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)"
|
|
||||||
if use oci8-instant-client ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with oci8-instant-client pdo-oci)"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readline/libedit support
|
|
||||||
my_conf+="
|
|
||||||
$(use_with readline readline ${EPREFIX}/usr)
|
|
||||||
$(use_with libedit libedit ${EPREFIX}/usr)"
|
|
||||||
|
|
||||||
# Session support
|
|
||||||
if use session ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with sharedmem mm ${EPREFIX}/usr)"
|
|
||||||
else
|
|
||||||
my_conf+="
|
|
||||||
$(use_enable session session )"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use pic for shared modules such as apache2's mod_php
|
|
||||||
my_conf="${my_conf} --with-pic"
|
|
||||||
|
|
||||||
# we use the system copy of pcre
|
|
||||||
# --with-pcre-regex affects ext/pcre
|
|
||||||
# --with-pcre-dir affects ext/filter and ext/zip
|
|
||||||
my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr"
|
|
||||||
|
|
||||||
# Catch CFLAGS problems
|
|
||||||
# Fixes bug #14067.
|
|
||||||
# Changed order to run it in reverse for bug #32022 and #12021.
|
|
||||||
replace-cpu-flags "k6*" "i586"
|
|
||||||
|
|
||||||
# Support user-passed configuration parameters
|
|
||||||
my_conf="${my_conf} ${EXTRA_ECONF:-}"
|
|
||||||
|
|
||||||
# Support the Apache2 extras, they must be set globally for all
|
|
||||||
# SAPIs to work correctly, especially for external PHP extensions
|
|
||||||
|
|
||||||
mkdir -p "${WORKDIR}/sapis-build"
|
|
||||||
for one_sapi in $SAPIS ; do
|
|
||||||
use "${one_sapi}" || continue
|
|
||||||
php_set_ini_dir "${one_sapi}"
|
|
||||||
|
|
||||||
cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
|
|
||||||
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
|
|
||||||
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
|
|
||||||
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
case "$sapi" in
|
|
||||||
cli|cgi|embed|fpm)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf="${sapi_conf} --enable-${sapi}"
|
|
||||||
else
|
|
||||||
sapi_conf="${sapi_conf} --disable-${sapi}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
apache2)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs"
|
|
||||||
else
|
|
||||||
sapi_conf="${sapi_conf} --without-apxs2"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
econf ${sapi_conf}
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
# snmp seems to run during src_compile, too (bug #324739)
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
for sapi in ${SAPIS} ; do
|
|
||||||
if use "${sapi}"; then
|
|
||||||
cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
|
||||||
emake || die "emake failed"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# see bug #324739 for what happens when we don't have that
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
|
|
||||||
# grab the first SAPI that got built and install common files from there
|
|
||||||
local first_sapi=""
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
if use $sapi ; then
|
|
||||||
first_sapi=$sapi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Makefile forgets to create this before trying to write to it...
|
|
||||||
dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
|
|
||||||
|
|
||||||
# Install php environment (without any sapis)
|
|
||||||
cd "${WORKDIR}/sapis-build/$first_sapi"
|
|
||||||
emake INSTALL_ROOT="${D}" \
|
|
||||||
install-build install-headers install-programs \
|
|
||||||
|| die "emake install failed"
|
|
||||||
|
|
||||||
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
|
|
||||||
|
|
||||||
# Create the directory where we'll put version-specific php scripts
|
|
||||||
keepdir /usr/share/php${PHP_MV}
|
|
||||||
|
|
||||||
local sapi="", file=""
|
|
||||||
local sapi_list=""
|
|
||||||
|
|
||||||
for sapi in ${SAPIS}; do
|
|
||||||
if use "${sapi}" ; then
|
|
||||||
einfo "Installing SAPI: ${sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${sapi}"
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "apache2" ]] ; then
|
|
||||||
# We're specifically not using emake install-sapi as libtool
|
|
||||||
# may cause unnecessary relink failures (see bug #351266)
|
|
||||||
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
|
|
||||||
newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)"
|
|
||||||
keepdir "/usr/$(get_libdir)/apache2/modules"
|
|
||||||
else
|
|
||||||
# needed each time, php_install_ini would reset it
|
|
||||||
local dest="${PHP_DESTDIR#${EPREFIX}}"
|
|
||||||
into "${dest}"
|
|
||||||
case "$sapi" in
|
|
||||||
cli)
|
|
||||||
source="sapi/cli/php"
|
|
||||||
;;
|
|
||||||
cgi)
|
|
||||||
source="sapi/cgi/php-cgi"
|
|
||||||
;;
|
|
||||||
fpm)
|
|
||||||
source="sapi/fpm/php-fpm"
|
|
||||||
;;
|
|
||||||
embed)
|
|
||||||
source="libs/libphp${PHP_MV}$(get_libname)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled sapi in src_install"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ "${source}" == *"$(get_libname)" ]]; then
|
|
||||||
dolib.so "${source}" || die "Unable to install ${sapi} sapi"
|
|
||||||
else
|
|
||||||
dobin "${source}" || die "Unable to install ${sapi} sapi"
|
|
||||||
local name="$(basename ${source})"
|
|
||||||
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
php_install_ini "${sapi}"
|
|
||||||
|
|
||||||
# construct correct SAPI string for php-config
|
|
||||||
# thanks to ferringb for the bash voodoo
|
|
||||||
if [[ "${sapi}" == "apache2" ]]; then
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
|
||||||
else
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Installing opcache module
|
|
||||||
if use_if_iuse opcache ; then
|
|
||||||
dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install env.d files
|
|
||||||
newenvd "${FILESDIR}/20php5-envd" \
|
|
||||||
"20php${SLOT}"
|
|
||||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i \
|
|
||||||
"${ED}/etc/env.d/20php${SLOT}"
|
|
||||||
sed -e "s|php5|php${SLOT}|g" -i \
|
|
||||||
"${ED}/etc/env.d/20php${SLOT}"
|
|
||||||
|
|
||||||
# set php-config variable correctly (bug #278439)
|
|
||||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
|
||||||
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config"
|
|
||||||
|
|
||||||
if use fpm ; then
|
|
||||||
if use systemd; then
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service"
|
|
||||||
else
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
|
||||||
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
||||||
if [[ ! -x "${PHP_BIN}" ]] ; then
|
|
||||||
ewarn "Test phase requires USE=cli, skipping"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
|
|
||||||
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \
|
|
||||||
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}"
|
|
||||||
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null
|
|
||||||
done
|
|
||||||
|
|
||||||
local failed="$(find -name '*.out')"
|
|
||||||
if [[ ${failed} != "" ]] ; then
|
|
||||||
ewarn "The following test cases failed unexpectedly:"
|
|
||||||
for name in ${failed}; do
|
|
||||||
ewarn " ${name/.out/}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "No unexpected test failures, all fine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
|
||||||
local passed=""
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
[[ -f "${name}.diff" ]] && continue
|
|
||||||
passed="${passed} ${name}"
|
|
||||||
done
|
|
||||||
if [[ ${passed} != "" ]] ; then
|
|
||||||
einfo "The following test cases passed unexpectedly:"
|
|
||||||
for name in ${passed}; do
|
|
||||||
ewarn " ${passed}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "None of the known-to-fail tests passed, all fine"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Output some general info to the user
|
|
||||||
if use apache2 ; then
|
|
||||||
APACHE2_MOD_DEFINE="PHP"
|
|
||||||
APACHE2_MOD_CONF="70_mod_php" # provided by app-eselect/eselect-php
|
|
||||||
apache-module_pkg_postinst
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the symlinks for php
|
|
||||||
for m in ${SAPIS}; do
|
|
||||||
[[ ${m} == 'embed' ]] && continue;
|
|
||||||
if use $m ; then
|
|
||||||
local ci=$(eselect php show $m)
|
|
||||||
if [[ -z $ci ]]; then
|
|
||||||
eselect php set $m php${SLOT}
|
|
||||||
einfo "Switched ${m} to use php:${SLOT}"
|
|
||||||
einfo
|
|
||||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
|
||||||
elog "To switch $m to use php:${SLOT}, run"
|
|
||||||
elog " eselect php set $m php${SLOT}"
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order"
|
|
||||||
elog "to compile extensions for the ${SLOT} ABI"
|
|
||||||
elog
|
|
||||||
if ! use readline && use cli ; then
|
|
||||||
ewarn "Note that in order to use php interactivly, you need to enable"
|
|
||||||
ewarn "the readline USE flag or php -a will hang"
|
|
||||||
fi
|
|
||||||
elog
|
|
||||||
elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
|
|
||||||
elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
|
|
||||||
elog "'production' or 'development' in ${EPREFIX}/etc/make.conf"
|
|
||||||
elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}"
|
|
||||||
|
|
||||||
elog
|
|
||||||
elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
|
|
||||||
elog "https://www.gentoo.org/proj/en/php/php-upgrading.xml"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_prerm() {
|
|
||||||
eselect php cleanup
|
|
||||||
}
|
|
@ -1,784 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd
|
|
||||||
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
|
|
||||||
function php_get_uri ()
|
|
||||||
{
|
|
||||||
case "${1}" in
|
|
||||||
"php-pre")
|
|
||||||
echo "http://downloads.php.net/dsp/${2}"
|
|
||||||
;;
|
|
||||||
"php")
|
|
||||||
echo "http://www.php.net/distributions/${2}"
|
|
||||||
;;
|
|
||||||
"olemarkus")
|
|
||||||
echo "https://dev.gentoo.org/~olemarkus/php/${2}"
|
|
||||||
;;
|
|
||||||
"gentoo")
|
|
||||||
echo "mirror://gentoo/${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled case in php_get_uri"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_MV="$(get_major_version)"
|
|
||||||
SLOT="$(get_version_component_range 1-2)"
|
|
||||||
|
|
||||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
||||||
# betas, ...) w/o changing the whole ebuild
|
|
||||||
PHP_PV="${PV/_rc/RC}"
|
|
||||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
|
||||||
PHP_PV="${PHP_PV/_beta/beta}"
|
|
||||||
PHP_RELEASE="php"
|
|
||||||
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
PHP_P="${PN}-${PHP_PV}"
|
|
||||||
|
|
||||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
||||||
|
|
||||||
PHP_FPM_CONF_VER="1"
|
|
||||||
|
|
||||||
SRC_URI="${PHP_SRC_URI}"
|
|
||||||
|
|
||||||
DESCRIPTION="The PHP language runtime engine"
|
|
||||||
HOMEPAGE="http://php.net/"
|
|
||||||
LICENSE="PHP-3"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PHP_P}"
|
|
||||||
|
|
||||||
# We can build the following SAPIs in the given order
|
|
||||||
SAPIS="embed cli cgi fpm apache2"
|
|
||||||
|
|
||||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
||||||
IUSE="${IUSE}
|
|
||||||
${SAPIS/cli/+cli}
|
|
||||||
threads"
|
|
||||||
|
|
||||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
|
||||||
crypt +ctype curl debug
|
|
||||||
enchant exif frontbase +fileinfo +filter firebird
|
|
||||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
|
||||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash
|
|
||||||
mssql mysql libmysqlclient mysqli nls
|
|
||||||
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
|
||||||
readline recode selinux +session sharedmem
|
|
||||||
+simplexml snmp soap sockets spell sqlite ssl
|
|
||||||
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
|
|
||||||
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
|
|
||||||
>=dev-libs/libpcre-8.32[unicode]
|
|
||||||
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
|
|
||||||
<www-servers/apache-2.4[threads=] ) )
|
|
||||||
berkdb? ( =sys-libs/db-4* )
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
||||||
cjk? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
||||||
curl? ( >=net-misc/curl-7.10.5 )
|
|
||||||
enchant? ( app-text/enchant )
|
|
||||||
exif? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
firebird? ( dev-db/firebird )
|
|
||||||
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
||||||
gmp? ( >=dev-libs/gmp-4.1.2 )
|
|
||||||
iconv? ( virtual/libiconv )
|
|
||||||
imap? ( virtual/imap-c-client[ssl=] )
|
|
||||||
intl? ( dev-libs/icu:= )
|
|
||||||
iodbc? ( dev-db/libiodbc )
|
|
||||||
kerberos? ( virtual/krb5 )
|
|
||||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
|
||||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
|
||||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
||||||
mssql? ( dev-db/freetds[mssql] )
|
|
||||||
libmysqlclient? (
|
|
||||||
mysql? ( virtual/mysql )
|
|
||||||
mysqli? ( >=virtual/mysql-4.1 )
|
|
||||||
)
|
|
||||||
nls? ( sys-devel/gettext )
|
|
||||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
||||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
||||||
postgres? ( dev-db/postgresql )
|
|
||||||
qdbm? ( dev-db/qdbm )
|
|
||||||
readline? ( sys-libs/readline )
|
|
||||||
recode? ( app-text/recode )
|
|
||||||
sharedmem? ( dev-libs/mm )
|
|
||||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
||||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
spell? ( >=app-text/aspell-0.50 )
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
|
|
||||||
ssl? ( >=dev-libs/openssl-0.9.7 )
|
|
||||||
sybase-ct? ( dev-db/freetds )
|
|
||||||
tidy? ( app-text/htmltidy )
|
|
||||||
truetype? (
|
|
||||||
=media-libs/freetype-2*
|
|
||||||
>=media-libs/t1lib-5.0.0
|
|
||||||
!gd? (
|
|
||||||
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
)
|
|
||||||
unicode? ( dev-libs/oniguruma )
|
|
||||||
vpx? ( media-libs/libvpx )
|
|
||||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
||||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xpm? (
|
|
||||||
x11-libs/libXpm
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0= sys-libs/zlib
|
|
||||||
)
|
|
||||||
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
||||||
zip? ( sys-libs/zlib )
|
|
||||||
zlib? ( sys-libs/zlib )
|
|
||||||
virtual/mta
|
|
||||||
"
|
|
||||||
|
|
||||||
php="=${CATEGORY}/${PF}"
|
|
||||||
|
|
||||||
REQUIRED_USE="
|
|
||||||
truetype? ( gd )
|
|
||||||
vpx? ( gd )
|
|
||||||
cjk? ( gd )
|
|
||||||
exif? ( gd )
|
|
||||||
|
|
||||||
xpm? ( gd )
|
|
||||||
gd? ( zlib )
|
|
||||||
simplexml? ( xml )
|
|
||||||
soap? ( xml )
|
|
||||||
wddx? ( xml )
|
|
||||||
xmlrpc? ( || ( xml iconv ) )
|
|
||||||
xmlreader? ( xml )
|
|
||||||
xslt? ( xml )
|
|
||||||
ldap-sasl? ( ldap )
|
|
||||||
mhash? ( hash )
|
|
||||||
phar? ( hash )
|
|
||||||
libmysqlclient? ( || (
|
|
||||||
mysql
|
|
||||||
mysqli
|
|
||||||
pdo
|
|
||||||
) )
|
|
||||||
|
|
||||||
qdbm? ( !gdbm )
|
|
||||||
readline? ( !libedit )
|
|
||||||
recode? ( !imap !mysql !mysqli )
|
|
||||||
sharedmem? ( !threads )
|
|
||||||
|
|
||||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
RDEPEND="${RDEPEND}
|
|
||||||
fpm? (
|
|
||||||
selinux? ( sec-policy/selinux-phpfpm )
|
|
||||||
systemd? ( sys-apps/systemd ) )"
|
|
||||||
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-devel/m4-1.4.3
|
|
||||||
>=sys-devel/libtool-1.5.18"
|
|
||||||
|
|
||||||
# Allow users to install production version if they want to
|
|
||||||
|
|
||||||
case "${PHP_INI_VERSION}" in
|
|
||||||
production|development)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PHP_INI_VERSION="development"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
|
||||||
PHP_INI_FILE="php.ini"
|
|
||||||
|
|
||||||
want_apache
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
depend.apache_pkg_setup
|
|
||||||
}
|
|
||||||
|
|
||||||
php_install_ini() {
|
|
||||||
local phpsapi="${1}"
|
|
||||||
|
|
||||||
# work out where we are installing the ini file
|
|
||||||
php_set_ini_dir "${phpsapi}"
|
|
||||||
|
|
||||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
|
||||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
|
|
||||||
|
|
||||||
# default to /tmp for save_path, bug #282768
|
|
||||||
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}"
|
|
||||||
|
|
||||||
# Set the extension dir
|
|
||||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
|
|
||||||
|
|
||||||
# Set the include path to point to where we want to find PEAR packages
|
|
||||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}"
|
|
||||||
|
|
||||||
dodir "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
|
||||||
|
|
||||||
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
elog
|
|
||||||
|
|
||||||
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
|
|
||||||
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
|
|
||||||
|
|
||||||
if use_if_iuse opcache; then
|
|
||||||
elog "Adding opcache to $PHP_EXT_INI_DIR"
|
|
||||||
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
|
|
||||||
dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SAPI-specific handling
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "fpm" ]] ; then
|
|
||||||
[[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0
|
|
||||||
einfo "Installing FPM CGI config file php-fpm.conf"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf
|
|
||||||
|
|
||||||
# Remove bogus /etc/php-fpm.conf.default (bug 359906)
|
|
||||||
[[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install PHP ini files into /usr/share/php
|
|
||||||
|
|
||||||
dodoc php.ini-development
|
|
||||||
dodoc php.ini-production
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
php_set_ini_dir() {
|
|
||||||
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
|
|
||||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
|
||||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
|
|
||||||
# ([empty session.save_path]/session_mm_[sapi][gid].sem)
|
|
||||||
# there is no easy way to circumvent that, all php calls during
|
|
||||||
# install use -n, so no php.ini file will be used.
|
|
||||||
# As such, this is the easiest way to get around
|
|
||||||
addpredict /session_mm_cli250.sem
|
|
||||||
addpredict /session_mm_cli0.sem
|
|
||||||
|
|
||||||
# Change PHP branding
|
|
||||||
# Get the alpha/beta/rc version
|
|
||||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
|
|
||||||
-i configure.in || die "Unable to change PHP branding"
|
|
||||||
|
|
||||||
# Patch PHP to show Gentoo as the server platform
|
|
||||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
|
||||||
-i configure.in || die "Failed to fix server platform name"
|
|
||||||
|
|
||||||
# Prevent PHP from activating the Apache config,
|
|
||||||
# as we will do that ourselves
|
|
||||||
sed -i \
|
|
||||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4
|
|
||||||
|
|
||||||
# Patch PHP to support heimdal instead of mit-krb5
|
|
||||||
if has_version "app-crypt/heimdal" ; then
|
|
||||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal libname"
|
|
||||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal crypt library reference"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Add user patches #357637
|
|
||||||
epatch_user
|
|
||||||
|
|
||||||
#force rebuilding aclocal.m4
|
|
||||||
rm aclocal.m4
|
|
||||||
eautoreconf
|
|
||||||
|
|
||||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
|
||||||
# http://bugs.php.net/bug.php?id=48795, bug #343481
|
|
||||||
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
||||||
|
|
||||||
# This is a global variable and should be in caps. It isn't because the
|
|
||||||
# phpconfutils eclass relies on exactly this name...
|
|
||||||
# for --with-libdir see bug #327025
|
|
||||||
my_conf="
|
|
||||||
--prefix="${PHP_DESTDIR}"
|
|
||||||
--mandir="${PHP_DESTDIR}"/man
|
|
||||||
--infodir="${PHP_DESTDIR}"/info
|
|
||||||
--libdir="${PHP_DESTDIR}"/lib
|
|
||||||
--with-libdir=$(get_libdir)
|
|
||||||
--without-pear
|
|
||||||
$(use_enable threads maintainer-zts)"
|
|
||||||
|
|
||||||
# extension USE flag shared
|
|
||||||
my_conf+="
|
|
||||||
$(use_enable bcmath bcmath )
|
|
||||||
$(use_with bzip2 bz2 "${EPREFIX}"/usr)
|
|
||||||
$(use_enable calendar calendar )
|
|
||||||
$(use_enable ctype ctype )
|
|
||||||
$(use_with curl curl "${EPREFIX}"/usr)
|
|
||||||
$(use_enable xml dom )
|
|
||||||
$(use_with enchant enchant "${EPREFIX}"/usr)
|
|
||||||
$(use_enable exif exif )
|
|
||||||
$(use_enable fileinfo fileinfo )
|
|
||||||
$(use_enable filter filter )
|
|
||||||
$(use_enable ftp ftp )
|
|
||||||
$(use_with nls gettext "${EPREFIX}"/usr)
|
|
||||||
$(use_with gmp gmp "${EPREFIX}"/usr)
|
|
||||||
$(use_enable hash hash )
|
|
||||||
$(use_with mhash mhash "${EPREFIX}"/usr)
|
|
||||||
$(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr))
|
|
||||||
$(use_enable intl intl )
|
|
||||||
$(use_enable ipv6 ipv6 )
|
|
||||||
$(use_enable json json )
|
|
||||||
$(use_with kerberos kerberos "${EPREFIX}"/usr)
|
|
||||||
$(use_enable xml libxml )
|
|
||||||
$(use_with xml libxml-dir "${EPREFIX}"/usr)
|
|
||||||
$(use_enable unicode mbstring )
|
|
||||||
$(use_with crypt mcrypt "${EPREFIX}"/usr)
|
|
||||||
$(use_with mssql mssql "${EPREFIX}"/usr)
|
|
||||||
$(use_with unicode onig "${EPREFIX}"/usr)
|
|
||||||
$(use_with ssl openssl "${EPREFIX}"/usr)
|
|
||||||
$(use_with ssl openssl-dir "${EPREFIX}"/usr)
|
|
||||||
$(use_enable pcntl pcntl )
|
|
||||||
$(use_enable phar phar )
|
|
||||||
$(use_enable pdo pdo )
|
|
||||||
$(use_enable opcache opcache )
|
|
||||||
$(use_with postgres pgsql "${EPREFIX}"/usr)
|
|
||||||
$(use_enable posix posix )
|
|
||||||
$(use_with spell pspell "${EPREFIX}"/usr)
|
|
||||||
$(use_with recode recode "${EPREFIX}"/usr)
|
|
||||||
$(use_enable simplexml simplexml )
|
|
||||||
$(use_enable sharedmem shmop )
|
|
||||||
$(use_with snmp snmp "${EPREFIX}"/usr)
|
|
||||||
$(use_enable soap soap )
|
|
||||||
$(use_enable sockets sockets )
|
|
||||||
$(use_with sqlite sqlite3 "${EPREFIX}"/usr)
|
|
||||||
$(use_with sybase-ct sybase-ct "${EPREFIX}"/usr)
|
|
||||||
$(use_enable sysvipc sysvmsg )
|
|
||||||
$(use_enable sysvipc sysvsem )
|
|
||||||
$(use_enable sysvipc sysvshm )
|
|
||||||
$(use_with systemd fpm-systemd)
|
|
||||||
$(use_with tidy tidy "${EPREFIX}"/usr)
|
|
||||||
$(use_enable tokenizer tokenizer )
|
|
||||||
$(use_enable wddx wddx )
|
|
||||||
$(use_enable xml xml )
|
|
||||||
$(use_enable xmlreader xmlreader )
|
|
||||||
$(use_enable xmlwriter xmlwriter )
|
|
||||||
$(use_with xmlrpc xmlrpc)
|
|
||||||
$(use_with xslt xsl "${EPREFIX}"/usr)
|
|
||||||
$(use_enable zip zip )
|
|
||||||
$(use_with zlib zlib "${EPREFIX}"/usr)
|
|
||||||
$(use_enable debug debug )"
|
|
||||||
|
|
||||||
# DBA support
|
|
||||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
|
||||||
|| use qdbm ; then
|
|
||||||
my_conf="${my_conf} --enable-dba${shared}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DBA drivers support
|
|
||||||
my_conf+="
|
|
||||||
$(use_with cdb cdb)
|
|
||||||
$(use_with berkdb db4 ${EPREFIX}/usr)
|
|
||||||
$(use_enable flatfile flatfile )
|
|
||||||
$(use_with gdbm gdbm ${EPREFIX}/usr)
|
|
||||||
$(use_enable inifile inifile )
|
|
||||||
$(use_with qdbm qdbm ${EPREFIX}/usr)"
|
|
||||||
|
|
||||||
# Support for the GD graphics library
|
|
||||||
my_conf+="
|
|
||||||
$(use_with truetype freetype-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with truetype t1lib ${EPREFIX}/usr)
|
|
||||||
$(use_enable cjk gd-jis-conv )
|
|
||||||
$(use_with gd jpeg-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with gd png-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with xpm xpm-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with vpx vpx-dir ${EPREFIX}/usr)"
|
|
||||||
# enable gd last, so configure can pick up the previous settings
|
|
||||||
my_conf+="
|
|
||||||
$(use_with gd gd)"
|
|
||||||
|
|
||||||
# IMAP support
|
|
||||||
if use imap ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with imap imap ${EPREFIX}/usr)
|
|
||||||
$(use_with ssl imap-ssl ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Interbase/firebird support
|
|
||||||
|
|
||||||
if use firebird ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with firebird interbase ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# LDAP support
|
|
||||||
if use ldap ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with ldap ldap ${EPREFIX}/usr)
|
|
||||||
$(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# MySQL support
|
|
||||||
local mysqllib="mysqlnd"
|
|
||||||
local mysqlilib="mysqlnd"
|
|
||||||
use libmysqlclient && mysqllib="${EPREFIX}/usr"
|
|
||||||
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
|
|
||||||
|
|
||||||
my_conf+=" $(use_with mysql mysql $mysqllib)"
|
|
||||||
my_conf+=" $(use_with mysqli mysqli $mysqlilib)"
|
|
||||||
|
|
||||||
local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)"
|
|
||||||
if use mysql ; then
|
|
||||||
my_conf+="${mysqlsock}"
|
|
||||||
elif use mysqli ; then
|
|
||||||
my_conf+="${mysqlsock}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ODBC support
|
|
||||||
if use odbc ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with odbc unixODBC ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if use iodbc ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with iodbc iodbc ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Oracle support
|
|
||||||
if use oci8-instant-client ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with oci8-instant-client oci8)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# PDO support
|
|
||||||
if use pdo ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with mssql pdo-dblib )
|
|
||||||
$(use_with mysql pdo-mysql ${mysqllib})
|
|
||||||
$(use_with postgres pdo-pgsql )
|
|
||||||
$(use_with sqlite pdo-sqlite ${EPREFIX}/usr)
|
|
||||||
$(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)"
|
|
||||||
if use oci8-instant-client ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with oci8-instant-client pdo-oci)"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readline/libedit support
|
|
||||||
my_conf+="
|
|
||||||
$(use_with readline readline ${EPREFIX}/usr)
|
|
||||||
$(use_with libedit libedit ${EPREFIX}/usr)"
|
|
||||||
|
|
||||||
# Session support
|
|
||||||
if use session ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with sharedmem mm ${EPREFIX}/usr)"
|
|
||||||
else
|
|
||||||
my_conf+="
|
|
||||||
$(use_enable session session )"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use pic for shared modules such as apache2's mod_php
|
|
||||||
my_conf="${my_conf} --with-pic"
|
|
||||||
|
|
||||||
# we use the system copy of pcre
|
|
||||||
# --with-pcre-regex affects ext/pcre
|
|
||||||
# --with-pcre-dir affects ext/filter and ext/zip
|
|
||||||
my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr"
|
|
||||||
|
|
||||||
# Catch CFLAGS problems
|
|
||||||
# Fixes bug #14067.
|
|
||||||
# Changed order to run it in reverse for bug #32022 and #12021.
|
|
||||||
replace-cpu-flags "k6*" "i586"
|
|
||||||
|
|
||||||
# Support user-passed configuration parameters
|
|
||||||
my_conf="${my_conf} ${EXTRA_ECONF:-}"
|
|
||||||
|
|
||||||
# Support the Apache2 extras, they must be set globally for all
|
|
||||||
# SAPIs to work correctly, especially for external PHP extensions
|
|
||||||
|
|
||||||
mkdir -p "${WORKDIR}/sapis-build"
|
|
||||||
for one_sapi in $SAPIS ; do
|
|
||||||
use "${one_sapi}" || continue
|
|
||||||
php_set_ini_dir "${one_sapi}"
|
|
||||||
|
|
||||||
cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
|
|
||||||
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
|
|
||||||
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
|
|
||||||
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
case "$sapi" in
|
|
||||||
cli|cgi|embed|fpm)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf="${sapi_conf} --enable-${sapi}"
|
|
||||||
else
|
|
||||||
sapi_conf="${sapi_conf} --disable-${sapi}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
apache2)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs"
|
|
||||||
else
|
|
||||||
sapi_conf="${sapi_conf} --without-apxs2"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
econf ${sapi_conf}
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
# snmp seems to run during src_compile, too (bug #324739)
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
for sapi in ${SAPIS} ; do
|
|
||||||
if use "${sapi}"; then
|
|
||||||
cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
|
||||||
emake || die "emake failed"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# see bug #324739 for what happens when we don't have that
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
|
|
||||||
# grab the first SAPI that got built and install common files from there
|
|
||||||
local first_sapi=""
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
if use $sapi ; then
|
|
||||||
first_sapi=$sapi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Makefile forgets to create this before trying to write to it...
|
|
||||||
dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
|
|
||||||
|
|
||||||
# Install php environment (without any sapis)
|
|
||||||
cd "${WORKDIR}/sapis-build/$first_sapi"
|
|
||||||
emake INSTALL_ROOT="${D}" \
|
|
||||||
install-build install-headers install-programs \
|
|
||||||
|| die "emake install failed"
|
|
||||||
|
|
||||||
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
|
|
||||||
|
|
||||||
# Create the directory where we'll put version-specific php scripts
|
|
||||||
keepdir /usr/share/php${PHP_MV}
|
|
||||||
|
|
||||||
local sapi="", file=""
|
|
||||||
local sapi_list=""
|
|
||||||
|
|
||||||
for sapi in ${SAPIS}; do
|
|
||||||
if use "${sapi}" ; then
|
|
||||||
einfo "Installing SAPI: ${sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${sapi}"
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "apache2" ]] ; then
|
|
||||||
# We're specifically not using emake install-sapi as libtool
|
|
||||||
# may cause unnecessary relink failures (see bug #351266)
|
|
||||||
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
|
|
||||||
newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)"
|
|
||||||
keepdir "/usr/$(get_libdir)/apache2/modules"
|
|
||||||
else
|
|
||||||
# needed each time, php_install_ini would reset it
|
|
||||||
local dest="${PHP_DESTDIR#${EPREFIX}}"
|
|
||||||
into "${dest}"
|
|
||||||
case "$sapi" in
|
|
||||||
cli)
|
|
||||||
source="sapi/cli/php"
|
|
||||||
;;
|
|
||||||
cgi)
|
|
||||||
source="sapi/cgi/php-cgi"
|
|
||||||
;;
|
|
||||||
fpm)
|
|
||||||
source="sapi/fpm/php-fpm"
|
|
||||||
;;
|
|
||||||
embed)
|
|
||||||
source="libs/libphp${PHP_MV}$(get_libname)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled sapi in src_install"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ "${source}" == *"$(get_libname)" ]]; then
|
|
||||||
dolib.so "${source}" || die "Unable to install ${sapi} sapi"
|
|
||||||
else
|
|
||||||
dobin "${source}" || die "Unable to install ${sapi} sapi"
|
|
||||||
local name="$(basename ${source})"
|
|
||||||
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
php_install_ini "${sapi}"
|
|
||||||
|
|
||||||
# construct correct SAPI string for php-config
|
|
||||||
# thanks to ferringb for the bash voodoo
|
|
||||||
if [[ "${sapi}" == "apache2" ]]; then
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
|
||||||
else
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Installing opcache module
|
|
||||||
if use_if_iuse opcache ; then
|
|
||||||
dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install env.d files
|
|
||||||
newenvd "${FILESDIR}/20php5-envd" \
|
|
||||||
"20php${SLOT}"
|
|
||||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i \
|
|
||||||
"${ED}/etc/env.d/20php${SLOT}"
|
|
||||||
sed -e "s|php5|php${SLOT}|g" -i \
|
|
||||||
"${ED}/etc/env.d/20php${SLOT}"
|
|
||||||
|
|
||||||
# set php-config variable correctly (bug #278439)
|
|
||||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
|
||||||
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config"
|
|
||||||
|
|
||||||
if use fpm ; then
|
|
||||||
if use systemd; then
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service"
|
|
||||||
else
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
|
||||||
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
||||||
if [[ ! -x "${PHP_BIN}" ]] ; then
|
|
||||||
ewarn "Test phase requires USE=cli, skipping"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
|
|
||||||
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \
|
|
||||||
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}"
|
|
||||||
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null
|
|
||||||
done
|
|
||||||
|
|
||||||
local failed="$(find -name '*.out')"
|
|
||||||
if [[ ${failed} != "" ]] ; then
|
|
||||||
ewarn "The following test cases failed unexpectedly:"
|
|
||||||
for name in ${failed}; do
|
|
||||||
ewarn " ${name/.out/}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "No unexpected test failures, all fine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
|
||||||
local passed=""
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
[[ -f "${name}.diff" ]] && continue
|
|
||||||
passed="${passed} ${name}"
|
|
||||||
done
|
|
||||||
if [[ ${passed} != "" ]] ; then
|
|
||||||
einfo "The following test cases passed unexpectedly:"
|
|
||||||
for name in ${passed}; do
|
|
||||||
ewarn " ${passed}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "None of the known-to-fail tests passed, all fine"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Output some general info to the user
|
|
||||||
if use apache2 ; then
|
|
||||||
APACHE2_MOD_DEFINE="PHP"
|
|
||||||
APACHE2_MOD_CONF="70_mod_php" # provided by app-eselect/eselect-php
|
|
||||||
apache-module_pkg_postinst
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the symlinks for php
|
|
||||||
for m in ${SAPIS}; do
|
|
||||||
[[ ${m} == 'embed' ]] && continue;
|
|
||||||
if use $m ; then
|
|
||||||
local ci=$(eselect php show $m)
|
|
||||||
if [[ -z $ci ]]; then
|
|
||||||
eselect php set $m php${SLOT}
|
|
||||||
einfo "Switched ${m} to use php:${SLOT}"
|
|
||||||
einfo
|
|
||||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
|
||||||
elog "To switch $m to use php:${SLOT}, run"
|
|
||||||
elog " eselect php set $m php${SLOT}"
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order"
|
|
||||||
elog "to compile extensions for the ${SLOT} ABI"
|
|
||||||
elog
|
|
||||||
if ! use readline && use cli ; then
|
|
||||||
ewarn "Note that in order to use php interactivly, you need to enable"
|
|
||||||
ewarn "the readline USE flag or php -a will hang"
|
|
||||||
fi
|
|
||||||
elog
|
|
||||||
elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
|
|
||||||
elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
|
|
||||||
elog "'production' or 'development' in ${EPREFIX}/etc/make.conf"
|
|
||||||
elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}"
|
|
||||||
|
|
||||||
elog
|
|
||||||
elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
|
|
||||||
elog "https://www.gentoo.org/proj/en/php/php-upgrading.xml"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_prerm() {
|
|
||||||
eselect php cleanup
|
|
||||||
}
|
|
@ -1,784 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd
|
|
||||||
|
|
||||||
KEYWORDS="alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
|
|
||||||
function php_get_uri ()
|
|
||||||
{
|
|
||||||
case "${1}" in
|
|
||||||
"php-pre")
|
|
||||||
echo "http://downloads.php.net/dsp/${2}"
|
|
||||||
;;
|
|
||||||
"php")
|
|
||||||
echo "http://www.php.net/distributions/${2}"
|
|
||||||
;;
|
|
||||||
"olemarkus")
|
|
||||||
echo "https://dev.gentoo.org/~olemarkus/php/${2}"
|
|
||||||
;;
|
|
||||||
"gentoo")
|
|
||||||
echo "mirror://gentoo/${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled case in php_get_uri"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_MV="$(get_major_version)"
|
|
||||||
SLOT="$(get_version_component_range 1-2)"
|
|
||||||
|
|
||||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
||||||
# betas, ...) w/o changing the whole ebuild
|
|
||||||
PHP_PV="${PV/_rc/RC}"
|
|
||||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
|
||||||
PHP_PV="${PHP_PV/_beta/beta}"
|
|
||||||
PHP_RELEASE="php"
|
|
||||||
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
PHP_P="${PN}-${PHP_PV}"
|
|
||||||
|
|
||||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
||||||
|
|
||||||
PHP_FPM_CONF_VER="1"
|
|
||||||
|
|
||||||
SRC_URI="${PHP_SRC_URI}"
|
|
||||||
|
|
||||||
DESCRIPTION="The PHP language runtime engine"
|
|
||||||
HOMEPAGE="http://php.net/"
|
|
||||||
LICENSE="PHP-3"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PHP_P}"
|
|
||||||
|
|
||||||
# We can build the following SAPIs in the given order
|
|
||||||
SAPIS="embed cli cgi fpm apache2"
|
|
||||||
|
|
||||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
||||||
IUSE="${IUSE}
|
|
||||||
${SAPIS/cli/+cli}
|
|
||||||
threads"
|
|
||||||
|
|
||||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
|
||||||
crypt +ctype curl debug
|
|
||||||
enchant exif frontbase +fileinfo +filter firebird
|
|
||||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
|
||||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash
|
|
||||||
mssql mysql libmysqlclient mysqli nls
|
|
||||||
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
|
||||||
readline recode selinux +session sharedmem
|
|
||||||
+simplexml snmp soap sockets spell sqlite ssl
|
|
||||||
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
|
|
||||||
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?]
|
|
||||||
>=dev-libs/libpcre-8.32[unicode]
|
|
||||||
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
|
|
||||||
<www-servers/apache-2.4[threads=] ) )
|
|
||||||
berkdb? ( =sys-libs/db-4* )
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
||||||
cjk? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
||||||
curl? ( >=net-misc/curl-7.10.5 )
|
|
||||||
enchant? ( app-text/enchant )
|
|
||||||
exif? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
firebird? ( dev-db/firebird )
|
|
||||||
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
||||||
gmp? ( >=dev-libs/gmp-4.1.2 )
|
|
||||||
iconv? ( virtual/libiconv )
|
|
||||||
imap? ( virtual/imap-c-client[ssl=] )
|
|
||||||
intl? ( dev-libs/icu:= )
|
|
||||||
iodbc? ( dev-db/libiodbc )
|
|
||||||
kerberos? ( virtual/krb5 )
|
|
||||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
|
||||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
|
||||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
||||||
mssql? ( dev-db/freetds[mssql] )
|
|
||||||
libmysqlclient? (
|
|
||||||
mysql? ( virtual/mysql )
|
|
||||||
mysqli? ( >=virtual/mysql-4.1 )
|
|
||||||
)
|
|
||||||
nls? ( sys-devel/gettext )
|
|
||||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
||||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
||||||
postgres? ( dev-db/postgresql )
|
|
||||||
qdbm? ( dev-db/qdbm )
|
|
||||||
readline? ( sys-libs/readline )
|
|
||||||
recode? ( app-text/recode )
|
|
||||||
sharedmem? ( dev-libs/mm )
|
|
||||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
||||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
spell? ( >=app-text/aspell-0.50 )
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
|
|
||||||
ssl? ( >=dev-libs/openssl-0.9.7 )
|
|
||||||
sybase-ct? ( dev-db/freetds )
|
|
||||||
tidy? ( app-text/htmltidy )
|
|
||||||
truetype? (
|
|
||||||
=media-libs/freetype-2*
|
|
||||||
>=media-libs/t1lib-5.0.0
|
|
||||||
!gd? (
|
|
||||||
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
)
|
|
||||||
unicode? ( dev-libs/oniguruma )
|
|
||||||
vpx? ( media-libs/libvpx )
|
|
||||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
||||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xpm? (
|
|
||||||
x11-libs/libXpm
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0= sys-libs/zlib
|
|
||||||
)
|
|
||||||
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
||||||
zip? ( sys-libs/zlib )
|
|
||||||
zlib? ( sys-libs/zlib )
|
|
||||||
virtual/mta
|
|
||||||
"
|
|
||||||
|
|
||||||
php="=${CATEGORY}/${PF}"
|
|
||||||
|
|
||||||
REQUIRED_USE="
|
|
||||||
truetype? ( gd )
|
|
||||||
vpx? ( gd )
|
|
||||||
cjk? ( gd )
|
|
||||||
exif? ( gd )
|
|
||||||
|
|
||||||
xpm? ( gd )
|
|
||||||
gd? ( zlib )
|
|
||||||
simplexml? ( xml )
|
|
||||||
soap? ( xml )
|
|
||||||
wddx? ( xml )
|
|
||||||
xmlrpc? ( || ( xml iconv ) )
|
|
||||||
xmlreader? ( xml )
|
|
||||||
xslt? ( xml )
|
|
||||||
ldap-sasl? ( ldap )
|
|
||||||
mhash? ( hash )
|
|
||||||
phar? ( hash )
|
|
||||||
libmysqlclient? ( || (
|
|
||||||
mysql
|
|
||||||
mysqli
|
|
||||||
pdo
|
|
||||||
) )
|
|
||||||
|
|
||||||
qdbm? ( !gdbm )
|
|
||||||
readline? ( !libedit )
|
|
||||||
recode? ( !imap !mysql !mysqli )
|
|
||||||
sharedmem? ( !threads )
|
|
||||||
|
|
||||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
RDEPEND="${RDEPEND}
|
|
||||||
fpm? (
|
|
||||||
selinux? ( sec-policy/selinux-phpfpm )
|
|
||||||
systemd? ( sys-apps/systemd ) )"
|
|
||||||
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-devel/m4-1.4.3
|
|
||||||
>=sys-devel/libtool-1.5.18"
|
|
||||||
|
|
||||||
# Allow users to install production version if they want to
|
|
||||||
|
|
||||||
case "${PHP_INI_VERSION}" in
|
|
||||||
production|development)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PHP_INI_VERSION="development"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
|
||||||
PHP_INI_FILE="php.ini"
|
|
||||||
|
|
||||||
want_apache
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
depend.apache_pkg_setup
|
|
||||||
}
|
|
||||||
|
|
||||||
php_install_ini() {
|
|
||||||
local phpsapi="${1}"
|
|
||||||
|
|
||||||
# work out where we are installing the ini file
|
|
||||||
php_set_ini_dir "${phpsapi}"
|
|
||||||
|
|
||||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
|
||||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
|
|
||||||
|
|
||||||
# default to /tmp for save_path, bug #282768
|
|
||||||
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}"
|
|
||||||
|
|
||||||
# Set the extension dir
|
|
||||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
|
|
||||||
|
|
||||||
# Set the include path to point to where we want to find PEAR packages
|
|
||||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}"
|
|
||||||
|
|
||||||
dodir "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
|
||||||
|
|
||||||
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
elog
|
|
||||||
|
|
||||||
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
|
|
||||||
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
|
|
||||||
|
|
||||||
if use_if_iuse opcache; then
|
|
||||||
elog "Adding opcache to $PHP_EXT_INI_DIR"
|
|
||||||
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
|
|
||||||
dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SAPI-specific handling
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "fpm" ]] ; then
|
|
||||||
[[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0
|
|
||||||
einfo "Installing FPM CGI config file php-fpm.conf"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf
|
|
||||||
|
|
||||||
# Remove bogus /etc/php-fpm.conf.default (bug 359906)
|
|
||||||
[[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install PHP ini files into /usr/share/php
|
|
||||||
|
|
||||||
dodoc php.ini-development
|
|
||||||
dodoc php.ini-production
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
php_set_ini_dir() {
|
|
||||||
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
|
|
||||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
|
||||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
|
|
||||||
# ([empty session.save_path]/session_mm_[sapi][gid].sem)
|
|
||||||
# there is no easy way to circumvent that, all php calls during
|
|
||||||
# install use -n, so no php.ini file will be used.
|
|
||||||
# As such, this is the easiest way to get around
|
|
||||||
addpredict /session_mm_cli250.sem
|
|
||||||
addpredict /session_mm_cli0.sem
|
|
||||||
|
|
||||||
# Change PHP branding
|
|
||||||
# Get the alpha/beta/rc version
|
|
||||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
|
|
||||||
-i configure.in || die "Unable to change PHP branding"
|
|
||||||
|
|
||||||
# Patch PHP to show Gentoo as the server platform
|
|
||||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
|
||||||
-i configure.in || die "Failed to fix server platform name"
|
|
||||||
|
|
||||||
# Prevent PHP from activating the Apache config,
|
|
||||||
# as we will do that ourselves
|
|
||||||
sed -i \
|
|
||||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4
|
|
||||||
|
|
||||||
# Patch PHP to support heimdal instead of mit-krb5
|
|
||||||
if has_version "app-crypt/heimdal" ; then
|
|
||||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal libname"
|
|
||||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal crypt library reference"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Add user patches #357637
|
|
||||||
epatch_user
|
|
||||||
|
|
||||||
#force rebuilding aclocal.m4
|
|
||||||
rm aclocal.m4
|
|
||||||
eautoreconf
|
|
||||||
|
|
||||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
|
||||||
# http://bugs.php.net/bug.php?id=48795, bug #343481
|
|
||||||
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
||||||
|
|
||||||
# This is a global variable and should be in caps. It isn't because the
|
|
||||||
# phpconfutils eclass relies on exactly this name...
|
|
||||||
# for --with-libdir see bug #327025
|
|
||||||
my_conf="
|
|
||||||
--prefix="${PHP_DESTDIR}"
|
|
||||||
--mandir="${PHP_DESTDIR}"/man
|
|
||||||
--infodir="${PHP_DESTDIR}"/info
|
|
||||||
--libdir="${PHP_DESTDIR}"/lib
|
|
||||||
--with-libdir=$(get_libdir)
|
|
||||||
--without-pear
|
|
||||||
$(use_enable threads maintainer-zts)"
|
|
||||||
|
|
||||||
# extension USE flag shared
|
|
||||||
my_conf+="
|
|
||||||
$(use_enable bcmath bcmath )
|
|
||||||
$(use_with bzip2 bz2 "${EPREFIX}"/usr)
|
|
||||||
$(use_enable calendar calendar )
|
|
||||||
$(use_enable ctype ctype )
|
|
||||||
$(use_with curl curl "${EPREFIX}"/usr)
|
|
||||||
$(use_enable xml dom )
|
|
||||||
$(use_with enchant enchant "${EPREFIX}"/usr)
|
|
||||||
$(use_enable exif exif )
|
|
||||||
$(use_enable fileinfo fileinfo )
|
|
||||||
$(use_enable filter filter )
|
|
||||||
$(use_enable ftp ftp )
|
|
||||||
$(use_with nls gettext "${EPREFIX}"/usr)
|
|
||||||
$(use_with gmp gmp "${EPREFIX}"/usr)
|
|
||||||
$(use_enable hash hash )
|
|
||||||
$(use_with mhash mhash "${EPREFIX}"/usr)
|
|
||||||
$(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr))
|
|
||||||
$(use_enable intl intl )
|
|
||||||
$(use_enable ipv6 ipv6 )
|
|
||||||
$(use_enable json json )
|
|
||||||
$(use_with kerberos kerberos "${EPREFIX}"/usr)
|
|
||||||
$(use_enable xml libxml )
|
|
||||||
$(use_with xml libxml-dir "${EPREFIX}"/usr)
|
|
||||||
$(use_enable unicode mbstring )
|
|
||||||
$(use_with crypt mcrypt "${EPREFIX}"/usr)
|
|
||||||
$(use_with mssql mssql "${EPREFIX}"/usr)
|
|
||||||
$(use_with unicode onig "${EPREFIX}"/usr)
|
|
||||||
$(use_with ssl openssl "${EPREFIX}"/usr)
|
|
||||||
$(use_with ssl openssl-dir "${EPREFIX}"/usr)
|
|
||||||
$(use_enable pcntl pcntl )
|
|
||||||
$(use_enable phar phar )
|
|
||||||
$(use_enable pdo pdo )
|
|
||||||
$(use_enable opcache opcache )
|
|
||||||
$(use_with postgres pgsql "${EPREFIX}"/usr)
|
|
||||||
$(use_enable posix posix )
|
|
||||||
$(use_with spell pspell "${EPREFIX}"/usr)
|
|
||||||
$(use_with recode recode "${EPREFIX}"/usr)
|
|
||||||
$(use_enable simplexml simplexml )
|
|
||||||
$(use_enable sharedmem shmop )
|
|
||||||
$(use_with snmp snmp "${EPREFIX}"/usr)
|
|
||||||
$(use_enable soap soap )
|
|
||||||
$(use_enable sockets sockets )
|
|
||||||
$(use_with sqlite sqlite3 "${EPREFIX}"/usr)
|
|
||||||
$(use_with sybase-ct sybase-ct "${EPREFIX}"/usr)
|
|
||||||
$(use_enable sysvipc sysvmsg )
|
|
||||||
$(use_enable sysvipc sysvsem )
|
|
||||||
$(use_enable sysvipc sysvshm )
|
|
||||||
$(use_with systemd fpm-systemd)
|
|
||||||
$(use_with tidy tidy "${EPREFIX}"/usr)
|
|
||||||
$(use_enable tokenizer tokenizer )
|
|
||||||
$(use_enable wddx wddx )
|
|
||||||
$(use_enable xml xml )
|
|
||||||
$(use_enable xmlreader xmlreader )
|
|
||||||
$(use_enable xmlwriter xmlwriter )
|
|
||||||
$(use_with xmlrpc xmlrpc)
|
|
||||||
$(use_with xslt xsl "${EPREFIX}"/usr)
|
|
||||||
$(use_enable zip zip )
|
|
||||||
$(use_with zlib zlib "${EPREFIX}"/usr)
|
|
||||||
$(use_enable debug debug )"
|
|
||||||
|
|
||||||
# DBA support
|
|
||||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
|
||||||
|| use qdbm ; then
|
|
||||||
my_conf="${my_conf} --enable-dba${shared}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DBA drivers support
|
|
||||||
my_conf+="
|
|
||||||
$(use_with cdb cdb)
|
|
||||||
$(use_with berkdb db4 ${EPREFIX}/usr)
|
|
||||||
$(use_enable flatfile flatfile )
|
|
||||||
$(use_with gdbm gdbm ${EPREFIX}/usr)
|
|
||||||
$(use_enable inifile inifile )
|
|
||||||
$(use_with qdbm qdbm ${EPREFIX}/usr)"
|
|
||||||
|
|
||||||
# Support for the GD graphics library
|
|
||||||
my_conf+="
|
|
||||||
$(use_with truetype freetype-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with truetype t1lib ${EPREFIX}/usr)
|
|
||||||
$(use_enable cjk gd-jis-conv )
|
|
||||||
$(use_with gd jpeg-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with gd png-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with xpm xpm-dir ${EPREFIX}/usr)
|
|
||||||
$(use_with vpx vpx-dir ${EPREFIX}/usr)"
|
|
||||||
# enable gd last, so configure can pick up the previous settings
|
|
||||||
my_conf+="
|
|
||||||
$(use_with gd gd)"
|
|
||||||
|
|
||||||
# IMAP support
|
|
||||||
if use imap ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with imap imap ${EPREFIX}/usr)
|
|
||||||
$(use_with ssl imap-ssl ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Interbase/firebird support
|
|
||||||
|
|
||||||
if use firebird ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with firebird interbase ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# LDAP support
|
|
||||||
if use ldap ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with ldap ldap ${EPREFIX}/usr)
|
|
||||||
$(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# MySQL support
|
|
||||||
local mysqllib="mysqlnd"
|
|
||||||
local mysqlilib="mysqlnd"
|
|
||||||
use libmysqlclient && mysqllib="${EPREFIX}/usr"
|
|
||||||
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
|
|
||||||
|
|
||||||
my_conf+=" $(use_with mysql mysql $mysqllib)"
|
|
||||||
my_conf+=" $(use_with mysqli mysqli $mysqlilib)"
|
|
||||||
|
|
||||||
local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)"
|
|
||||||
if use mysql ; then
|
|
||||||
my_conf+="${mysqlsock}"
|
|
||||||
elif use mysqli ; then
|
|
||||||
my_conf+="${mysqlsock}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ODBC support
|
|
||||||
if use odbc ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with odbc unixODBC ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if use iodbc ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with iodbc iodbc ${EPREFIX}/usr)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Oracle support
|
|
||||||
if use oci8-instant-client ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with oci8-instant-client oci8)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# PDO support
|
|
||||||
if use pdo ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with mssql pdo-dblib )
|
|
||||||
$(use_with mysql pdo-mysql ${mysqllib})
|
|
||||||
$(use_with postgres pdo-pgsql )
|
|
||||||
$(use_with sqlite pdo-sqlite ${EPREFIX}/usr)
|
|
||||||
$(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)"
|
|
||||||
if use oci8-instant-client ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with oci8-instant-client pdo-oci)"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readline/libedit support
|
|
||||||
my_conf+="
|
|
||||||
$(use_with readline readline ${EPREFIX}/usr)
|
|
||||||
$(use_with libedit libedit ${EPREFIX}/usr)"
|
|
||||||
|
|
||||||
# Session support
|
|
||||||
if use session ; then
|
|
||||||
my_conf+="
|
|
||||||
$(use_with sharedmem mm ${EPREFIX}/usr)"
|
|
||||||
else
|
|
||||||
my_conf+="
|
|
||||||
$(use_enable session session )"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use pic for shared modules such as apache2's mod_php
|
|
||||||
my_conf="${my_conf} --with-pic"
|
|
||||||
|
|
||||||
# we use the system copy of pcre
|
|
||||||
# --with-pcre-regex affects ext/pcre
|
|
||||||
# --with-pcre-dir affects ext/filter and ext/zip
|
|
||||||
my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr"
|
|
||||||
|
|
||||||
# Catch CFLAGS problems
|
|
||||||
# Fixes bug #14067.
|
|
||||||
# Changed order to run it in reverse for bug #32022 and #12021.
|
|
||||||
replace-cpu-flags "k6*" "i586"
|
|
||||||
|
|
||||||
# Support user-passed configuration parameters
|
|
||||||
my_conf="${my_conf} ${EXTRA_ECONF:-}"
|
|
||||||
|
|
||||||
# Support the Apache2 extras, they must be set globally for all
|
|
||||||
# SAPIs to work correctly, especially for external PHP extensions
|
|
||||||
|
|
||||||
mkdir -p "${WORKDIR}/sapis-build"
|
|
||||||
for one_sapi in $SAPIS ; do
|
|
||||||
use "${one_sapi}" || continue
|
|
||||||
php_set_ini_dir "${one_sapi}"
|
|
||||||
|
|
||||||
cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
|
|
||||||
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
|
|
||||||
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
|
|
||||||
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
case "$sapi" in
|
|
||||||
cli|cgi|embed|fpm)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf="${sapi_conf} --enable-${sapi}"
|
|
||||||
else
|
|
||||||
sapi_conf="${sapi_conf} --disable-${sapi}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
apache2)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs"
|
|
||||||
else
|
|
||||||
sapi_conf="${sapi_conf} --without-apxs2"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
econf ${sapi_conf}
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
# snmp seems to run during src_compile, too (bug #324739)
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
for sapi in ${SAPIS} ; do
|
|
||||||
if use "${sapi}"; then
|
|
||||||
cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
|
||||||
emake || die "emake failed"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# see bug #324739 for what happens when we don't have that
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
|
|
||||||
# grab the first SAPI that got built and install common files from there
|
|
||||||
local first_sapi=""
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
if use $sapi ; then
|
|
||||||
first_sapi=$sapi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Makefile forgets to create this before trying to write to it...
|
|
||||||
dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
|
|
||||||
|
|
||||||
# Install php environment (without any sapis)
|
|
||||||
cd "${WORKDIR}/sapis-build/$first_sapi"
|
|
||||||
emake INSTALL_ROOT="${D}" \
|
|
||||||
install-build install-headers install-programs \
|
|
||||||
|| die "emake install failed"
|
|
||||||
|
|
||||||
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
|
|
||||||
|
|
||||||
# Create the directory where we'll put version-specific php scripts
|
|
||||||
keepdir /usr/share/php${PHP_MV}
|
|
||||||
|
|
||||||
local sapi="", file=""
|
|
||||||
local sapi_list=""
|
|
||||||
|
|
||||||
for sapi in ${SAPIS}; do
|
|
||||||
if use "${sapi}" ; then
|
|
||||||
einfo "Installing SAPI: ${sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${sapi}"
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "apache2" ]] ; then
|
|
||||||
# We're specifically not using emake install-sapi as libtool
|
|
||||||
# may cause unnecessary relink failures (see bug #351266)
|
|
||||||
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
|
|
||||||
newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)"
|
|
||||||
keepdir "/usr/$(get_libdir)/apache2/modules"
|
|
||||||
else
|
|
||||||
# needed each time, php_install_ini would reset it
|
|
||||||
local dest="${PHP_DESTDIR#${EPREFIX}}"
|
|
||||||
into "${dest}"
|
|
||||||
case "$sapi" in
|
|
||||||
cli)
|
|
||||||
source="sapi/cli/php"
|
|
||||||
;;
|
|
||||||
cgi)
|
|
||||||
source="sapi/cgi/php-cgi"
|
|
||||||
;;
|
|
||||||
fpm)
|
|
||||||
source="sapi/fpm/php-fpm"
|
|
||||||
;;
|
|
||||||
embed)
|
|
||||||
source="libs/libphp${PHP_MV}$(get_libname)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled sapi in src_install"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ "${source}" == *"$(get_libname)" ]]; then
|
|
||||||
dolib.so "${source}" || die "Unable to install ${sapi} sapi"
|
|
||||||
else
|
|
||||||
dobin "${source}" || die "Unable to install ${sapi} sapi"
|
|
||||||
local name="$(basename ${source})"
|
|
||||||
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
php_install_ini "${sapi}"
|
|
||||||
|
|
||||||
# construct correct SAPI string for php-config
|
|
||||||
# thanks to ferringb for the bash voodoo
|
|
||||||
if [[ "${sapi}" == "apache2" ]]; then
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
|
||||||
else
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Installing opcache module
|
|
||||||
if use_if_iuse opcache ; then
|
|
||||||
dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install env.d files
|
|
||||||
newenvd "${FILESDIR}/20php5-envd" \
|
|
||||||
"20php${SLOT}"
|
|
||||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i \
|
|
||||||
"${ED}/etc/env.d/20php${SLOT}"
|
|
||||||
sed -e "s|php5|php${SLOT}|g" -i \
|
|
||||||
"${ED}/etc/env.d/20php${SLOT}"
|
|
||||||
|
|
||||||
# set php-config variable correctly (bug #278439)
|
|
||||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
|
||||||
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config"
|
|
||||||
|
|
||||||
if use fpm ; then
|
|
||||||
if use systemd; then
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service"
|
|
||||||
else
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
|
||||||
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
||||||
if [[ ! -x "${PHP_BIN}" ]] ; then
|
|
||||||
ewarn "Test phase requires USE=cli, skipping"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
|
|
||||||
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \
|
|
||||||
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}"
|
|
||||||
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null
|
|
||||||
done
|
|
||||||
|
|
||||||
local failed="$(find -name '*.out')"
|
|
||||||
if [[ ${failed} != "" ]] ; then
|
|
||||||
ewarn "The following test cases failed unexpectedly:"
|
|
||||||
for name in ${failed}; do
|
|
||||||
ewarn " ${name/.out/}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "No unexpected test failures, all fine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
|
||||||
local passed=""
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
[[ -f "${name}.diff" ]] && continue
|
|
||||||
passed="${passed} ${name}"
|
|
||||||
done
|
|
||||||
if [[ ${passed} != "" ]] ; then
|
|
||||||
einfo "The following test cases passed unexpectedly:"
|
|
||||||
for name in ${passed}; do
|
|
||||||
ewarn " ${passed}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "None of the known-to-fail tests passed, all fine"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Output some general info to the user
|
|
||||||
if use apache2 ; then
|
|
||||||
APACHE2_MOD_DEFINE="PHP"
|
|
||||||
APACHE2_MOD_CONF="70_mod_php" # provided by app-eselect/eselect-php
|
|
||||||
apache-module_pkg_postinst
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the symlinks for php
|
|
||||||
for m in ${SAPIS}; do
|
|
||||||
[[ ${m} == 'embed' ]] && continue;
|
|
||||||
if use $m ; then
|
|
||||||
local ci=$(eselect php show $m)
|
|
||||||
if [[ -z $ci ]]; then
|
|
||||||
eselect php set $m php${SLOT}
|
|
||||||
einfo "Switched ${m} to use php:${SLOT}"
|
|
||||||
einfo
|
|
||||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
|
||||||
elog "To switch $m to use php:${SLOT}, run"
|
|
||||||
elog " eselect php set $m php${SLOT}"
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order"
|
|
||||||
elog "to compile extensions for the ${SLOT} ABI"
|
|
||||||
elog
|
|
||||||
if ! use readline && use cli ; then
|
|
||||||
ewarn "Note that in order to use php interactivly, you need to enable"
|
|
||||||
ewarn "the readline USE flag or php -a will hang"
|
|
||||||
fi
|
|
||||||
elog
|
|
||||||
elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
|
|
||||||
elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
|
|
||||||
elog "'production' or 'development' in ${EPREFIX}/etc/make.conf"
|
|
||||||
elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}"
|
|
||||||
|
|
||||||
elog
|
|
||||||
elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
|
|
||||||
elog "https://www.gentoo.org/proj/en/php/php-upgrading.xml"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_prerm() {
|
|
||||||
eselect php cleanup
|
|
||||||
}
|
|
@ -1,807 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd
|
|
||||||
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
|
|
||||||
function php_get_uri ()
|
|
||||||
{
|
|
||||||
case "${1}" in
|
|
||||||
"php-pre")
|
|
||||||
echo "http://downloads.php.net/dsp/${2}"
|
|
||||||
;;
|
|
||||||
"php")
|
|
||||||
echo "http://www.php.net/distributions/${2}"
|
|
||||||
;;
|
|
||||||
"olemarkus")
|
|
||||||
echo "https://dev.gentoo.org/~olemarkus/php/${2}"
|
|
||||||
;;
|
|
||||||
"gentoo")
|
|
||||||
echo "mirror://gentoo/${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled case in php_get_uri"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_MV="$(get_major_version)"
|
|
||||||
SLOT="$(get_version_component_range 1-2)"
|
|
||||||
|
|
||||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
||||||
# betas, ...) w/o changing the whole ebuild
|
|
||||||
PHP_PV="${PV/_rc/RC}"
|
|
||||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
|
||||||
PHP_PV="${PHP_PV/_beta/beta}"
|
|
||||||
PHP_RELEASE="php"
|
|
||||||
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
PHP_P="${PN}-${PHP_PV}"
|
|
||||||
|
|
||||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
||||||
|
|
||||||
PHP_FPM_CONF_VER="1"
|
|
||||||
|
|
||||||
SRC_URI="${PHP_SRC_URI}"
|
|
||||||
|
|
||||||
DESCRIPTION="The PHP language runtime engine"
|
|
||||||
HOMEPAGE="http://php.net/"
|
|
||||||
LICENSE="PHP-3"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PHP_P}"
|
|
||||||
|
|
||||||
# We can build the following SAPIs in the given order
|
|
||||||
SAPIS="embed cli cgi fpm apache2"
|
|
||||||
|
|
||||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
||||||
IUSE="${IUSE}
|
|
||||||
${SAPIS/cli/+cli}
|
|
||||||
threads"
|
|
||||||
|
|
||||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
|
||||||
crypt +ctype curl debug
|
|
||||||
enchant exif frontbase +fileinfo +filter firebird
|
|
||||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
|
||||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
|
|
||||||
mhash mssql mysql libmysqlclient mysqli nls
|
|
||||||
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
|
||||||
readline recode selinux +session sharedmem
|
|
||||||
+simplexml snmp soap sockets spell sqlite ssl
|
|
||||||
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
|
|
||||||
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
|
|
||||||
>=dev-libs/libpcre-8.32[unicode]
|
|
||||||
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
|
|
||||||
<www-servers/apache-2.4[threads=] ) )"
|
|
||||||
|
|
||||||
# The supported (that is, autodetected) versions of BDB are listed in
|
|
||||||
# the ./configure script. Other versions *work*, but we need to stick to
|
|
||||||
# the ones that can be detected to avoid a repeat of bug #564824.
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
berkdb? ( || ( sys-libs/db:5.3
|
|
||||||
sys-libs/db:5.1
|
|
||||||
sys-libs/db:4.8
|
|
||||||
sys-libs/db:4.7
|
|
||||||
sys-libs/db:4.6
|
|
||||||
sys-libs/db:4.5 ) )
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
||||||
cjk? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
||||||
curl? ( >=net-misc/curl-7.10.5 )
|
|
||||||
enchant? ( app-text/enchant )
|
|
||||||
exif? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
firebird? ( dev-db/firebird )
|
|
||||||
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
||||||
gmp? ( dev-libs/gmp:0 )
|
|
||||||
iconv? ( virtual/libiconv )
|
|
||||||
imap? ( virtual/imap-c-client[ssl=] )
|
|
||||||
intl? ( dev-libs/icu:= )
|
|
||||||
iodbc? ( dev-db/libiodbc )
|
|
||||||
kerberos? ( virtual/krb5 )
|
|
||||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
|
||||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
|
||||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
||||||
mssql? ( dev-db/freetds[mssql] )
|
|
||||||
libmysqlclient? (
|
|
||||||
mysql? ( virtual/mysql )
|
|
||||||
mysqli? ( >=virtual/mysql-4.1 )
|
|
||||||
)
|
|
||||||
nls? ( sys-devel/gettext )
|
|
||||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
||||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
||||||
postgres? ( dev-db/postgresql:* )
|
|
||||||
qdbm? ( dev-db/qdbm )
|
|
||||||
readline? ( sys-libs/readline:0 )
|
|
||||||
recode? ( app-text/recode )
|
|
||||||
sharedmem? ( dev-libs/mm )
|
|
||||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
||||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
spell? ( >=app-text/aspell-0.50 )
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
|
|
||||||
ssl? (
|
|
||||||
!libressl? ( dev-libs/openssl:0 )
|
|
||||||
libressl? ( dev-libs/libressl )
|
|
||||||
)
|
|
||||||
sybase-ct? ( dev-db/freetds )
|
|
||||||
tidy? ( app-text/htmltidy )
|
|
||||||
truetype? (
|
|
||||||
=media-libs/freetype-2*
|
|
||||||
>=media-libs/t1lib-5.0.0
|
|
||||||
!gd? (
|
|
||||||
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
)
|
|
||||||
unicode? ( dev-libs/oniguruma )
|
|
||||||
vpx? ( media-libs/libvpx )
|
|
||||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
||||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xpm? (
|
|
||||||
x11-libs/libXpm
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0= sys-libs/zlib
|
|
||||||
)
|
|
||||||
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
||||||
zip? ( sys-libs/zlib )
|
|
||||||
zlib? ( sys-libs/zlib )
|
|
||||||
virtual/mta
|
|
||||||
"
|
|
||||||
|
|
||||||
php="=${CATEGORY}/${PF}"
|
|
||||||
|
|
||||||
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
|
|
||||||
REQUIRED_USE="
|
|
||||||
cli? ( ^^ ( readline libedit ) )
|
|
||||||
truetype? ( gd )
|
|
||||||
vpx? ( gd )
|
|
||||||
cjk? ( gd )
|
|
||||||
exif? ( gd )
|
|
||||||
|
|
||||||
xpm? ( gd )
|
|
||||||
gd? ( zlib )
|
|
||||||
simplexml? ( xml )
|
|
||||||
soap? ( xml )
|
|
||||||
wddx? ( xml )
|
|
||||||
xmlrpc? ( || ( xml iconv ) )
|
|
||||||
xmlreader? ( xml )
|
|
||||||
xslt? ( xml )
|
|
||||||
ldap-sasl? ( ldap )
|
|
||||||
mhash? ( hash )
|
|
||||||
phar? ( hash )
|
|
||||||
libmysqlclient? ( || (
|
|
||||||
mysql
|
|
||||||
mysqli
|
|
||||||
pdo
|
|
||||||
) )
|
|
||||||
|
|
||||||
qdbm? ( !gdbm )
|
|
||||||
readline? ( !libedit )
|
|
||||||
recode? ( !imap !mysql !mysqli )
|
|
||||||
sharedmem? ( !threads )
|
|
||||||
|
|
||||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
RDEPEND="${RDEPEND}
|
|
||||||
fpm? (
|
|
||||||
selinux? ( sec-policy/selinux-phpfpm )
|
|
||||||
systemd? ( sys-apps/systemd ) )"
|
|
||||||
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-devel/m4-1.4.3
|
|
||||||
>=sys-devel/libtool-1.5.18"
|
|
||||||
|
|
||||||
# Allow users to install production version if they want to
|
|
||||||
|
|
||||||
case "${PHP_INI_VERSION}" in
|
|
||||||
production|development)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PHP_INI_VERSION="development"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
|
||||||
PHP_INI_FILE="php.ini"
|
|
||||||
|
|
||||||
want_apache
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
depend.apache_pkg_setup
|
|
||||||
}
|
|
||||||
|
|
||||||
php_install_ini() {
|
|
||||||
local phpsapi="${1}"
|
|
||||||
|
|
||||||
# work out where we are installing the ini file
|
|
||||||
php_set_ini_dir "${phpsapi}"
|
|
||||||
|
|
||||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
|
||||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# default to /tmp for save_path, bug #282768
|
|
||||||
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# Set the extension dir
|
|
||||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# Set the include path to point to where we want to find PEAR packages
|
|
||||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
dodir "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
|
||||||
|
|
||||||
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
elog
|
|
||||||
|
|
||||||
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
|
|
||||||
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
|
|
||||||
|
|
||||||
if use_if_iuse opcache; then
|
|
||||||
elog "Adding opcache to $PHP_EXT_INI_DIR"
|
|
||||||
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
|
|
||||||
"${D}/${PHP_EXT_INI_DIR}"/opcache.ini
|
|
||||||
dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
|
|
||||||
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SAPI-specific handling
|
|
||||||
if [[ "${sapi}" == "fpm" ]] ; then
|
|
||||||
einfo "Installing FPM config file php-fpm.conf"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
doins sapi/fpm/php-fpm.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
dodoc php.ini-development
|
|
||||||
dodoc php.ini-production
|
|
||||||
}
|
|
||||||
|
|
||||||
php_set_ini_dir() {
|
|
||||||
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
|
|
||||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
|
||||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# Change PHP branding
|
|
||||||
# Get the alpha/beta/rc version
|
|
||||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
|
|
||||||
-i configure.in || die "Unable to change PHP branding"
|
|
||||||
|
|
||||||
# Patch PHP to show Gentoo as the server platform
|
|
||||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
|
||||||
-i configure.in || die "Failed to fix server platform name"
|
|
||||||
|
|
||||||
# Prevent PHP from activating the Apache config,
|
|
||||||
# as we will do that ourselves
|
|
||||||
sed -i \
|
|
||||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
|
|
||||||
|| die
|
|
||||||
|
|
||||||
# Patch PHP to support heimdal instead of mit-krb5
|
|
||||||
if has_version "app-crypt/heimdal" ; then
|
|
||||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal libname"
|
|
||||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal crypt library reference"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add user patches #357637
|
|
||||||
epatch_user
|
|
||||||
|
|
||||||
# Force rebuilding aclocal.m4
|
|
||||||
rm -f aclocal.m4 || die
|
|
||||||
eautoreconf
|
|
||||||
|
|
||||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
|
||||||
# http://bugs.php.net/bug.php?id=48795, bug #343481
|
|
||||||
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
||||||
|
|
||||||
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
|
|
||||||
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
|
|
||||||
local our_conf=(
|
|
||||||
--prefix="${PHP_DESTDIR}"
|
|
||||||
--mandir="${PHP_DESTDIR}/man"
|
|
||||||
--infodir="${PHP_DESTDIR}/info"
|
|
||||||
--libdir="${PHP_DESTDIR}/lib"
|
|
||||||
--with-libdir="$(get_libdir)"
|
|
||||||
--localstatedir="${EPREFIX}/var"
|
|
||||||
--without-pear
|
|
||||||
$(use_enable threads maintainer-zts)
|
|
||||||
)
|
|
||||||
|
|
||||||
our_conf+=(
|
|
||||||
$(use_enable bcmath bcmath)
|
|
||||||
$(use_with bzip2 bz2 "${EPREFIX}/usr")
|
|
||||||
$(use_enable calendar calendar)
|
|
||||||
$(use_enable ctype ctype)
|
|
||||||
$(use_with curl curl "${EPREFIX}/usr")
|
|
||||||
$(use_enable xml dom)
|
|
||||||
$(use_with enchant enchant "${EPREFIX}/usr")
|
|
||||||
$(use_enable exif exif)
|
|
||||||
$(use_enable fileinfo fileinfo)
|
|
||||||
$(use_enable filter filter)
|
|
||||||
$(use_enable ftp ftp)
|
|
||||||
$(use_with nls gettext "${EPREFIX}/usr")
|
|
||||||
$(use_with gmp gmp "${EPREFIX}/usr")
|
|
||||||
$(use_enable hash hash)
|
|
||||||
$(use_with mhash mhash "${EPREFIX}/usr")
|
|
||||||
$(use_with iconv iconv \
|
|
||||||
$(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
|
|
||||||
$(use_enable intl intl)
|
|
||||||
$(use_enable ipv6 ipv6)
|
|
||||||
$(use_enable json json)
|
|
||||||
$(use_with kerberos kerberos "${EPREFIX}/usr")
|
|
||||||
$(use_enable xml libxml)
|
|
||||||
$(use_with xml libxml-dir "${EPREFIX}/usr")
|
|
||||||
$(use_enable unicode mbstring)
|
|
||||||
$(use_with crypt mcrypt "${EPREFIX}/usr")
|
|
||||||
$(use_with mssql mssql "${EPREFIX}/usr")
|
|
||||||
$(use_with unicode onig "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl openssl "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl openssl-dir "${EPREFIX}/usr")
|
|
||||||
$(use_enable pcntl pcntl)
|
|
||||||
$(use_enable phar phar)
|
|
||||||
$(use_enable pdo pdo)
|
|
||||||
$(use_enable opcache opcache)
|
|
||||||
$(use_with postgres pgsql "${EPREFIX}/usr")
|
|
||||||
$(use_enable posix posix)
|
|
||||||
$(use_with spell pspell "${EPREFIX}/usr")
|
|
||||||
$(use_with recode recode "${EPREFIX}/usr")
|
|
||||||
$(use_enable simplexml simplexml)
|
|
||||||
$(use_enable sharedmem shmop)
|
|
||||||
$(use_with snmp snmp "${EPREFIX}/usr")
|
|
||||||
$(use_enable soap soap)
|
|
||||||
$(use_enable sockets sockets)
|
|
||||||
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
|
|
||||||
$(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
|
|
||||||
$(use_enable sysvipc sysvmsg)
|
|
||||||
$(use_enable sysvipc sysvsem)
|
|
||||||
$(use_enable sysvipc sysvshm)
|
|
||||||
$(use_with systemd fpm-systemd)
|
|
||||||
$(use_with tidy tidy "${EPREFIX}/usr")
|
|
||||||
$(use_enable tokenizer tokenizer)
|
|
||||||
$(use_enable wddx wddx)
|
|
||||||
$(use_enable xml xml)
|
|
||||||
$(use_enable xmlreader xmlreader)
|
|
||||||
$(use_enable xmlwriter xmlwriter)
|
|
||||||
$(use_with xmlrpc xmlrpc)
|
|
||||||
$(use_with xslt xsl "${EPREFIX}/usr")
|
|
||||||
$(use_enable zip zip)
|
|
||||||
$(use_with zlib zlib "${EPREFIX}/usr")
|
|
||||||
$(use_enable debug debug)
|
|
||||||
)
|
|
||||||
|
|
||||||
# DBA support
|
|
||||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
|
||||||
|| use qdbm ; then
|
|
||||||
our_conf+=( "--enable-dba${shared}" )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DBA drivers support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with cdb cdb)
|
|
||||||
$(use_with berkdb db4 "${EPREFIX}/usr")
|
|
||||||
$(use_enable flatfile flatfile)
|
|
||||||
$(use_with gdbm gdbm "${EPREFIX}/usr")
|
|
||||||
$(use_enable inifile inifile)
|
|
||||||
$(use_with qdbm qdbm "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Support for the GD graphics library
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with truetype freetype-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with truetype t1lib "${EPREFIX}/usr")
|
|
||||||
$(use_enable cjk gd-jis-conv)
|
|
||||||
$(use_with gd jpeg-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with gd png-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with xpm xpm-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with vpx vpx-dir "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
# enable gd last, so configure can pick up the previous settings
|
|
||||||
our_conf+=( $(use_with gd gd) )
|
|
||||||
|
|
||||||
# IMAP support
|
|
||||||
if use imap ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with imap imap "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl imap-ssl "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Interbase/firebird support
|
|
||||||
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
|
|
||||||
|
|
||||||
# LDAP support
|
|
||||||
if use ldap ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with ldap ldap "${EPREFIX}/usr")
|
|
||||||
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# MySQL support
|
|
||||||
local mysqllib="mysqlnd"
|
|
||||||
local mysqlilib="mysqlnd"
|
|
||||||
use libmysqlclient && mysqllib="${EPREFIX}/usr"
|
|
||||||
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
|
|
||||||
|
|
||||||
our_conf+=( $(use_with mysql mysql "${mysqllib}") )
|
|
||||||
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
|
|
||||||
|
|
||||||
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
|
|
||||||
if use mysql || use mysqli ; then
|
|
||||||
our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ODBC support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with odbc unixODBC "${EPREFIX}/usr")
|
|
||||||
$(use_with iodbc iodbc "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Oracle support
|
|
||||||
our_conf+=( $(use_with oci8-instant-client oci8) )
|
|
||||||
|
|
||||||
# PDO support
|
|
||||||
if use pdo ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with mssql pdo-dblib)
|
|
||||||
$(use_with mysql pdo-mysql "${mysqllib}")
|
|
||||||
$(use_with postgres pdo-pgsql)
|
|
||||||
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
|
|
||||||
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
|
|
||||||
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
|
|
||||||
$(use_with oci8-instant-client pdo-oci)
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readline/libedit support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with readline readline "${EPREFIX}/usr")
|
|
||||||
$(use_with libedit libedit "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Session support
|
|
||||||
if use session ; then
|
|
||||||
our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
|
|
||||||
else
|
|
||||||
our_conf+=( $(use_enable session session) )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use pic for shared modules such as apache2's mod_php
|
|
||||||
our_conf+=( --with-pic )
|
|
||||||
|
|
||||||
# we use the system copy of pcre
|
|
||||||
# --with-pcre-regex affects ext/pcre
|
|
||||||
# --with-pcre-dir affects ext/filter and ext/zip
|
|
||||||
our_conf+=(
|
|
||||||
--with-pcre-regex="${EPREFIX}/usr"
|
|
||||||
--with-pcre-dir="${EPREFIX}/usr"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Catch CFLAGS problems
|
|
||||||
# Fixes bug #14067.
|
|
||||||
# Changed order to run it in reverse for bug #32022 and #12021.
|
|
||||||
replace-cpu-flags "k6*" "i586"
|
|
||||||
|
|
||||||
# Support user-passed configuration parameters
|
|
||||||
our_conf+=( ${EXTRA_ECONF:-} )
|
|
||||||
|
|
||||||
# Support the Apache2 extras, they must be set globally for all
|
|
||||||
# SAPIs to work correctly, especially for external PHP extensions
|
|
||||||
|
|
||||||
mkdir -p "${WORKDIR}/sapis-build" || die
|
|
||||||
for one_sapi in $SAPIS ; do
|
|
||||||
use "${one_sapi}" || continue
|
|
||||||
php_set_ini_dir "${one_sapi}"
|
|
||||||
|
|
||||||
# The BUILD_DIR variable is used to determine where to output
|
|
||||||
# the files that autotools creates. This was all originally
|
|
||||||
# based on the autotools-utils eclass.
|
|
||||||
BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
cp -r "${S}" "${BUILD_DIR}" || die
|
|
||||||
cd "${BUILD_DIR}" || die
|
|
||||||
|
|
||||||
local sapi_conf=(
|
|
||||||
--with-config-file-path="${PHP_INI_DIR}"
|
|
||||||
--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
|
|
||||||
)
|
|
||||||
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
case "$sapi" in
|
|
||||||
cli|cgi|embed|fpm)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf+=( "--enable-${sapi}" )
|
|
||||||
else
|
|
||||||
sapi_conf+=( "--disable-${sapi}" )
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
apache2)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" )
|
|
||||||
else
|
|
||||||
sapi_conf+=( --without-apxs2 )
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Construct the $myeconfargs array by concatenating $our_conf
|
|
||||||
# (the common args) and $sapi_conf (the SAPI-specific args).
|
|
||||||
local myeconfargs=( "${our_conf[@]}" )
|
|
||||||
myeconfargs+=( "${sapi_conf[@]}" )
|
|
||||||
|
|
||||||
pushd "${BUILD_DIR}" > /dev/null || die
|
|
||||||
econf "${myeconfargs[@]}"
|
|
||||||
popd > /dev/null || die
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
# snmp seems to run during src_compile, too (bug #324739)
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
for sapi in ${SAPIS} ; do
|
|
||||||
if use "${sapi}"; then
|
|
||||||
cd "${WORKDIR}/sapis-build/$sapi" || \
|
|
||||||
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
|
||||||
emake
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# see bug #324739 for what happens when we don't have that
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
|
|
||||||
# grab the first SAPI that got built and install common files from there
|
|
||||||
local first_sapi=""
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
if use $sapi ; then
|
|
||||||
first_sapi=$sapi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Makefile forgets to create this before trying to write to it...
|
|
||||||
dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
|
|
||||||
|
|
||||||
# Install php environment (without any sapis)
|
|
||||||
cd "${WORKDIR}/sapis-build/$first_sapi" || die
|
|
||||||
emake INSTALL_ROOT="${D}" \
|
|
||||||
install-build install-headers install-programs
|
|
||||||
|
|
||||||
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
|
|
||||||
|
|
||||||
# Create the directory where we'll put version-specific php scripts
|
|
||||||
keepdir "/usr/share/php${PHP_MV}"
|
|
||||||
|
|
||||||
local sapi="", file=""
|
|
||||||
local sapi_list=""
|
|
||||||
|
|
||||||
for sapi in ${SAPIS}; do
|
|
||||||
if use "${sapi}" ; then
|
|
||||||
einfo "Installing SAPI: ${sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${sapi}" || die
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "apache2" ]] ; then
|
|
||||||
# We're specifically not using emake install-sapi as libtool
|
|
||||||
# may cause unnecessary relink failures (see bug #351266)
|
|
||||||
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
|
|
||||||
newins ".libs/libphp5$(get_libname)" \
|
|
||||||
"libphp${PHP_MV}$(get_libname)"
|
|
||||||
keepdir "/usr/$(get_libdir)/apache2/modules"
|
|
||||||
else
|
|
||||||
# needed each time, php_install_ini would reset it
|
|
||||||
local dest="${PHP_DESTDIR#${EPREFIX}}"
|
|
||||||
into "${dest}"
|
|
||||||
case "$sapi" in
|
|
||||||
cli)
|
|
||||||
source="sapi/cli/php"
|
|
||||||
;;
|
|
||||||
cgi)
|
|
||||||
source="sapi/cgi/php-cgi"
|
|
||||||
;;
|
|
||||||
fpm)
|
|
||||||
source="sapi/fpm/php-fpm"
|
|
||||||
;;
|
|
||||||
embed)
|
|
||||||
source="libs/libphp${PHP_MV}$(get_libname)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled sapi in src_install"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ "${source}" == *"$(get_libname)" ]]; then
|
|
||||||
dolib.so "${source}"
|
|
||||||
else
|
|
||||||
dobin "${source}"
|
|
||||||
local name="$(basename ${source})"
|
|
||||||
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
php_install_ini "${sapi}"
|
|
||||||
|
|
||||||
# construct correct SAPI string for php-config
|
|
||||||
# thanks to ferringb for the bash voodoo
|
|
||||||
if [[ "${sapi}" == "apache2" ]]; then
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
|
||||||
else
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Installing opcache module
|
|
||||||
if use_if_iuse opcache ; then
|
|
||||||
dolib.so "modules/opcache$(get_libname)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install env.d files
|
|
||||||
newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
|
|
||||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
|
|
||||||
sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
|
|
||||||
|
|
||||||
# set php-config variable correctly (bug #278439)
|
|
||||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
|
||||||
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
|
|
||||||
|
|
||||||
if use fpm ; then
|
|
||||||
if use systemd; then
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at.service" \
|
|
||||||
"php-fpm@${SLOT}.service"
|
|
||||||
else
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
|
|
||||||
"php-fpm@${SLOT}.service"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
|
||||||
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
||||||
if [[ ! -x "${PHP_BIN}" ]] ; then
|
|
||||||
ewarn "Test phase requires USE=cli, skipping"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
|
|
||||||
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
|
|
||||||
"session.save_path=${T}" \
|
|
||||||
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
|
|
||||||
"session.save_path=${T}"
|
|
||||||
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
|
|
||||||
done
|
|
||||||
|
|
||||||
local failed="$(find -name '*.out')"
|
|
||||||
if [[ ${failed} != "" ]] ; then
|
|
||||||
ewarn "The following test cases failed unexpectedly:"
|
|
||||||
for name in ${failed}; do
|
|
||||||
ewarn " ${name/.out/}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "No unexpected test failures, all fine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
|
||||||
local passed=""
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
[[ -f "${name}.diff" ]] && continue
|
|
||||||
passed="${passed} ${name}"
|
|
||||||
done
|
|
||||||
if [[ ${passed} != "" ]] ; then
|
|
||||||
einfo "The following test cases passed unexpectedly:"
|
|
||||||
for name in ${passed}; do
|
|
||||||
ewarn " ${passed}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "None of the known-to-fail tests passed, all fine"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Output some general info to the user
|
|
||||||
if use apache2 ; then
|
|
||||||
APACHE2_MOD_DEFINE="PHP"
|
|
||||||
APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php
|
|
||||||
apache-module_pkg_postinst
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the symlinks for php
|
|
||||||
for m in ${SAPIS}; do
|
|
||||||
[[ ${m} == 'embed' ]] && continue;
|
|
||||||
if use $m ; then
|
|
||||||
local ci=$(eselect php show $m)
|
|
||||||
if [[ -z $ci ]]; then
|
|
||||||
eselect php set $m php${SLOT} || die
|
|
||||||
einfo "Switched ${m} to use php:${SLOT}"
|
|
||||||
einfo
|
|
||||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
|
||||||
elog "To switch $m to use php:${SLOT}, run"
|
|
||||||
elog " eselect php set $m php${SLOT}"
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Remove dead symlinks for SAPIs that were just disabled. For
|
|
||||||
# example, if the user has the cgi SAPI enabled, then he has an
|
|
||||||
# eselect-php symlink for it. If he later reinstalls PHP with
|
|
||||||
# USE="-cgi", that symlink will break. This call to eselect is
|
|
||||||
# supposed to remove that dead link per bug 572436.
|
|
||||||
eselect php cleanup || die
|
|
||||||
|
|
||||||
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes"
|
|
||||||
elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI."
|
|
||||||
elog
|
|
||||||
elog "This ebuild installed a version of php.ini based on"
|
|
||||||
elog "php.ini-${PHP_INI_VERSION}. You can choose which version of"
|
|
||||||
elog "php.ini to install by default by setting PHP_INI_VERSION"
|
|
||||||
elog "to either 'production' or 'development' in your make.conf."
|
|
||||||
elog "Both versions of php.ini can be found with the PHP docs in"
|
|
||||||
elog "${EPREFIX}/usr/share/doc/${PF}"
|
|
||||||
elog
|
|
||||||
elog "For more details on how version slotting works, please see"
|
|
||||||
elog "the wiki:"
|
|
||||||
elog
|
|
||||||
elog " https://wiki.gentoo.org/wiki/PHP"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postrm() {
|
|
||||||
# This serves two purposes. First, if we have just removed the last
|
|
||||||
# installed version of PHP, then this will remove any dead symlinks
|
|
||||||
# belonging to eselect-php. Second, if a user upgrades slots from
|
|
||||||
# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
|
|
||||||
# his existing symlinks to point to the new 7.0 installation. The
|
|
||||||
# latter is bug 432962.
|
|
||||||
#
|
|
||||||
# Note: the eselect-php package may not be installed at this point,
|
|
||||||
# so we can't die() if this command fails.
|
|
||||||
eselect php cleanup
|
|
||||||
}
|
|
@ -1,807 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd
|
|
||||||
|
|
||||||
KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
|
|
||||||
function php_get_uri ()
|
|
||||||
{
|
|
||||||
case "${1}" in
|
|
||||||
"php-pre")
|
|
||||||
echo "http://downloads.php.net/dsp/${2}"
|
|
||||||
;;
|
|
||||||
"php")
|
|
||||||
echo "http://www.php.net/distributions/${2}"
|
|
||||||
;;
|
|
||||||
"olemarkus")
|
|
||||||
echo "https://dev.gentoo.org/~olemarkus/php/${2}"
|
|
||||||
;;
|
|
||||||
"gentoo")
|
|
||||||
echo "mirror://gentoo/${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled case in php_get_uri"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_MV="$(get_major_version)"
|
|
||||||
SLOT="$(get_version_component_range 1-2)"
|
|
||||||
|
|
||||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
||||||
# betas, ...) w/o changing the whole ebuild
|
|
||||||
PHP_PV="${PV/_rc/RC}"
|
|
||||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
|
||||||
PHP_PV="${PHP_PV/_beta/beta}"
|
|
||||||
PHP_RELEASE="php"
|
|
||||||
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
PHP_P="${PN}-${PHP_PV}"
|
|
||||||
|
|
||||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
||||||
|
|
||||||
PHP_FPM_CONF_VER="1"
|
|
||||||
|
|
||||||
SRC_URI="${PHP_SRC_URI}"
|
|
||||||
|
|
||||||
DESCRIPTION="The PHP language runtime engine"
|
|
||||||
HOMEPAGE="http://php.net/"
|
|
||||||
LICENSE="PHP-3"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PHP_P}"
|
|
||||||
|
|
||||||
# We can build the following SAPIs in the given order
|
|
||||||
SAPIS="embed cli cgi fpm apache2"
|
|
||||||
|
|
||||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
||||||
IUSE="${IUSE}
|
|
||||||
${SAPIS/cli/+cli}
|
|
||||||
threads"
|
|
||||||
|
|
||||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
|
||||||
crypt +ctype curl debug
|
|
||||||
enchant exif frontbase +fileinfo +filter firebird
|
|
||||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
|
||||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
|
|
||||||
mhash mssql mysql libmysqlclient mysqli nls
|
|
||||||
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
|
||||||
readline recode selinux +session sharedmem
|
|
||||||
+simplexml snmp soap sockets spell sqlite ssl
|
|
||||||
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
|
|
||||||
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
|
|
||||||
>=dev-libs/libpcre-8.32[unicode]
|
|
||||||
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
|
|
||||||
<www-servers/apache-2.4[threads=] ) )"
|
|
||||||
|
|
||||||
# The supported (that is, autodetected) versions of BDB are listed in
|
|
||||||
# the ./configure script. Other versions *work*, but we need to stick to
|
|
||||||
# the ones that can be detected to avoid a repeat of bug #564824.
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
berkdb? ( || ( sys-libs/db:5.3
|
|
||||||
sys-libs/db:5.1
|
|
||||||
sys-libs/db:4.8
|
|
||||||
sys-libs/db:4.7
|
|
||||||
sys-libs/db:4.6
|
|
||||||
sys-libs/db:4.5 ) )
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
||||||
cjk? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
||||||
curl? ( >=net-misc/curl-7.10.5 )
|
|
||||||
enchant? ( app-text/enchant )
|
|
||||||
exif? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
firebird? ( dev-db/firebird )
|
|
||||||
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
||||||
gmp? ( dev-libs/gmp:0 )
|
|
||||||
iconv? ( virtual/libiconv )
|
|
||||||
imap? ( virtual/imap-c-client[ssl=] )
|
|
||||||
intl? ( dev-libs/icu:= )
|
|
||||||
iodbc? ( dev-db/libiodbc )
|
|
||||||
kerberos? ( virtual/krb5 )
|
|
||||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
|
||||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
|
||||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
||||||
mssql? ( dev-db/freetds[mssql] )
|
|
||||||
libmysqlclient? (
|
|
||||||
mysql? ( virtual/mysql )
|
|
||||||
mysqli? ( >=virtual/mysql-4.1 )
|
|
||||||
)
|
|
||||||
nls? ( sys-devel/gettext )
|
|
||||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
||||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
||||||
postgres? ( dev-db/postgresql:* )
|
|
||||||
qdbm? ( dev-db/qdbm )
|
|
||||||
readline? ( sys-libs/readline:0 )
|
|
||||||
recode? ( app-text/recode )
|
|
||||||
sharedmem? ( dev-libs/mm )
|
|
||||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
||||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
spell? ( >=app-text/aspell-0.50 )
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
|
|
||||||
ssl? (
|
|
||||||
!libressl? ( dev-libs/openssl:0 )
|
|
||||||
libressl? ( dev-libs/libressl )
|
|
||||||
)
|
|
||||||
sybase-ct? ( dev-db/freetds )
|
|
||||||
tidy? ( app-text/htmltidy )
|
|
||||||
truetype? (
|
|
||||||
=media-libs/freetype-2*
|
|
||||||
>=media-libs/t1lib-5.0.0
|
|
||||||
!gd? (
|
|
||||||
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
)
|
|
||||||
unicode? ( dev-libs/oniguruma )
|
|
||||||
vpx? ( media-libs/libvpx )
|
|
||||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
||||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xpm? (
|
|
||||||
x11-libs/libXpm
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0= sys-libs/zlib
|
|
||||||
)
|
|
||||||
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
||||||
zip? ( sys-libs/zlib )
|
|
||||||
zlib? ( sys-libs/zlib )
|
|
||||||
virtual/mta
|
|
||||||
"
|
|
||||||
|
|
||||||
php="=${CATEGORY}/${PF}"
|
|
||||||
|
|
||||||
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
|
|
||||||
REQUIRED_USE="
|
|
||||||
cli? ( ^^ ( readline libedit ) )
|
|
||||||
truetype? ( gd )
|
|
||||||
vpx? ( gd )
|
|
||||||
cjk? ( gd )
|
|
||||||
exif? ( gd )
|
|
||||||
|
|
||||||
xpm? ( gd )
|
|
||||||
gd? ( zlib )
|
|
||||||
simplexml? ( xml )
|
|
||||||
soap? ( xml )
|
|
||||||
wddx? ( xml )
|
|
||||||
xmlrpc? ( || ( xml iconv ) )
|
|
||||||
xmlreader? ( xml )
|
|
||||||
xslt? ( xml )
|
|
||||||
ldap-sasl? ( ldap )
|
|
||||||
mhash? ( hash )
|
|
||||||
phar? ( hash )
|
|
||||||
libmysqlclient? ( || (
|
|
||||||
mysql
|
|
||||||
mysqli
|
|
||||||
pdo
|
|
||||||
) )
|
|
||||||
|
|
||||||
qdbm? ( !gdbm )
|
|
||||||
readline? ( !libedit )
|
|
||||||
recode? ( !imap !mysql !mysqli )
|
|
||||||
sharedmem? ( !threads )
|
|
||||||
|
|
||||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
RDEPEND="${RDEPEND}
|
|
||||||
fpm? (
|
|
||||||
selinux? ( sec-policy/selinux-phpfpm )
|
|
||||||
systemd? ( sys-apps/systemd ) )"
|
|
||||||
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-devel/m4-1.4.3
|
|
||||||
>=sys-devel/libtool-1.5.18"
|
|
||||||
|
|
||||||
# Allow users to install production version if they want to
|
|
||||||
|
|
||||||
case "${PHP_INI_VERSION}" in
|
|
||||||
production|development)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PHP_INI_VERSION="development"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
|
||||||
PHP_INI_FILE="php.ini"
|
|
||||||
|
|
||||||
want_apache
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
depend.apache_pkg_setup
|
|
||||||
}
|
|
||||||
|
|
||||||
php_install_ini() {
|
|
||||||
local phpsapi="${1}"
|
|
||||||
|
|
||||||
# work out where we are installing the ini file
|
|
||||||
php_set_ini_dir "${phpsapi}"
|
|
||||||
|
|
||||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
|
||||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# default to /tmp for save_path, bug #282768
|
|
||||||
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# Set the extension dir
|
|
||||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# Set the include path to point to where we want to find PEAR packages
|
|
||||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
dodir "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
|
||||||
|
|
||||||
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
elog
|
|
||||||
|
|
||||||
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
|
|
||||||
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
|
|
||||||
|
|
||||||
if use_if_iuse opcache; then
|
|
||||||
elog "Adding opcache to $PHP_EXT_INI_DIR"
|
|
||||||
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
|
|
||||||
"${D}/${PHP_EXT_INI_DIR}"/opcache.ini
|
|
||||||
dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
|
|
||||||
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SAPI-specific handling
|
|
||||||
if [[ "${sapi}" == "fpm" ]] ; then
|
|
||||||
einfo "Installing FPM config file php-fpm.conf"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
doins sapi/fpm/php-fpm.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
dodoc php.ini-development
|
|
||||||
dodoc php.ini-production
|
|
||||||
}
|
|
||||||
|
|
||||||
php_set_ini_dir() {
|
|
||||||
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
|
|
||||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
|
||||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# Change PHP branding
|
|
||||||
# Get the alpha/beta/rc version
|
|
||||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
|
|
||||||
-i configure.in || die "Unable to change PHP branding"
|
|
||||||
|
|
||||||
# Patch PHP to show Gentoo as the server platform
|
|
||||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
|
||||||
-i configure.in || die "Failed to fix server platform name"
|
|
||||||
|
|
||||||
# Prevent PHP from activating the Apache config,
|
|
||||||
# as we will do that ourselves
|
|
||||||
sed -i \
|
|
||||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
|
|
||||||
|| die
|
|
||||||
|
|
||||||
# Patch PHP to support heimdal instead of mit-krb5
|
|
||||||
if has_version "app-crypt/heimdal" ; then
|
|
||||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal libname"
|
|
||||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal crypt library reference"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add user patches #357637
|
|
||||||
epatch_user
|
|
||||||
|
|
||||||
# Force rebuilding aclocal.m4
|
|
||||||
rm -f aclocal.m4 || die
|
|
||||||
eautoreconf
|
|
||||||
|
|
||||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
|
||||||
# http://bugs.php.net/bug.php?id=48795, bug #343481
|
|
||||||
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
||||||
|
|
||||||
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
|
|
||||||
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
|
|
||||||
local our_conf=(
|
|
||||||
--prefix="${PHP_DESTDIR}"
|
|
||||||
--mandir="${PHP_DESTDIR}/man"
|
|
||||||
--infodir="${PHP_DESTDIR}/info"
|
|
||||||
--libdir="${PHP_DESTDIR}/lib"
|
|
||||||
--with-libdir="$(get_libdir)"
|
|
||||||
--localstatedir="${EPREFIX}/var"
|
|
||||||
--without-pear
|
|
||||||
$(use_enable threads maintainer-zts)
|
|
||||||
)
|
|
||||||
|
|
||||||
our_conf+=(
|
|
||||||
$(use_enable bcmath bcmath)
|
|
||||||
$(use_with bzip2 bz2 "${EPREFIX}/usr")
|
|
||||||
$(use_enable calendar calendar)
|
|
||||||
$(use_enable ctype ctype)
|
|
||||||
$(use_with curl curl "${EPREFIX}/usr")
|
|
||||||
$(use_enable xml dom)
|
|
||||||
$(use_with enchant enchant "${EPREFIX}/usr")
|
|
||||||
$(use_enable exif exif)
|
|
||||||
$(use_enable fileinfo fileinfo)
|
|
||||||
$(use_enable filter filter)
|
|
||||||
$(use_enable ftp ftp)
|
|
||||||
$(use_with nls gettext "${EPREFIX}/usr")
|
|
||||||
$(use_with gmp gmp "${EPREFIX}/usr")
|
|
||||||
$(use_enable hash hash)
|
|
||||||
$(use_with mhash mhash "${EPREFIX}/usr")
|
|
||||||
$(use_with iconv iconv \
|
|
||||||
$(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
|
|
||||||
$(use_enable intl intl)
|
|
||||||
$(use_enable ipv6 ipv6)
|
|
||||||
$(use_enable json json)
|
|
||||||
$(use_with kerberos kerberos "${EPREFIX}/usr")
|
|
||||||
$(use_enable xml libxml)
|
|
||||||
$(use_with xml libxml-dir "${EPREFIX}/usr")
|
|
||||||
$(use_enable unicode mbstring)
|
|
||||||
$(use_with crypt mcrypt "${EPREFIX}/usr")
|
|
||||||
$(use_with mssql mssql "${EPREFIX}/usr")
|
|
||||||
$(use_with unicode onig "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl openssl "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl openssl-dir "${EPREFIX}/usr")
|
|
||||||
$(use_enable pcntl pcntl)
|
|
||||||
$(use_enable phar phar)
|
|
||||||
$(use_enable pdo pdo)
|
|
||||||
$(use_enable opcache opcache)
|
|
||||||
$(use_with postgres pgsql "${EPREFIX}/usr")
|
|
||||||
$(use_enable posix posix)
|
|
||||||
$(use_with spell pspell "${EPREFIX}/usr")
|
|
||||||
$(use_with recode recode "${EPREFIX}/usr")
|
|
||||||
$(use_enable simplexml simplexml)
|
|
||||||
$(use_enable sharedmem shmop)
|
|
||||||
$(use_with snmp snmp "${EPREFIX}/usr")
|
|
||||||
$(use_enable soap soap)
|
|
||||||
$(use_enable sockets sockets)
|
|
||||||
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
|
|
||||||
$(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
|
|
||||||
$(use_enable sysvipc sysvmsg)
|
|
||||||
$(use_enable sysvipc sysvsem)
|
|
||||||
$(use_enable sysvipc sysvshm)
|
|
||||||
$(use_with systemd fpm-systemd)
|
|
||||||
$(use_with tidy tidy "${EPREFIX}/usr")
|
|
||||||
$(use_enable tokenizer tokenizer)
|
|
||||||
$(use_enable wddx wddx)
|
|
||||||
$(use_enable xml xml)
|
|
||||||
$(use_enable xmlreader xmlreader)
|
|
||||||
$(use_enable xmlwriter xmlwriter)
|
|
||||||
$(use_with xmlrpc xmlrpc)
|
|
||||||
$(use_with xslt xsl "${EPREFIX}/usr")
|
|
||||||
$(use_enable zip zip)
|
|
||||||
$(use_with zlib zlib "${EPREFIX}/usr")
|
|
||||||
$(use_enable debug debug)
|
|
||||||
)
|
|
||||||
|
|
||||||
# DBA support
|
|
||||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
|
||||||
|| use qdbm ; then
|
|
||||||
our_conf+=( "--enable-dba${shared}" )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DBA drivers support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with cdb cdb)
|
|
||||||
$(use_with berkdb db4 "${EPREFIX}/usr")
|
|
||||||
$(use_enable flatfile flatfile)
|
|
||||||
$(use_with gdbm gdbm "${EPREFIX}/usr")
|
|
||||||
$(use_enable inifile inifile)
|
|
||||||
$(use_with qdbm qdbm "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Support for the GD graphics library
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with truetype freetype-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with truetype t1lib "${EPREFIX}/usr")
|
|
||||||
$(use_enable cjk gd-jis-conv)
|
|
||||||
$(use_with gd jpeg-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with gd png-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with xpm xpm-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with vpx vpx-dir "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
# enable gd last, so configure can pick up the previous settings
|
|
||||||
our_conf+=( $(use_with gd gd) )
|
|
||||||
|
|
||||||
# IMAP support
|
|
||||||
if use imap ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with imap imap "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl imap-ssl "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Interbase/firebird support
|
|
||||||
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
|
|
||||||
|
|
||||||
# LDAP support
|
|
||||||
if use ldap ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with ldap ldap "${EPREFIX}/usr")
|
|
||||||
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# MySQL support
|
|
||||||
local mysqllib="mysqlnd"
|
|
||||||
local mysqlilib="mysqlnd"
|
|
||||||
use libmysqlclient && mysqllib="${EPREFIX}/usr"
|
|
||||||
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
|
|
||||||
|
|
||||||
our_conf+=( $(use_with mysql mysql "${mysqllib}") )
|
|
||||||
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
|
|
||||||
|
|
||||||
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
|
|
||||||
if use mysql || use mysqli ; then
|
|
||||||
our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ODBC support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with odbc unixODBC "${EPREFIX}/usr")
|
|
||||||
$(use_with iodbc iodbc "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Oracle support
|
|
||||||
our_conf+=( $(use_with oci8-instant-client oci8) )
|
|
||||||
|
|
||||||
# PDO support
|
|
||||||
if use pdo ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with mssql pdo-dblib)
|
|
||||||
$(use_with mysql pdo-mysql "${mysqllib}")
|
|
||||||
$(use_with postgres pdo-pgsql)
|
|
||||||
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
|
|
||||||
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
|
|
||||||
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
|
|
||||||
$(use_with oci8-instant-client pdo-oci)
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readline/libedit support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with readline readline "${EPREFIX}/usr")
|
|
||||||
$(use_with libedit libedit "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Session support
|
|
||||||
if use session ; then
|
|
||||||
our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
|
|
||||||
else
|
|
||||||
our_conf+=( $(use_enable session session) )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use pic for shared modules such as apache2's mod_php
|
|
||||||
our_conf+=( --with-pic )
|
|
||||||
|
|
||||||
# we use the system copy of pcre
|
|
||||||
# --with-pcre-regex affects ext/pcre
|
|
||||||
# --with-pcre-dir affects ext/filter and ext/zip
|
|
||||||
our_conf+=(
|
|
||||||
--with-pcre-regex="${EPREFIX}/usr"
|
|
||||||
--with-pcre-dir="${EPREFIX}/usr"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Catch CFLAGS problems
|
|
||||||
# Fixes bug #14067.
|
|
||||||
# Changed order to run it in reverse for bug #32022 and #12021.
|
|
||||||
replace-cpu-flags "k6*" "i586"
|
|
||||||
|
|
||||||
# Support user-passed configuration parameters
|
|
||||||
our_conf+=( ${EXTRA_ECONF:-} )
|
|
||||||
|
|
||||||
# Support the Apache2 extras, they must be set globally for all
|
|
||||||
# SAPIs to work correctly, especially for external PHP extensions
|
|
||||||
|
|
||||||
mkdir -p "${WORKDIR}/sapis-build" || die
|
|
||||||
for one_sapi in $SAPIS ; do
|
|
||||||
use "${one_sapi}" || continue
|
|
||||||
php_set_ini_dir "${one_sapi}"
|
|
||||||
|
|
||||||
# The BUILD_DIR variable is used to determine where to output
|
|
||||||
# the files that autotools creates. This was all originally
|
|
||||||
# based on the autotools-utils eclass.
|
|
||||||
BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
cp -r "${S}" "${BUILD_DIR}" || die
|
|
||||||
cd "${BUILD_DIR}" || die
|
|
||||||
|
|
||||||
local sapi_conf=(
|
|
||||||
--with-config-file-path="${PHP_INI_DIR}"
|
|
||||||
--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
|
|
||||||
)
|
|
||||||
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
case "$sapi" in
|
|
||||||
cli|cgi|embed|fpm)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf+=( "--enable-${sapi}" )
|
|
||||||
else
|
|
||||||
sapi_conf+=( "--disable-${sapi}" )
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
apache2)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" )
|
|
||||||
else
|
|
||||||
sapi_conf+=( --without-apxs2 )
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Construct the $myeconfargs array by concatenating $our_conf
|
|
||||||
# (the common args) and $sapi_conf (the SAPI-specific args).
|
|
||||||
local myeconfargs=( "${our_conf[@]}" )
|
|
||||||
myeconfargs+=( "${sapi_conf[@]}" )
|
|
||||||
|
|
||||||
pushd "${BUILD_DIR}" > /dev/null || die
|
|
||||||
econf "${myeconfargs[@]}"
|
|
||||||
popd > /dev/null || die
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
# snmp seems to run during src_compile, too (bug #324739)
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
for sapi in ${SAPIS} ; do
|
|
||||||
if use "${sapi}"; then
|
|
||||||
cd "${WORKDIR}/sapis-build/$sapi" || \
|
|
||||||
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
|
||||||
emake
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# see bug #324739 for what happens when we don't have that
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
|
|
||||||
# grab the first SAPI that got built and install common files from there
|
|
||||||
local first_sapi=""
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
if use $sapi ; then
|
|
||||||
first_sapi=$sapi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Makefile forgets to create this before trying to write to it...
|
|
||||||
dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
|
|
||||||
|
|
||||||
# Install php environment (without any sapis)
|
|
||||||
cd "${WORKDIR}/sapis-build/$first_sapi" || die
|
|
||||||
emake INSTALL_ROOT="${D}" \
|
|
||||||
install-build install-headers install-programs
|
|
||||||
|
|
||||||
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
|
|
||||||
|
|
||||||
# Create the directory where we'll put version-specific php scripts
|
|
||||||
keepdir "/usr/share/php${PHP_MV}"
|
|
||||||
|
|
||||||
local sapi="", file=""
|
|
||||||
local sapi_list=""
|
|
||||||
|
|
||||||
for sapi in ${SAPIS}; do
|
|
||||||
if use "${sapi}" ; then
|
|
||||||
einfo "Installing SAPI: ${sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${sapi}" || die
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "apache2" ]] ; then
|
|
||||||
# We're specifically not using emake install-sapi as libtool
|
|
||||||
# may cause unnecessary relink failures (see bug #351266)
|
|
||||||
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
|
|
||||||
newins ".libs/libphp5$(get_libname)" \
|
|
||||||
"libphp${PHP_MV}$(get_libname)"
|
|
||||||
keepdir "/usr/$(get_libdir)/apache2/modules"
|
|
||||||
else
|
|
||||||
# needed each time, php_install_ini would reset it
|
|
||||||
local dest="${PHP_DESTDIR#${EPREFIX}}"
|
|
||||||
into "${dest}"
|
|
||||||
case "$sapi" in
|
|
||||||
cli)
|
|
||||||
source="sapi/cli/php"
|
|
||||||
;;
|
|
||||||
cgi)
|
|
||||||
source="sapi/cgi/php-cgi"
|
|
||||||
;;
|
|
||||||
fpm)
|
|
||||||
source="sapi/fpm/php-fpm"
|
|
||||||
;;
|
|
||||||
embed)
|
|
||||||
source="libs/libphp${PHP_MV}$(get_libname)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled sapi in src_install"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ "${source}" == *"$(get_libname)" ]]; then
|
|
||||||
dolib.so "${source}"
|
|
||||||
else
|
|
||||||
dobin "${source}"
|
|
||||||
local name="$(basename ${source})"
|
|
||||||
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
php_install_ini "${sapi}"
|
|
||||||
|
|
||||||
# construct correct SAPI string for php-config
|
|
||||||
# thanks to ferringb for the bash voodoo
|
|
||||||
if [[ "${sapi}" == "apache2" ]]; then
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
|
||||||
else
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Installing opcache module
|
|
||||||
if use_if_iuse opcache ; then
|
|
||||||
dolib.so "modules/opcache$(get_libname)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install env.d files
|
|
||||||
newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
|
|
||||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
|
|
||||||
sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
|
|
||||||
|
|
||||||
# set php-config variable correctly (bug #278439)
|
|
||||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
|
||||||
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
|
|
||||||
|
|
||||||
if use fpm ; then
|
|
||||||
if use systemd; then
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at.service" \
|
|
||||||
"php-fpm@${SLOT}.service"
|
|
||||||
else
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
|
|
||||||
"php-fpm@${SLOT}.service"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
|
||||||
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
||||||
if [[ ! -x "${PHP_BIN}" ]] ; then
|
|
||||||
ewarn "Test phase requires USE=cli, skipping"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
|
|
||||||
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
|
|
||||||
"session.save_path=${T}" \
|
|
||||||
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
|
|
||||||
"session.save_path=${T}"
|
|
||||||
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
|
|
||||||
done
|
|
||||||
|
|
||||||
local failed="$(find -name '*.out')"
|
|
||||||
if [[ ${failed} != "" ]] ; then
|
|
||||||
ewarn "The following test cases failed unexpectedly:"
|
|
||||||
for name in ${failed}; do
|
|
||||||
ewarn " ${name/.out/}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "No unexpected test failures, all fine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
|
||||||
local passed=""
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
[[ -f "${name}.diff" ]] && continue
|
|
||||||
passed="${passed} ${name}"
|
|
||||||
done
|
|
||||||
if [[ ${passed} != "" ]] ; then
|
|
||||||
einfo "The following test cases passed unexpectedly:"
|
|
||||||
for name in ${passed}; do
|
|
||||||
ewarn " ${passed}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "None of the known-to-fail tests passed, all fine"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Output some general info to the user
|
|
||||||
if use apache2 ; then
|
|
||||||
APACHE2_MOD_DEFINE="PHP"
|
|
||||||
APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php
|
|
||||||
apache-module_pkg_postinst
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the symlinks for php
|
|
||||||
for m in ${SAPIS}; do
|
|
||||||
[[ ${m} == 'embed' ]] && continue;
|
|
||||||
if use $m ; then
|
|
||||||
local ci=$(eselect php show $m)
|
|
||||||
if [[ -z $ci ]]; then
|
|
||||||
eselect php set $m php${SLOT} || die
|
|
||||||
einfo "Switched ${m} to use php:${SLOT}"
|
|
||||||
einfo
|
|
||||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
|
||||||
elog "To switch $m to use php:${SLOT}, run"
|
|
||||||
elog " eselect php set $m php${SLOT}"
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Remove dead symlinks for SAPIs that were just disabled. For
|
|
||||||
# example, if the user has the cgi SAPI enabled, then he has an
|
|
||||||
# eselect-php symlink for it. If he later reinstalls PHP with
|
|
||||||
# USE="-cgi", that symlink will break. This call to eselect is
|
|
||||||
# supposed to remove that dead link per bug 572436.
|
|
||||||
eselect php cleanup || die
|
|
||||||
|
|
||||||
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes"
|
|
||||||
elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI."
|
|
||||||
elog
|
|
||||||
elog "This ebuild installed a version of php.ini based on"
|
|
||||||
elog "php.ini-${PHP_INI_VERSION}. You can choose which version of"
|
|
||||||
elog "php.ini to install by default by setting PHP_INI_VERSION"
|
|
||||||
elog "to either 'production' or 'development' in your make.conf."
|
|
||||||
elog "Both versions of php.ini can be found with the PHP docs in"
|
|
||||||
elog "${EPREFIX}/usr/share/doc/${PF}"
|
|
||||||
elog
|
|
||||||
elog "For more details on how version slotting works, please see"
|
|
||||||
elog "the wiki:"
|
|
||||||
elog
|
|
||||||
elog " https://wiki.gentoo.org/wiki/PHP"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postrm() {
|
|
||||||
# This serves two purposes. First, if we have just removed the last
|
|
||||||
# installed version of PHP, then this will remove any dead symlinks
|
|
||||||
# belonging to eselect-php. Second, if a user upgrades slots from
|
|
||||||
# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
|
|
||||||
# his existing symlinks to point to the new 7.0 installation. The
|
|
||||||
# latter is bug 432962.
|
|
||||||
#
|
|
||||||
# Note: the eselect-php package may not be installed at this point,
|
|
||||||
# so we can't die() if this command fails.
|
|
||||||
eselect php cleanup
|
|
||||||
}
|
|
@ -1,807 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd
|
|
||||||
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
|
|
||||||
function php_get_uri ()
|
|
||||||
{
|
|
||||||
case "${1}" in
|
|
||||||
"php-pre")
|
|
||||||
echo "http://downloads.php.net/dsp/${2}"
|
|
||||||
;;
|
|
||||||
"php")
|
|
||||||
echo "http://www.php.net/distributions/${2}"
|
|
||||||
;;
|
|
||||||
"olemarkus")
|
|
||||||
echo "https://dev.gentoo.org/~olemarkus/php/${2}"
|
|
||||||
;;
|
|
||||||
"gentoo")
|
|
||||||
echo "mirror://gentoo/${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled case in php_get_uri"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_MV="$(get_major_version)"
|
|
||||||
SLOT="$(get_version_component_range 1-2)"
|
|
||||||
|
|
||||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
||||||
# betas, ...) w/o changing the whole ebuild
|
|
||||||
PHP_PV="${PV/_rc/RC}"
|
|
||||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
|
||||||
PHP_PV="${PHP_PV/_beta/beta}"
|
|
||||||
PHP_RELEASE="php"
|
|
||||||
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
PHP_P="${PN}-${PHP_PV}"
|
|
||||||
|
|
||||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
||||||
|
|
||||||
PHP_FPM_CONF_VER="1"
|
|
||||||
|
|
||||||
SRC_URI="${PHP_SRC_URI}"
|
|
||||||
|
|
||||||
DESCRIPTION="The PHP language runtime engine"
|
|
||||||
HOMEPAGE="http://php.net/"
|
|
||||||
LICENSE="PHP-3"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PHP_P}"
|
|
||||||
|
|
||||||
# We can build the following SAPIs in the given order
|
|
||||||
SAPIS="embed cli cgi fpm apache2"
|
|
||||||
|
|
||||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
||||||
IUSE="${IUSE}
|
|
||||||
${SAPIS/cli/+cli}
|
|
||||||
threads"
|
|
||||||
|
|
||||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
|
||||||
crypt +ctype curl debug
|
|
||||||
enchant exif frontbase +fileinfo +filter firebird
|
|
||||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
|
||||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
|
|
||||||
mhash mssql mysql libmysqlclient mysqli nls
|
|
||||||
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
|
||||||
readline recode selinux +session sharedmem
|
|
||||||
+simplexml snmp soap sockets spell sqlite ssl
|
|
||||||
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
|
|
||||||
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
|
|
||||||
>=dev-libs/libpcre-8.32[unicode]
|
|
||||||
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
|
|
||||||
<www-servers/apache-2.4[threads=] ) )"
|
|
||||||
|
|
||||||
# The supported (that is, autodetected) versions of BDB are listed in
|
|
||||||
# the ./configure script. Other versions *work*, but we need to stick to
|
|
||||||
# the ones that can be detected to avoid a repeat of bug #564824.
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
berkdb? ( || ( sys-libs/db:5.3
|
|
||||||
sys-libs/db:5.1
|
|
||||||
sys-libs/db:4.8
|
|
||||||
sys-libs/db:4.7
|
|
||||||
sys-libs/db:4.6
|
|
||||||
sys-libs/db:4.5 ) )
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
||||||
cjk? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
||||||
curl? ( >=net-misc/curl-7.10.5 )
|
|
||||||
enchant? ( app-text/enchant )
|
|
||||||
exif? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
firebird? ( dev-db/firebird )
|
|
||||||
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
||||||
gmp? ( dev-libs/gmp:0 )
|
|
||||||
iconv? ( virtual/libiconv )
|
|
||||||
imap? ( virtual/imap-c-client[ssl=] )
|
|
||||||
intl? ( dev-libs/icu:= )
|
|
||||||
iodbc? ( dev-db/libiodbc )
|
|
||||||
kerberos? ( virtual/krb5 )
|
|
||||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
|
||||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
|
||||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
||||||
mssql? ( dev-db/freetds[mssql] )
|
|
||||||
libmysqlclient? (
|
|
||||||
mysql? ( virtual/mysql )
|
|
||||||
mysqli? ( >=virtual/mysql-4.1 )
|
|
||||||
)
|
|
||||||
nls? ( sys-devel/gettext )
|
|
||||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
||||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
||||||
postgres? ( dev-db/postgresql:* )
|
|
||||||
qdbm? ( dev-db/qdbm )
|
|
||||||
readline? ( sys-libs/readline:0 )
|
|
||||||
recode? ( app-text/recode )
|
|
||||||
sharedmem? ( dev-libs/mm )
|
|
||||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
||||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
spell? ( >=app-text/aspell-0.50 )
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
|
|
||||||
ssl? (
|
|
||||||
!libressl? ( dev-libs/openssl:0 )
|
|
||||||
libressl? ( dev-libs/libressl )
|
|
||||||
)
|
|
||||||
sybase-ct? ( dev-db/freetds )
|
|
||||||
tidy? ( app-text/htmltidy )
|
|
||||||
truetype? (
|
|
||||||
=media-libs/freetype-2*
|
|
||||||
>=media-libs/t1lib-5.0.0
|
|
||||||
!gd? (
|
|
||||||
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
)
|
|
||||||
unicode? ( dev-libs/oniguruma )
|
|
||||||
vpx? ( media-libs/libvpx )
|
|
||||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
||||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xpm? (
|
|
||||||
x11-libs/libXpm
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0= sys-libs/zlib
|
|
||||||
)
|
|
||||||
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
||||||
zip? ( sys-libs/zlib )
|
|
||||||
zlib? ( sys-libs/zlib )
|
|
||||||
virtual/mta
|
|
||||||
"
|
|
||||||
|
|
||||||
php="=${CATEGORY}/${PF}"
|
|
||||||
|
|
||||||
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
|
|
||||||
REQUIRED_USE="
|
|
||||||
cli? ( ^^ ( readline libedit ) )
|
|
||||||
truetype? ( gd )
|
|
||||||
vpx? ( gd )
|
|
||||||
cjk? ( gd )
|
|
||||||
exif? ( gd )
|
|
||||||
|
|
||||||
xpm? ( gd )
|
|
||||||
gd? ( zlib )
|
|
||||||
simplexml? ( xml )
|
|
||||||
soap? ( xml )
|
|
||||||
wddx? ( xml )
|
|
||||||
xmlrpc? ( || ( xml iconv ) )
|
|
||||||
xmlreader? ( xml )
|
|
||||||
xslt? ( xml )
|
|
||||||
ldap-sasl? ( ldap )
|
|
||||||
mhash? ( hash )
|
|
||||||
phar? ( hash )
|
|
||||||
libmysqlclient? ( || (
|
|
||||||
mysql
|
|
||||||
mysqli
|
|
||||||
pdo
|
|
||||||
) )
|
|
||||||
|
|
||||||
qdbm? ( !gdbm )
|
|
||||||
readline? ( !libedit )
|
|
||||||
recode? ( !imap !mysql !mysqli )
|
|
||||||
sharedmem? ( !threads )
|
|
||||||
|
|
||||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
RDEPEND="${RDEPEND}
|
|
||||||
fpm? (
|
|
||||||
selinux? ( sec-policy/selinux-phpfpm )
|
|
||||||
systemd? ( sys-apps/systemd ) )"
|
|
||||||
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-devel/m4-1.4.3
|
|
||||||
>=sys-devel/libtool-1.5.18"
|
|
||||||
|
|
||||||
# Allow users to install production version if they want to
|
|
||||||
|
|
||||||
case "${PHP_INI_VERSION}" in
|
|
||||||
production|development)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PHP_INI_VERSION="development"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
|
||||||
PHP_INI_FILE="php.ini"
|
|
||||||
|
|
||||||
want_apache
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
depend.apache_pkg_setup
|
|
||||||
}
|
|
||||||
|
|
||||||
php_install_ini() {
|
|
||||||
local phpsapi="${1}"
|
|
||||||
|
|
||||||
# work out where we are installing the ini file
|
|
||||||
php_set_ini_dir "${phpsapi}"
|
|
||||||
|
|
||||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
|
||||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# default to /tmp for save_path, bug #282768
|
|
||||||
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# Set the extension dir
|
|
||||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# Set the include path to point to where we want to find PEAR packages
|
|
||||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
dodir "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
|
||||||
|
|
||||||
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
elog
|
|
||||||
|
|
||||||
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
|
|
||||||
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
|
|
||||||
|
|
||||||
if use_if_iuse opcache; then
|
|
||||||
elog "Adding opcache to $PHP_EXT_INI_DIR"
|
|
||||||
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
|
|
||||||
"${D}/${PHP_EXT_INI_DIR}"/opcache.ini
|
|
||||||
dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
|
|
||||||
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SAPI-specific handling
|
|
||||||
if [[ "${sapi}" == "fpm" ]] ; then
|
|
||||||
einfo "Installing FPM config file php-fpm.conf"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
doins sapi/fpm/php-fpm.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
dodoc php.ini-development
|
|
||||||
dodoc php.ini-production
|
|
||||||
}
|
|
||||||
|
|
||||||
php_set_ini_dir() {
|
|
||||||
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
|
|
||||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
|
||||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# Change PHP branding
|
|
||||||
# Get the alpha/beta/rc version
|
|
||||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
|
|
||||||
-i configure.in || die "Unable to change PHP branding"
|
|
||||||
|
|
||||||
# Patch PHP to show Gentoo as the server platform
|
|
||||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
|
||||||
-i configure.in || die "Failed to fix server platform name"
|
|
||||||
|
|
||||||
# Prevent PHP from activating the Apache config,
|
|
||||||
# as we will do that ourselves
|
|
||||||
sed -i \
|
|
||||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
|
|
||||||
|| die
|
|
||||||
|
|
||||||
# Patch PHP to support heimdal instead of mit-krb5
|
|
||||||
if has_version "app-crypt/heimdal" ; then
|
|
||||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal libname"
|
|
||||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal crypt library reference"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add user patches #357637
|
|
||||||
epatch_user
|
|
||||||
|
|
||||||
# Force rebuilding aclocal.m4
|
|
||||||
rm -f aclocal.m4 || die
|
|
||||||
eautoreconf
|
|
||||||
|
|
||||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
|
||||||
# http://bugs.php.net/bug.php?id=48795, bug #343481
|
|
||||||
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
||||||
|
|
||||||
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
|
|
||||||
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
|
|
||||||
local our_conf=(
|
|
||||||
--prefix="${PHP_DESTDIR}"
|
|
||||||
--mandir="${PHP_DESTDIR}/man"
|
|
||||||
--infodir="${PHP_DESTDIR}/info"
|
|
||||||
--libdir="${PHP_DESTDIR}/lib"
|
|
||||||
--with-libdir="$(get_libdir)"
|
|
||||||
--localstatedir="${EPREFIX}/var"
|
|
||||||
--without-pear
|
|
||||||
$(use_enable threads maintainer-zts)
|
|
||||||
)
|
|
||||||
|
|
||||||
our_conf+=(
|
|
||||||
$(use_enable bcmath bcmath)
|
|
||||||
$(use_with bzip2 bz2 "${EPREFIX}/usr")
|
|
||||||
$(use_enable calendar calendar)
|
|
||||||
$(use_enable ctype ctype)
|
|
||||||
$(use_with curl curl "${EPREFIX}/usr")
|
|
||||||
$(use_enable xml dom)
|
|
||||||
$(use_with enchant enchant "${EPREFIX}/usr")
|
|
||||||
$(use_enable exif exif)
|
|
||||||
$(use_enable fileinfo fileinfo)
|
|
||||||
$(use_enable filter filter)
|
|
||||||
$(use_enable ftp ftp)
|
|
||||||
$(use_with nls gettext "${EPREFIX}/usr")
|
|
||||||
$(use_with gmp gmp "${EPREFIX}/usr")
|
|
||||||
$(use_enable hash hash)
|
|
||||||
$(use_with mhash mhash "${EPREFIX}/usr")
|
|
||||||
$(use_with iconv iconv \
|
|
||||||
$(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
|
|
||||||
$(use_enable intl intl)
|
|
||||||
$(use_enable ipv6 ipv6)
|
|
||||||
$(use_enable json json)
|
|
||||||
$(use_with kerberos kerberos "${EPREFIX}/usr")
|
|
||||||
$(use_enable xml libxml)
|
|
||||||
$(use_with xml libxml-dir "${EPREFIX}/usr")
|
|
||||||
$(use_enable unicode mbstring)
|
|
||||||
$(use_with crypt mcrypt "${EPREFIX}/usr")
|
|
||||||
$(use_with mssql mssql "${EPREFIX}/usr")
|
|
||||||
$(use_with unicode onig "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl openssl "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl openssl-dir "${EPREFIX}/usr")
|
|
||||||
$(use_enable pcntl pcntl)
|
|
||||||
$(use_enable phar phar)
|
|
||||||
$(use_enable pdo pdo)
|
|
||||||
$(use_enable opcache opcache)
|
|
||||||
$(use_with postgres pgsql "${EPREFIX}/usr")
|
|
||||||
$(use_enable posix posix)
|
|
||||||
$(use_with spell pspell "${EPREFIX}/usr")
|
|
||||||
$(use_with recode recode "${EPREFIX}/usr")
|
|
||||||
$(use_enable simplexml simplexml)
|
|
||||||
$(use_enable sharedmem shmop)
|
|
||||||
$(use_with snmp snmp "${EPREFIX}/usr")
|
|
||||||
$(use_enable soap soap)
|
|
||||||
$(use_enable sockets sockets)
|
|
||||||
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
|
|
||||||
$(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
|
|
||||||
$(use_enable sysvipc sysvmsg)
|
|
||||||
$(use_enable sysvipc sysvsem)
|
|
||||||
$(use_enable sysvipc sysvshm)
|
|
||||||
$(use_with systemd fpm-systemd)
|
|
||||||
$(use_with tidy tidy "${EPREFIX}/usr")
|
|
||||||
$(use_enable tokenizer tokenizer)
|
|
||||||
$(use_enable wddx wddx)
|
|
||||||
$(use_enable xml xml)
|
|
||||||
$(use_enable xmlreader xmlreader)
|
|
||||||
$(use_enable xmlwriter xmlwriter)
|
|
||||||
$(use_with xmlrpc xmlrpc)
|
|
||||||
$(use_with xslt xsl "${EPREFIX}/usr")
|
|
||||||
$(use_enable zip zip)
|
|
||||||
$(use_with zlib zlib "${EPREFIX}/usr")
|
|
||||||
$(use_enable debug debug)
|
|
||||||
)
|
|
||||||
|
|
||||||
# DBA support
|
|
||||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
|
||||||
|| use qdbm ; then
|
|
||||||
our_conf+=( "--enable-dba${shared}" )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DBA drivers support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with cdb cdb)
|
|
||||||
$(use_with berkdb db4 "${EPREFIX}/usr")
|
|
||||||
$(use_enable flatfile flatfile)
|
|
||||||
$(use_with gdbm gdbm "${EPREFIX}/usr")
|
|
||||||
$(use_enable inifile inifile)
|
|
||||||
$(use_with qdbm qdbm "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Support for the GD graphics library
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with truetype freetype-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with truetype t1lib "${EPREFIX}/usr")
|
|
||||||
$(use_enable cjk gd-jis-conv)
|
|
||||||
$(use_with gd jpeg-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with gd png-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with xpm xpm-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with vpx vpx-dir "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
# enable gd last, so configure can pick up the previous settings
|
|
||||||
our_conf+=( $(use_with gd gd) )
|
|
||||||
|
|
||||||
# IMAP support
|
|
||||||
if use imap ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with imap imap "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl imap-ssl "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Interbase/firebird support
|
|
||||||
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
|
|
||||||
|
|
||||||
# LDAP support
|
|
||||||
if use ldap ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with ldap ldap "${EPREFIX}/usr")
|
|
||||||
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# MySQL support
|
|
||||||
local mysqllib="mysqlnd"
|
|
||||||
local mysqlilib="mysqlnd"
|
|
||||||
use libmysqlclient && mysqllib="${EPREFIX}/usr"
|
|
||||||
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
|
|
||||||
|
|
||||||
our_conf+=( $(use_with mysql mysql "${mysqllib}") )
|
|
||||||
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
|
|
||||||
|
|
||||||
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
|
|
||||||
if use mysql || use mysqli ; then
|
|
||||||
our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ODBC support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with odbc unixODBC "${EPREFIX}/usr")
|
|
||||||
$(use_with iodbc iodbc "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Oracle support
|
|
||||||
our_conf+=( $(use_with oci8-instant-client oci8) )
|
|
||||||
|
|
||||||
# PDO support
|
|
||||||
if use pdo ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with mssql pdo-dblib)
|
|
||||||
$(use_with mysql pdo-mysql "${mysqllib}")
|
|
||||||
$(use_with postgres pdo-pgsql)
|
|
||||||
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
|
|
||||||
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
|
|
||||||
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
|
|
||||||
$(use_with oci8-instant-client pdo-oci)
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readline/libedit support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with readline readline "${EPREFIX}/usr")
|
|
||||||
$(use_with libedit libedit "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Session support
|
|
||||||
if use session ; then
|
|
||||||
our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
|
|
||||||
else
|
|
||||||
our_conf+=( $(use_enable session session) )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use pic for shared modules such as apache2's mod_php
|
|
||||||
our_conf+=( --with-pic )
|
|
||||||
|
|
||||||
# we use the system copy of pcre
|
|
||||||
# --with-pcre-regex affects ext/pcre
|
|
||||||
# --with-pcre-dir affects ext/filter and ext/zip
|
|
||||||
our_conf+=(
|
|
||||||
--with-pcre-regex="${EPREFIX}/usr"
|
|
||||||
--with-pcre-dir="${EPREFIX}/usr"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Catch CFLAGS problems
|
|
||||||
# Fixes bug #14067.
|
|
||||||
# Changed order to run it in reverse for bug #32022 and #12021.
|
|
||||||
replace-cpu-flags "k6*" "i586"
|
|
||||||
|
|
||||||
# Support user-passed configuration parameters
|
|
||||||
our_conf+=( ${EXTRA_ECONF:-} )
|
|
||||||
|
|
||||||
# Support the Apache2 extras, they must be set globally for all
|
|
||||||
# SAPIs to work correctly, especially for external PHP extensions
|
|
||||||
|
|
||||||
mkdir -p "${WORKDIR}/sapis-build" || die
|
|
||||||
for one_sapi in $SAPIS ; do
|
|
||||||
use "${one_sapi}" || continue
|
|
||||||
php_set_ini_dir "${one_sapi}"
|
|
||||||
|
|
||||||
# The BUILD_DIR variable is used to determine where to output
|
|
||||||
# the files that autotools creates. This was all originally
|
|
||||||
# based on the autotools-utils eclass.
|
|
||||||
BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
cp -r "${S}" "${BUILD_DIR}" || die
|
|
||||||
cd "${BUILD_DIR}" || die
|
|
||||||
|
|
||||||
local sapi_conf=(
|
|
||||||
--with-config-file-path="${PHP_INI_DIR}"
|
|
||||||
--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
|
|
||||||
)
|
|
||||||
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
case "$sapi" in
|
|
||||||
cli|cgi|embed|fpm)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf+=( "--enable-${sapi}" )
|
|
||||||
else
|
|
||||||
sapi_conf+=( "--disable-${sapi}" )
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
apache2)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" )
|
|
||||||
else
|
|
||||||
sapi_conf+=( --without-apxs2 )
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Construct the $myeconfargs array by concatenating $our_conf
|
|
||||||
# (the common args) and $sapi_conf (the SAPI-specific args).
|
|
||||||
local myeconfargs=( "${our_conf[@]}" )
|
|
||||||
myeconfargs+=( "${sapi_conf[@]}" )
|
|
||||||
|
|
||||||
pushd "${BUILD_DIR}" > /dev/null || die
|
|
||||||
econf "${myeconfargs[@]}"
|
|
||||||
popd > /dev/null || die
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
# snmp seems to run during src_compile, too (bug #324739)
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
for sapi in ${SAPIS} ; do
|
|
||||||
if use "${sapi}"; then
|
|
||||||
cd "${WORKDIR}/sapis-build/$sapi" || \
|
|
||||||
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
|
||||||
emake
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# see bug #324739 for what happens when we don't have that
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
|
|
||||||
# grab the first SAPI that got built and install common files from there
|
|
||||||
local first_sapi=""
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
if use $sapi ; then
|
|
||||||
first_sapi=$sapi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Makefile forgets to create this before trying to write to it...
|
|
||||||
dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
|
|
||||||
|
|
||||||
# Install php environment (without any sapis)
|
|
||||||
cd "${WORKDIR}/sapis-build/$first_sapi" || die
|
|
||||||
emake INSTALL_ROOT="${D}" \
|
|
||||||
install-build install-headers install-programs
|
|
||||||
|
|
||||||
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
|
|
||||||
|
|
||||||
# Create the directory where we'll put version-specific php scripts
|
|
||||||
keepdir "/usr/share/php${PHP_MV}"
|
|
||||||
|
|
||||||
local sapi="", file=""
|
|
||||||
local sapi_list=""
|
|
||||||
|
|
||||||
for sapi in ${SAPIS}; do
|
|
||||||
if use "${sapi}" ; then
|
|
||||||
einfo "Installing SAPI: ${sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${sapi}" || die
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "apache2" ]] ; then
|
|
||||||
# We're specifically not using emake install-sapi as libtool
|
|
||||||
# may cause unnecessary relink failures (see bug #351266)
|
|
||||||
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
|
|
||||||
newins ".libs/libphp5$(get_libname)" \
|
|
||||||
"libphp${PHP_MV}$(get_libname)"
|
|
||||||
keepdir "/usr/$(get_libdir)/apache2/modules"
|
|
||||||
else
|
|
||||||
# needed each time, php_install_ini would reset it
|
|
||||||
local dest="${PHP_DESTDIR#${EPREFIX}}"
|
|
||||||
into "${dest}"
|
|
||||||
case "$sapi" in
|
|
||||||
cli)
|
|
||||||
source="sapi/cli/php"
|
|
||||||
;;
|
|
||||||
cgi)
|
|
||||||
source="sapi/cgi/php-cgi"
|
|
||||||
;;
|
|
||||||
fpm)
|
|
||||||
source="sapi/fpm/php-fpm"
|
|
||||||
;;
|
|
||||||
embed)
|
|
||||||
source="libs/libphp${PHP_MV}$(get_libname)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled sapi in src_install"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ "${source}" == *"$(get_libname)" ]]; then
|
|
||||||
dolib.so "${source}"
|
|
||||||
else
|
|
||||||
dobin "${source}"
|
|
||||||
local name="$(basename ${source})"
|
|
||||||
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
php_install_ini "${sapi}"
|
|
||||||
|
|
||||||
# construct correct SAPI string for php-config
|
|
||||||
# thanks to ferringb for the bash voodoo
|
|
||||||
if [[ "${sapi}" == "apache2" ]]; then
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
|
||||||
else
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Installing opcache module
|
|
||||||
if use_if_iuse opcache ; then
|
|
||||||
dolib.so "modules/opcache$(get_libname)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install env.d files
|
|
||||||
newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
|
|
||||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
|
|
||||||
sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
|
|
||||||
|
|
||||||
# set php-config variable correctly (bug #278439)
|
|
||||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
|
||||||
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
|
|
||||||
|
|
||||||
if use fpm ; then
|
|
||||||
if use systemd; then
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at.service" \
|
|
||||||
"php-fpm@${SLOT}.service"
|
|
||||||
else
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
|
|
||||||
"php-fpm@${SLOT}.service"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
|
||||||
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
||||||
if [[ ! -x "${PHP_BIN}" ]] ; then
|
|
||||||
ewarn "Test phase requires USE=cli, skipping"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
|
|
||||||
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
|
|
||||||
"session.save_path=${T}" \
|
|
||||||
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
|
|
||||||
"session.save_path=${T}"
|
|
||||||
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
|
|
||||||
done
|
|
||||||
|
|
||||||
local failed="$(find -name '*.out')"
|
|
||||||
if [[ ${failed} != "" ]] ; then
|
|
||||||
ewarn "The following test cases failed unexpectedly:"
|
|
||||||
for name in ${failed}; do
|
|
||||||
ewarn " ${name/.out/}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "No unexpected test failures, all fine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
|
||||||
local passed=""
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
[[ -f "${name}.diff" ]] && continue
|
|
||||||
passed="${passed} ${name}"
|
|
||||||
done
|
|
||||||
if [[ ${passed} != "" ]] ; then
|
|
||||||
einfo "The following test cases passed unexpectedly:"
|
|
||||||
for name in ${passed}; do
|
|
||||||
ewarn " ${passed}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "None of the known-to-fail tests passed, all fine"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Output some general info to the user
|
|
||||||
if use apache2 ; then
|
|
||||||
APACHE2_MOD_DEFINE="PHP"
|
|
||||||
APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php
|
|
||||||
apache-module_pkg_postinst
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the symlinks for php
|
|
||||||
for m in ${SAPIS}; do
|
|
||||||
[[ ${m} == 'embed' ]] && continue;
|
|
||||||
if use $m ; then
|
|
||||||
local ci=$(eselect php show $m)
|
|
||||||
if [[ -z $ci ]]; then
|
|
||||||
eselect php set $m php${SLOT} || die
|
|
||||||
einfo "Switched ${m} to use php:${SLOT}"
|
|
||||||
einfo
|
|
||||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
|
||||||
elog "To switch $m to use php:${SLOT}, run"
|
|
||||||
elog " eselect php set $m php${SLOT}"
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Remove dead symlinks for SAPIs that were just disabled. For
|
|
||||||
# example, if the user has the cgi SAPI enabled, then he has an
|
|
||||||
# eselect-php symlink for it. If he later reinstalls PHP with
|
|
||||||
# USE="-cgi", that symlink will break. This call to eselect is
|
|
||||||
# supposed to remove that dead link per bug 572436.
|
|
||||||
eselect php cleanup || die
|
|
||||||
|
|
||||||
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes"
|
|
||||||
elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI."
|
|
||||||
elog
|
|
||||||
elog "This ebuild installed a version of php.ini based on"
|
|
||||||
elog "php.ini-${PHP_INI_VERSION}. You can choose which version of"
|
|
||||||
elog "php.ini to install by default by setting PHP_INI_VERSION"
|
|
||||||
elog "to either 'production' or 'development' in your make.conf."
|
|
||||||
elog "Both versions of php.ini can be found with the PHP docs in"
|
|
||||||
elog "${EPREFIX}/usr/share/doc/${PF}"
|
|
||||||
elog
|
|
||||||
elog "For more details on how version slotting works, please see"
|
|
||||||
elog "the wiki:"
|
|
||||||
elog
|
|
||||||
elog " https://wiki.gentoo.org/wiki/PHP"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postrm() {
|
|
||||||
# This serves two purposes. First, if we have just removed the last
|
|
||||||
# installed version of PHP, then this will remove any dead symlinks
|
|
||||||
# belonging to eselect-php. Second, if a user upgrades slots from
|
|
||||||
# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
|
|
||||||
# his existing symlinks to point to the new 7.0 installation. The
|
|
||||||
# latter is bug 432962.
|
|
||||||
#
|
|
||||||
# Note: the eselect-php package may not be installed at this point,
|
|
||||||
# so we can't die() if this command fails.
|
|
||||||
eselect php cleanup
|
|
||||||
}
|
|
@ -1,807 +0,0 @@
|
|||||||
# Copyright 1999-2016 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd
|
|
||||||
|
|
||||||
KEYWORDS="alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
|
|
||||||
|
|
||||||
function php_get_uri ()
|
|
||||||
{
|
|
||||||
case "${1}" in
|
|
||||||
"php-pre")
|
|
||||||
echo "http://downloads.php.net/dsp/${2}"
|
|
||||||
;;
|
|
||||||
"php")
|
|
||||||
echo "http://www.php.net/distributions/${2}"
|
|
||||||
;;
|
|
||||||
"olemarkus")
|
|
||||||
echo "https://dev.gentoo.org/~olemarkus/php/${2}"
|
|
||||||
;;
|
|
||||||
"gentoo")
|
|
||||||
echo "mirror://gentoo/${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled case in php_get_uri"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_MV="$(get_major_version)"
|
|
||||||
SLOT="$(get_version_component_range 1-2)"
|
|
||||||
|
|
||||||
# alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
||||||
# betas, ...) w/o changing the whole ebuild
|
|
||||||
PHP_PV="${PV/_rc/RC}"
|
|
||||||
PHP_PV="${PHP_PV/_alpha/alpha}"
|
|
||||||
PHP_PV="${PHP_PV/_beta/beta}"
|
|
||||||
PHP_RELEASE="php"
|
|
||||||
[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
|
|
||||||
PHP_P="${PN}-${PHP_PV}"
|
|
||||||
|
|
||||||
PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
||||||
|
|
||||||
PHP_FPM_CONF_VER="1"
|
|
||||||
|
|
||||||
SRC_URI="${PHP_SRC_URI}"
|
|
||||||
|
|
||||||
DESCRIPTION="The PHP language runtime engine"
|
|
||||||
HOMEPAGE="http://php.net/"
|
|
||||||
LICENSE="PHP-3"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PHP_P}"
|
|
||||||
|
|
||||||
# We can build the following SAPIs in the given order
|
|
||||||
SAPIS="embed cli cgi fpm apache2"
|
|
||||||
|
|
||||||
# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
||||||
IUSE="${IUSE}
|
|
||||||
${SAPIS/cli/+cli}
|
|
||||||
threads"
|
|
||||||
|
|
||||||
IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
|
|
||||||
crypt +ctype curl debug
|
|
||||||
enchant exif frontbase +fileinfo +filter firebird
|
|
||||||
flatfile ftp gd gdbm gmp +hash +iconv imap inifile
|
|
||||||
intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
|
|
||||||
mhash mssql mysql libmysqlclient mysqli nls
|
|
||||||
oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
|
|
||||||
readline recode selinux +session sharedmem
|
|
||||||
+simplexml snmp soap sockets spell sqlite ssl
|
|
||||||
sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
|
|
||||||
+xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
|
|
||||||
>=dev-libs/libpcre-8.32[unicode]
|
|
||||||
apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
|
|
||||||
<www-servers/apache-2.4[threads=] ) )"
|
|
||||||
|
|
||||||
# The supported (that is, autodetected) versions of BDB are listed in
|
|
||||||
# the ./configure script. Other versions *work*, but we need to stick to
|
|
||||||
# the ones that can be detected to avoid a repeat of bug #564824.
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
berkdb? ( || ( sys-libs/db:5.3
|
|
||||||
sys-libs/db:5.1
|
|
||||||
sys-libs/db:4.8
|
|
||||||
sys-libs/db:4.7
|
|
||||||
sys-libs/db:4.6
|
|
||||||
sys-libs/db:4.5 ) )
|
|
||||||
bzip2? ( app-arch/bzip2 )
|
|
||||||
cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
||||||
cjk? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
||||||
curl? ( >=net-misc/curl-7.10.5 )
|
|
||||||
enchant? ( app-text/enchant )
|
|
||||||
exif? ( !gd? (
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0=
|
|
||||||
sys-libs/zlib
|
|
||||||
) )
|
|
||||||
firebird? ( dev-db/firebird )
|
|
||||||
gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
||||||
gmp? ( dev-libs/gmp:0 )
|
|
||||||
iconv? ( virtual/libiconv )
|
|
||||||
imap? ( virtual/imap-c-client[ssl=] )
|
|
||||||
intl? ( dev-libs/icu:= )
|
|
||||||
iodbc? ( dev-db/libiodbc )
|
|
||||||
kerberos? ( virtual/krb5 )
|
|
||||||
ldap? ( >=net-nds/openldap-1.2.11 )
|
|
||||||
ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
|
|
||||||
libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
||||||
mssql? ( dev-db/freetds[mssql] )
|
|
||||||
libmysqlclient? (
|
|
||||||
mysql? ( virtual/mysql )
|
|
||||||
mysqli? ( >=virtual/mysql-4.1 )
|
|
||||||
)
|
|
||||||
nls? ( sys-devel/gettext )
|
|
||||||
oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
||||||
odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
||||||
postgres? ( dev-db/postgresql:* )
|
|
||||||
qdbm? ( dev-db/qdbm )
|
|
||||||
readline? ( sys-libs/readline:0 )
|
|
||||||
recode? ( app-text/recode )
|
|
||||||
sharedmem? ( dev-libs/mm )
|
|
||||||
simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
||||||
soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
spell? ( >=app-text/aspell-0.50 )
|
|
||||||
sqlite? ( >=dev-db/sqlite-3.7.6.3 )
|
|
||||||
ssl? (
|
|
||||||
!libressl? ( dev-libs/openssl:0 )
|
|
||||||
libressl? ( dev-libs/libressl )
|
|
||||||
)
|
|
||||||
sybase-ct? ( dev-db/freetds )
|
|
||||||
tidy? ( app-text/htmltidy )
|
|
||||||
truetype? (
|
|
||||||
=media-libs/freetype-2*
|
|
||||||
>=media-libs/t1lib-5.0.0
|
|
||||||
!gd? (
|
|
||||||
virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
|
|
||||||
)
|
|
||||||
unicode? ( dev-libs/oniguruma )
|
|
||||||
vpx? ( media-libs/libvpx )
|
|
||||||
wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
||||||
xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
||||||
xpm? (
|
|
||||||
x11-libs/libXpm
|
|
||||||
virtual/jpeg:0
|
|
||||||
media-libs/libpng:0= sys-libs/zlib
|
|
||||||
)
|
|
||||||
xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
||||||
zip? ( sys-libs/zlib )
|
|
||||||
zlib? ( sys-libs/zlib )
|
|
||||||
virtual/mta
|
|
||||||
"
|
|
||||||
|
|
||||||
php="=${CATEGORY}/${PF}"
|
|
||||||
|
|
||||||
# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
|
|
||||||
REQUIRED_USE="
|
|
||||||
cli? ( ^^ ( readline libedit ) )
|
|
||||||
truetype? ( gd )
|
|
||||||
vpx? ( gd )
|
|
||||||
cjk? ( gd )
|
|
||||||
exif? ( gd )
|
|
||||||
|
|
||||||
xpm? ( gd )
|
|
||||||
gd? ( zlib )
|
|
||||||
simplexml? ( xml )
|
|
||||||
soap? ( xml )
|
|
||||||
wddx? ( xml )
|
|
||||||
xmlrpc? ( || ( xml iconv ) )
|
|
||||||
xmlreader? ( xml )
|
|
||||||
xslt? ( xml )
|
|
||||||
ldap-sasl? ( ldap )
|
|
||||||
mhash? ( hash )
|
|
||||||
phar? ( hash )
|
|
||||||
libmysqlclient? ( || (
|
|
||||||
mysql
|
|
||||||
mysqli
|
|
||||||
pdo
|
|
||||||
) )
|
|
||||||
|
|
||||||
qdbm? ( !gdbm )
|
|
||||||
readline? ( !libedit )
|
|
||||||
recode? ( !imap !mysql !mysqli )
|
|
||||||
sharedmem? ( !threads )
|
|
||||||
|
|
||||||
!cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
RDEPEND="${RDEPEND}
|
|
||||||
fpm? (
|
|
||||||
selinux? ( sec-policy/selinux-phpfpm )
|
|
||||||
systemd? ( sys-apps/systemd ) )"
|
|
||||||
|
|
||||||
DEPEND="${DEPEND}
|
|
||||||
sys-devel/flex
|
|
||||||
>=sys-devel/m4-1.4.3
|
|
||||||
>=sys-devel/libtool-1.5.18"
|
|
||||||
|
|
||||||
# Allow users to install production version if they want to
|
|
||||||
|
|
||||||
case "${PHP_INI_VERSION}" in
|
|
||||||
production|development)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PHP_INI_VERSION="development"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
|
|
||||||
PHP_INI_FILE="php.ini"
|
|
||||||
|
|
||||||
want_apache
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
depend.apache_pkg_setup
|
|
||||||
}
|
|
||||||
|
|
||||||
php_install_ini() {
|
|
||||||
local phpsapi="${1}"
|
|
||||||
|
|
||||||
# work out where we are installing the ini file
|
|
||||||
php_set_ini_dir "${phpsapi}"
|
|
||||||
|
|
||||||
local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
|
|
||||||
cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# default to /tmp for save_path, bug #282768
|
|
||||||
sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# Set the extension dir
|
|
||||||
sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
# Set the include path to point to where we want to find PEAR packages
|
|
||||||
sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
|
|
||||||
|
|
||||||
dodir "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
newins "${phpinisrc}" "${PHP_INI_FILE}"
|
|
||||||
|
|
||||||
elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
elog
|
|
||||||
|
|
||||||
dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
|
|
||||||
dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
|
|
||||||
|
|
||||||
if use_if_iuse opcache; then
|
|
||||||
elog "Adding opcache to $PHP_EXT_INI_DIR"
|
|
||||||
echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
|
|
||||||
"${D}/${PHP_EXT_INI_DIR}"/opcache.ini
|
|
||||||
dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
|
|
||||||
"${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# SAPI-specific handling
|
|
||||||
if [[ "${sapi}" == "fpm" ]] ; then
|
|
||||||
einfo "Installing FPM config file php-fpm.conf"
|
|
||||||
insinto "${PHP_INI_DIR#${EPREFIX}}"
|
|
||||||
doins sapi/fpm/php-fpm.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
dodoc php.ini-development
|
|
||||||
dodoc php.ini-production
|
|
||||||
}
|
|
||||||
|
|
||||||
php_set_ini_dir() {
|
|
||||||
PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
|
|
||||||
PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
|
|
||||||
PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# Change PHP branding
|
|
||||||
# Get the alpha/beta/rc version
|
|
||||||
sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
|
|
||||||
-i configure.in || die "Unable to change PHP branding"
|
|
||||||
|
|
||||||
# Patch PHP to show Gentoo as the server platform
|
|
||||||
sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
|
|
||||||
-i configure.in || die "Failed to fix server platform name"
|
|
||||||
|
|
||||||
# Prevent PHP from activating the Apache config,
|
|
||||||
# as we will do that ourselves
|
|
||||||
sed -i \
|
|
||||||
-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
|
|
||||||
configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
|
|
||||||
|| die
|
|
||||||
|
|
||||||
# Patch PHP to support heimdal instead of mit-krb5
|
|
||||||
if has_version "app-crypt/heimdal" ; then
|
|
||||||
sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal libname"
|
|
||||||
sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
|
|
||||||
|| die "Failed to fix heimdal crypt library reference"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add user patches #357637
|
|
||||||
epatch_user
|
|
||||||
|
|
||||||
# Force rebuilding aclocal.m4
|
|
||||||
rm -f aclocal.m4 || die
|
|
||||||
eautoreconf
|
|
||||||
|
|
||||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
|
||||||
# http://bugs.php.net/bug.php?id=48795, bug #343481
|
|
||||||
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
|
|
||||||
|
|
||||||
# The php-fpm config file wants localstatedir to be ${EPREFIX}/var
|
|
||||||
# and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
|
|
||||||
local our_conf=(
|
|
||||||
--prefix="${PHP_DESTDIR}"
|
|
||||||
--mandir="${PHP_DESTDIR}/man"
|
|
||||||
--infodir="${PHP_DESTDIR}/info"
|
|
||||||
--libdir="${PHP_DESTDIR}/lib"
|
|
||||||
--with-libdir="$(get_libdir)"
|
|
||||||
--localstatedir="${EPREFIX}/var"
|
|
||||||
--without-pear
|
|
||||||
$(use_enable threads maintainer-zts)
|
|
||||||
)
|
|
||||||
|
|
||||||
our_conf+=(
|
|
||||||
$(use_enable bcmath bcmath)
|
|
||||||
$(use_with bzip2 bz2 "${EPREFIX}/usr")
|
|
||||||
$(use_enable calendar calendar)
|
|
||||||
$(use_enable ctype ctype)
|
|
||||||
$(use_with curl curl "${EPREFIX}/usr")
|
|
||||||
$(use_enable xml dom)
|
|
||||||
$(use_with enchant enchant "${EPREFIX}/usr")
|
|
||||||
$(use_enable exif exif)
|
|
||||||
$(use_enable fileinfo fileinfo)
|
|
||||||
$(use_enable filter filter)
|
|
||||||
$(use_enable ftp ftp)
|
|
||||||
$(use_with nls gettext "${EPREFIX}/usr")
|
|
||||||
$(use_with gmp gmp "${EPREFIX}/usr")
|
|
||||||
$(use_enable hash hash)
|
|
||||||
$(use_with mhash mhash "${EPREFIX}/usr")
|
|
||||||
$(use_with iconv iconv \
|
|
||||||
$(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
|
|
||||||
$(use_enable intl intl)
|
|
||||||
$(use_enable ipv6 ipv6)
|
|
||||||
$(use_enable json json)
|
|
||||||
$(use_with kerberos kerberos "${EPREFIX}/usr")
|
|
||||||
$(use_enable xml libxml)
|
|
||||||
$(use_with xml libxml-dir "${EPREFIX}/usr")
|
|
||||||
$(use_enable unicode mbstring)
|
|
||||||
$(use_with crypt mcrypt "${EPREFIX}/usr")
|
|
||||||
$(use_with mssql mssql "${EPREFIX}/usr")
|
|
||||||
$(use_with unicode onig "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl openssl "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl openssl-dir "${EPREFIX}/usr")
|
|
||||||
$(use_enable pcntl pcntl)
|
|
||||||
$(use_enable phar phar)
|
|
||||||
$(use_enable pdo pdo)
|
|
||||||
$(use_enable opcache opcache)
|
|
||||||
$(use_with postgres pgsql "${EPREFIX}/usr")
|
|
||||||
$(use_enable posix posix)
|
|
||||||
$(use_with spell pspell "${EPREFIX}/usr")
|
|
||||||
$(use_with recode recode "${EPREFIX}/usr")
|
|
||||||
$(use_enable simplexml simplexml)
|
|
||||||
$(use_enable sharedmem shmop)
|
|
||||||
$(use_with snmp snmp "${EPREFIX}/usr")
|
|
||||||
$(use_enable soap soap)
|
|
||||||
$(use_enable sockets sockets)
|
|
||||||
$(use_with sqlite sqlite3 "${EPREFIX}/usr")
|
|
||||||
$(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
|
|
||||||
$(use_enable sysvipc sysvmsg)
|
|
||||||
$(use_enable sysvipc sysvsem)
|
|
||||||
$(use_enable sysvipc sysvshm)
|
|
||||||
$(use_with systemd fpm-systemd)
|
|
||||||
$(use_with tidy tidy "${EPREFIX}/usr")
|
|
||||||
$(use_enable tokenizer tokenizer)
|
|
||||||
$(use_enable wddx wddx)
|
|
||||||
$(use_enable xml xml)
|
|
||||||
$(use_enable xmlreader xmlreader)
|
|
||||||
$(use_enable xmlwriter xmlwriter)
|
|
||||||
$(use_with xmlrpc xmlrpc)
|
|
||||||
$(use_with xslt xsl "${EPREFIX}/usr")
|
|
||||||
$(use_enable zip zip)
|
|
||||||
$(use_with zlib zlib "${EPREFIX}/usr")
|
|
||||||
$(use_enable debug debug)
|
|
||||||
)
|
|
||||||
|
|
||||||
# DBA support
|
|
||||||
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
|
||||||
|| use qdbm ; then
|
|
||||||
our_conf+=( "--enable-dba${shared}" )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DBA drivers support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with cdb cdb)
|
|
||||||
$(use_with berkdb db4 "${EPREFIX}/usr")
|
|
||||||
$(use_enable flatfile flatfile)
|
|
||||||
$(use_with gdbm gdbm "${EPREFIX}/usr")
|
|
||||||
$(use_enable inifile inifile)
|
|
||||||
$(use_with qdbm qdbm "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Support for the GD graphics library
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with truetype freetype-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with truetype t1lib "${EPREFIX}/usr")
|
|
||||||
$(use_enable cjk gd-jis-conv)
|
|
||||||
$(use_with gd jpeg-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with gd png-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with xpm xpm-dir "${EPREFIX}/usr")
|
|
||||||
$(use_with vpx vpx-dir "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
# enable gd last, so configure can pick up the previous settings
|
|
||||||
our_conf+=( $(use_with gd gd) )
|
|
||||||
|
|
||||||
# IMAP support
|
|
||||||
if use imap ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with imap imap "${EPREFIX}/usr")
|
|
||||||
$(use_with ssl imap-ssl "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Interbase/firebird support
|
|
||||||
our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
|
|
||||||
|
|
||||||
# LDAP support
|
|
||||||
if use ldap ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with ldap ldap "${EPREFIX}/usr")
|
|
||||||
$(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# MySQL support
|
|
||||||
local mysqllib="mysqlnd"
|
|
||||||
local mysqlilib="mysqlnd"
|
|
||||||
use libmysqlclient && mysqllib="${EPREFIX}/usr"
|
|
||||||
use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
|
|
||||||
|
|
||||||
our_conf+=( $(use_with mysql mysql "${mysqllib}") )
|
|
||||||
our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
|
|
||||||
|
|
||||||
local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
|
|
||||||
if use mysql || use mysqli ; then
|
|
||||||
our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ODBC support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with odbc unixODBC "${EPREFIX}/usr")
|
|
||||||
$(use_with iodbc iodbc "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Oracle support
|
|
||||||
our_conf+=( $(use_with oci8-instant-client oci8) )
|
|
||||||
|
|
||||||
# PDO support
|
|
||||||
if use pdo ; then
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with mssql pdo-dblib)
|
|
||||||
$(use_with mysql pdo-mysql "${mysqllib}")
|
|
||||||
$(use_with postgres pdo-pgsql)
|
|
||||||
$(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
|
|
||||||
$(use_with firebird pdo-firebird "${EPREFIX}/usr")
|
|
||||||
$(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
|
|
||||||
$(use_with oci8-instant-client pdo-oci)
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# readline/libedit support
|
|
||||||
our_conf+=(
|
|
||||||
$(use_with readline readline "${EPREFIX}/usr")
|
|
||||||
$(use_with libedit libedit "${EPREFIX}/usr")
|
|
||||||
)
|
|
||||||
|
|
||||||
# Session support
|
|
||||||
if use session ; then
|
|
||||||
our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
|
|
||||||
else
|
|
||||||
our_conf+=( $(use_enable session session) )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use pic for shared modules such as apache2's mod_php
|
|
||||||
our_conf+=( --with-pic )
|
|
||||||
|
|
||||||
# we use the system copy of pcre
|
|
||||||
# --with-pcre-regex affects ext/pcre
|
|
||||||
# --with-pcre-dir affects ext/filter and ext/zip
|
|
||||||
our_conf+=(
|
|
||||||
--with-pcre-regex="${EPREFIX}/usr"
|
|
||||||
--with-pcre-dir="${EPREFIX}/usr"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Catch CFLAGS problems
|
|
||||||
# Fixes bug #14067.
|
|
||||||
# Changed order to run it in reverse for bug #32022 and #12021.
|
|
||||||
replace-cpu-flags "k6*" "i586"
|
|
||||||
|
|
||||||
# Support user-passed configuration parameters
|
|
||||||
our_conf+=( ${EXTRA_ECONF:-} )
|
|
||||||
|
|
||||||
# Support the Apache2 extras, they must be set globally for all
|
|
||||||
# SAPIs to work correctly, especially for external PHP extensions
|
|
||||||
|
|
||||||
mkdir -p "${WORKDIR}/sapis-build" || die
|
|
||||||
for one_sapi in $SAPIS ; do
|
|
||||||
use "${one_sapi}" || continue
|
|
||||||
php_set_ini_dir "${one_sapi}"
|
|
||||||
|
|
||||||
# The BUILD_DIR variable is used to determine where to output
|
|
||||||
# the files that autotools creates. This was all originally
|
|
||||||
# based on the autotools-utils eclass.
|
|
||||||
BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
|
|
||||||
cp -r "${S}" "${BUILD_DIR}" || die
|
|
||||||
cd "${BUILD_DIR}" || die
|
|
||||||
|
|
||||||
local sapi_conf=(
|
|
||||||
--with-config-file-path="${PHP_INI_DIR}"
|
|
||||||
--with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
|
|
||||||
)
|
|
||||||
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
case "$sapi" in
|
|
||||||
cli|cgi|embed|fpm)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf+=( "--enable-${sapi}" )
|
|
||||||
else
|
|
||||||
sapi_conf+=( "--disable-${sapi}" )
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
apache2)
|
|
||||||
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
|
||||||
sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" )
|
|
||||||
else
|
|
||||||
sapi_conf+=( --without-apxs2 )
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Construct the $myeconfargs array by concatenating $our_conf
|
|
||||||
# (the common args) and $sapi_conf (the SAPI-specific args).
|
|
||||||
local myeconfargs=( "${our_conf[@]}" )
|
|
||||||
myeconfargs+=( "${sapi_conf[@]}" )
|
|
||||||
|
|
||||||
pushd "${BUILD_DIR}" > /dev/null || die
|
|
||||||
econf "${myeconfargs[@]}"
|
|
||||||
popd > /dev/null || die
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
# snmp seems to run during src_compile, too (bug #324739)
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
addpredict /var/lib/net-snmp/mib_indexes
|
|
||||||
|
|
||||||
for sapi in ${SAPIS} ; do
|
|
||||||
if use "${sapi}"; then
|
|
||||||
cd "${WORKDIR}/sapis-build/$sapi" || \
|
|
||||||
die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
|
|
||||||
emake
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# see bug #324739 for what happens when we don't have that
|
|
||||||
addpredict /usr/share/snmp/mibs/.index
|
|
||||||
|
|
||||||
# grab the first SAPI that got built and install common files from there
|
|
||||||
local first_sapi=""
|
|
||||||
for sapi in $SAPIS ; do
|
|
||||||
if use $sapi ; then
|
|
||||||
first_sapi=$sapi
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Makefile forgets to create this before trying to write to it...
|
|
||||||
dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
|
|
||||||
|
|
||||||
# Install php environment (without any sapis)
|
|
||||||
cd "${WORKDIR}/sapis-build/$first_sapi" || die
|
|
||||||
emake INSTALL_ROOT="${D}" \
|
|
||||||
install-build install-headers install-programs
|
|
||||||
|
|
||||||
local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
|
|
||||||
|
|
||||||
# Create the directory where we'll put version-specific php scripts
|
|
||||||
keepdir "/usr/share/php${PHP_MV}"
|
|
||||||
|
|
||||||
local sapi="", file=""
|
|
||||||
local sapi_list=""
|
|
||||||
|
|
||||||
for sapi in ${SAPIS}; do
|
|
||||||
if use "${sapi}" ; then
|
|
||||||
einfo "Installing SAPI: ${sapi}"
|
|
||||||
cd "${WORKDIR}/sapis-build/${sapi}" || die
|
|
||||||
|
|
||||||
if [[ "${sapi}" == "apache2" ]] ; then
|
|
||||||
# We're specifically not using emake install-sapi as libtool
|
|
||||||
# may cause unnecessary relink failures (see bug #351266)
|
|
||||||
insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
|
|
||||||
newins ".libs/libphp5$(get_libname)" \
|
|
||||||
"libphp${PHP_MV}$(get_libname)"
|
|
||||||
keepdir "/usr/$(get_libdir)/apache2/modules"
|
|
||||||
else
|
|
||||||
# needed each time, php_install_ini would reset it
|
|
||||||
local dest="${PHP_DESTDIR#${EPREFIX}}"
|
|
||||||
into "${dest}"
|
|
||||||
case "$sapi" in
|
|
||||||
cli)
|
|
||||||
source="sapi/cli/php"
|
|
||||||
;;
|
|
||||||
cgi)
|
|
||||||
source="sapi/cgi/php-cgi"
|
|
||||||
;;
|
|
||||||
fpm)
|
|
||||||
source="sapi/fpm/php-fpm"
|
|
||||||
;;
|
|
||||||
embed)
|
|
||||||
source="libs/libphp${PHP_MV}$(get_libname)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "unhandled sapi in src_install"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [[ "${source}" == *"$(get_libname)" ]]; then
|
|
||||||
dolib.so "${source}"
|
|
||||||
else
|
|
||||||
dobin "${source}"
|
|
||||||
local name="$(basename ${source})"
|
|
||||||
dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
php_install_ini "${sapi}"
|
|
||||||
|
|
||||||
# construct correct SAPI string for php-config
|
|
||||||
# thanks to ferringb for the bash voodoo
|
|
||||||
if [[ "${sapi}" == "apache2" ]]; then
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }apache2handler"
|
|
||||||
else
|
|
||||||
sapi_list="${sapi_list:+${sapi_list} }${sapi}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Installing opcache module
|
|
||||||
if use_if_iuse opcache ; then
|
|
||||||
dolib.so "modules/opcache$(get_libname)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install env.d files
|
|
||||||
newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
|
|
||||||
sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
|
|
||||||
sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
|
|
||||||
|
|
||||||
# set php-config variable correctly (bug #278439)
|
|
||||||
sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
|
|
||||||
"${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
|
|
||||||
|
|
||||||
if use fpm ; then
|
|
||||||
if use systemd; then
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at.service" \
|
|
||||||
"php-fpm@${SLOT}.service"
|
|
||||||
else
|
|
||||||
systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
|
|
||||||
"php-fpm@${SLOT}.service"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
|
||||||
PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
|
|
||||||
if [[ ! -x "${PHP_BIN}" ]] ; then
|
|
||||||
ewarn "Test phase requires USE=cli, skipping"
|
|
||||||
return
|
|
||||||
else
|
|
||||||
export TEST_PHP_EXECUTABLE="${PHP_BIN}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
|
|
||||||
export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
|
|
||||||
fi
|
|
||||||
|
|
||||||
REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
|
|
||||||
"session.save_path=${T}" \
|
|
||||||
"${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
|
|
||||||
"session.save_path=${T}"
|
|
||||||
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
|
|
||||||
done
|
|
||||||
|
|
||||||
local failed="$(find -name '*.out')"
|
|
||||||
if [[ ${failed} != "" ]] ; then
|
|
||||||
ewarn "The following test cases failed unexpectedly:"
|
|
||||||
for name in ${failed}; do
|
|
||||||
ewarn " ${name/.out/}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "No unexpected test failures, all fine"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
|
|
||||||
local passed=""
|
|
||||||
for name in ${EXPECTED_TEST_FAILURES}; do
|
|
||||||
[[ -f "${name}.diff" ]] && continue
|
|
||||||
passed="${passed} ${name}"
|
|
||||||
done
|
|
||||||
if [[ ${passed} != "" ]] ; then
|
|
||||||
einfo "The following test cases passed unexpectedly:"
|
|
||||||
for name in ${passed}; do
|
|
||||||
ewarn " ${passed}"
|
|
||||||
done
|
|
||||||
else
|
|
||||||
einfo "None of the known-to-fail tests passed, all fine"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Output some general info to the user
|
|
||||||
if use apache2 ; then
|
|
||||||
APACHE2_MOD_DEFINE="PHP"
|
|
||||||
APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php
|
|
||||||
apache-module_pkg_postinst
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the symlinks for php
|
|
||||||
for m in ${SAPIS}; do
|
|
||||||
[[ ${m} == 'embed' ]] && continue;
|
|
||||||
if use $m ; then
|
|
||||||
local ci=$(eselect php show $m)
|
|
||||||
if [[ -z $ci ]]; then
|
|
||||||
eselect php set $m php${SLOT} || die
|
|
||||||
einfo "Switched ${m} to use php:${SLOT}"
|
|
||||||
einfo
|
|
||||||
elif [[ $ci != "php${SLOT}" ]] ; then
|
|
||||||
elog "To switch $m to use php:${SLOT}, run"
|
|
||||||
elog " eselect php set $m php${SLOT}"
|
|
||||||
elog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Remove dead symlinks for SAPIs that were just disabled. For
|
|
||||||
# example, if the user has the cgi SAPI enabled, then he has an
|
|
||||||
# eselect-php symlink for it. If he later reinstalls PHP with
|
|
||||||
# USE="-cgi", that symlink will break. This call to eselect is
|
|
||||||
# supposed to remove that dead link per bug 572436.
|
|
||||||
eselect php cleanup || die
|
|
||||||
|
|
||||||
elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes"
|
|
||||||
elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI."
|
|
||||||
elog
|
|
||||||
elog "This ebuild installed a version of php.ini based on"
|
|
||||||
elog "php.ini-${PHP_INI_VERSION}. You can choose which version of"
|
|
||||||
elog "php.ini to install by default by setting PHP_INI_VERSION"
|
|
||||||
elog "to either 'production' or 'development' in your make.conf."
|
|
||||||
elog "Both versions of php.ini can be found with the PHP docs in"
|
|
||||||
elog "${EPREFIX}/usr/share/doc/${PF}"
|
|
||||||
elog
|
|
||||||
elog "For more details on how version slotting works, please see"
|
|
||||||
elog "the wiki:"
|
|
||||||
elog
|
|
||||||
elog " https://wiki.gentoo.org/wiki/PHP"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postrm() {
|
|
||||||
# This serves two purposes. First, if we have just removed the last
|
|
||||||
# installed version of PHP, then this will remove any dead symlinks
|
|
||||||
# belonging to eselect-php. Second, if a user upgrades slots from
|
|
||||||
# (say) 5.6 to 7.0 and depcleans the old slot, then this will update
|
|
||||||
# his existing symlinks to point to the new 7.0 installation. The
|
|
||||||
# latter is bug 432962.
|
|
||||||
#
|
|
||||||
# Note: the eselect-php package may not be installed at this point,
|
|
||||||
# so we can't die() if this command fails.
|
|
||||||
eselect php cleanup
|
|
||||||
}
|
|
@ -1,2 +1 @@
|
|||||||
DIST rubinius-2.5.3.tar.bz2 11636033 SHA256 9af4d6e9d1e78a586579c86b9eb9a082cb863885d4a7cf33989d73280461e5fc SHA512 b923446d325dc3ce5ad28af9ee527607fae3259b85e85aeff97c1bebbb4520daf70616957b1c0ded900ed19e59025826dee66977c19cd2a2d4e9a0296811eb20 WHIRLPOOL 9ec26e62fde5d55153ce8f7fc8b57297fc365f94fc43d18c1a99c94823999494653e5d44ad1a27e31ae0803fc0c2d23d04fea7c7669210754236a9aa38e68b19
|
DIST rubinius-3.43.tar.bz2 13013106 SHA256 2c573257518774e464036515cc7283bc934a41566599afe94612c605844481ad SHA512 80ca70f1aeea2f48e9f4bbd9dc646e0fdabf266cde879fd6acb46bcc38140a2738fddf7d63fa72c386f0411046f457af02deb1162b249c7942bdc0e4a8138023 WHIRLPOOL 63f53a69a16772cfaa560cb5c8ed21dafe5b2eae221948be56f34b4a4755f878f3f9ff5ae7d181479770c1e9ca9c9be48a521d5e9465d1dc15c0641aca803d34
|
||||||
DIST rubinius-2.5.5.tar.bz2 11659850 SHA256 217659849ca2c67322d24ce7167e760dc835f32a701ca6e558703914ca82d02f SHA512 a862146ddbbdcd4439eb64e78bfe6d09ae4cca540d19869618426d3f451544658713fe8eb7d46493785eb0cc721077e624293cc44d68eea3ef584967b43a18d7 WHIRLPOOL 82e45406f330339a3dc06ee26cb0baf39bd4ab10147ebbfbe2eaf12c72e44fe683d3eff3156af0f09feee4bc3d50334d041f497727a6ae86fd24347f75a658ae
|
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
# Copyright 1999-2015 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
inherit eutils flag-o-matic multilib versionator
|
|
||||||
|
|
||||||
DESCRIPTION="A re-implementation of the Ruby VM designed for speed"
|
|
||||||
HOMEPAGE="http://rubini.us"
|
|
||||||
SRC_URI="http://releases.rubini.us/${P}.tar.bz2"
|
|
||||||
|
|
||||||
LICENSE="BSD"
|
|
||||||
KEYWORDS="~amd64"
|
|
||||||
SLOT="0"
|
|
||||||
IUSE="+llvm"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
llvm? ( >=sys-devel/llvm-3.2 )
|
|
||||||
dev-libs/openssl:0
|
|
||||||
sys-libs/ncurses
|
|
||||||
sys-libs/readline:0
|
|
||||||
dev-libs/libyaml
|
|
||||||
virtual/libffi
|
|
||||||
sys-libs/zlib
|
|
||||||
"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}
|
|
||||||
=dev-ruby/rake-10*
|
|
||||||
dev-ruby/bundler
|
|
||||||
"
|
|
||||||
|
|
||||||
pkg_setup() {
|
|
||||||
unset RUBYOPT
|
|
||||||
}
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
# src_test will wait until all processes are reaped, so tune down
|
|
||||||
# the long sleep process a bit.
|
|
||||||
sed -i -e 's/sleep 1000/sleep 300/' spec/ruby/core/io/popen_spec.rb || die
|
|
||||||
|
|
||||||
# Drop error CFLAGS per Gentoo policy.
|
|
||||||
sed -i -e '/Werror/ s:^:#:' rakelib/blueprint.rb || die
|
|
||||||
|
|
||||||
bundle --local || die
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
conf=""
|
|
||||||
if ! use llvm ; then
|
|
||||||
conf+="--disable-llvm "
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Rubinius uses a non-autoconf ./configure script which balks at econf
|
|
||||||
INSTALL="${EPREFIX}/usr/bin/install -c" ./configure \
|
|
||||||
--prefix /usr/$(get_libdir) \
|
|
||||||
--mandir /usr/share/man \
|
|
||||||
--without-rpath \
|
|
||||||
--with-vendor-zlib \
|
|
||||||
${conf} \
|
|
||||||
|| die "Configure failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
RBXOPT="-Xsystem.log=/dev/null" rake build || die "Compilation failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
rake spec || die "Tests failed"
|
|
||||||
einfo "Waiting for forked processes to die"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# The install phase tries to determine if there are relevant
|
|
||||||
addpredict /usr/local/lib64/ruby
|
|
||||||
|
|
||||||
local minor_version=$(get_version_component_range 1-2)
|
|
||||||
local librbx="usr/$(get_libdir)/rubinius"
|
|
||||||
|
|
||||||
RBXOPT="-Xsystem.log=/dev/null" DESTDIR="${D}" rake install || die "Installation failed"
|
|
||||||
|
|
||||||
dosym /${librbx}/bin/rbx /usr/bin/rbx || die "Couldn't make rbx symlink"
|
|
||||||
|
|
||||||
insinto /${librbx}/${minor_version}/site
|
|
||||||
doins "${FILESDIR}/auto_gem.rb" || die "Couldn't install rbx auto_gem.rb"
|
|
||||||
RBXOPT="-Xsystem.log=/dev/null" RBX_RUNTIME="${S}/runtime" RBX_LIB="${S}/lib" bin/rbx compile "${D}/${librbx}/${minor_version}/site/auto_gem.rb" || die "Couldn't bytecompile auto_gem.rb"
|
|
||||||
}
|
|
@ -1,230 +0,0 @@
|
|||||||
# Copyright 1999-2015 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
#PATCHSET=1
|
|
||||||
|
|
||||||
inherit autotools eutils flag-o-matic multilib versionator
|
|
||||||
|
|
||||||
RUBYPL=$(get_version_component_range 4)
|
|
||||||
|
|
||||||
MY_P="${PN}-$(get_version_component_range 1-3)-${RUBYPL:-0}"
|
|
||||||
S=${WORKDIR}/${MY_P}
|
|
||||||
|
|
||||||
SLOT=$(get_version_component_range 1-2)
|
|
||||||
MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
|
|
||||||
RUBYVERSION=2.0.0
|
|
||||||
|
|
||||||
if [[ -n ${PATCHSET} ]]; then
|
|
||||||
if [[ ${PVR} == ${PV} ]]; then
|
|
||||||
PATCHSET="${PV}-r0.${PATCHSET}"
|
|
||||||
else
|
|
||||||
PATCHSET="${PVR}.${PATCHSET}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
PATCHSET="${PVR}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="An object-oriented scripting language"
|
|
||||||
HOMEPAGE="http://www.ruby-lang.org/"
|
|
||||||
SRC_URI="mirror://ruby/2.0/${MY_P}.tar.xz
|
|
||||||
https://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
|
|
||||||
|
|
||||||
LICENSE="|| ( Ruby-BSD BSD-2 )"
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
|
|
||||||
IUSE="berkdb debug doc examples gdbm ipv6 +rdoc rubytests socks5 ssl xemacs ncurses +readline cpu_flags_x86_sse2"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
gdbm? ( sys-libs/gdbm )
|
|
||||||
ssl? ( dev-libs/openssl:0 )
|
|
||||||
socks5? ( >=net-proxy/dante-1.1.13 )
|
|
||||||
ncurses? ( sys-libs/ncurses:0= )
|
|
||||||
readline? ( sys-libs/readline:0 )
|
|
||||||
dev-libs/libyaml
|
|
||||||
virtual/libffi
|
|
||||||
sys-libs/zlib
|
|
||||||
>=app-eselect/eselect-ruby-20100402
|
|
||||||
!<dev-ruby/rdoc-3.9.4
|
|
||||||
!<dev-ruby/rubygems-1.8.10-r1"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}"
|
|
||||||
PDEPEND="
|
|
||||||
virtual/rubygems[ruby_targets_ruby20]
|
|
||||||
>=dev-ruby/json-1.7.7[ruby_targets_ruby20]
|
|
||||||
>=dev-ruby/rake-0.9.6[ruby_targets_ruby20]
|
|
||||||
rdoc? ( >=dev-ruby/rdoc-4.0.0[ruby_targets_ruby20] )
|
|
||||||
xemacs? ( app-xemacs/ruby-modes )"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
if use cpu_flags_x86_sse2 ; then
|
|
||||||
excluded_patches="012_no_forced_sse2.patch"
|
|
||||||
fi
|
|
||||||
|
|
||||||
EPATCH_EXCLUDE="${excluded_patches}" EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
|
|
||||||
epatch "${WORKDIR}/patches"
|
|
||||||
|
|
||||||
# We can no longer unbundle all of rake because rubygems now depends
|
|
||||||
# on this. We leave the actual rake code around to bootstrap
|
|
||||||
# rubygems, but remove the bits that would cause a file collision.
|
|
||||||
einfo "Unbundling gems..."
|
|
||||||
cd "$S"
|
|
||||||
rm -r \
|
|
||||||
{bin,lib}/rake lib/rake.rb man/rake.1 \
|
|
||||||
bin/gem || die "removal failed"
|
|
||||||
|
|
||||||
# Fix a hardcoded lib path in configure script
|
|
||||||
sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
|
|
||||||
configure.in || die "sed failed"
|
|
||||||
|
|
||||||
eautoreconf
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
local myconf=
|
|
||||||
|
|
||||||
# The Tk module can no longer be built because the module code is no
|
|
||||||
# longer compatible with newer stable versions.
|
|
||||||
# https://bugs.gentoo.org/show_bug.cgi?id=500894
|
|
||||||
local modules="tk"
|
|
||||||
|
|
||||||
# -fomit-frame-pointer makes ruby segfault, see bug #150413.
|
|
||||||
filter-flags -fomit-frame-pointer
|
|
||||||
# In many places aliasing rules are broken; play it safe
|
|
||||||
# as it's risky with newer compilers to leave it as it is.
|
|
||||||
append-flags -fno-strict-aliasing
|
|
||||||
# SuperH needs this
|
|
||||||
use sh && append-flags -mieee
|
|
||||||
|
|
||||||
# Socks support via dante
|
|
||||||
if use socks5 ; then
|
|
||||||
# Socks support can't be disabled as long as SOCKS_SERVER is
|
|
||||||
# set and socks library is present, so need to unset
|
|
||||||
# SOCKS_SERVER in that case.
|
|
||||||
unset SOCKS_SERVER
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Increase GC_MALLOC_LIMIT if set (default is 8000000)
|
|
||||||
if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
|
|
||||||
append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ipv6 hack, bug 168939. Needs --enable-ipv6.
|
|
||||||
use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
|
|
||||||
|
|
||||||
# Determine which modules *not* to build depending in the USE flags.
|
|
||||||
if ! use readline ; then
|
|
||||||
modules="${modules},readline"
|
|
||||||
fi
|
|
||||||
if ! use berkdb ; then
|
|
||||||
modules="${modules},dbm"
|
|
||||||
fi
|
|
||||||
if ! use gdbm ; then
|
|
||||||
modules="${modules},gdbm"
|
|
||||||
fi
|
|
||||||
if ! use ssl ; then
|
|
||||||
modules="${modules},openssl"
|
|
||||||
fi
|
|
||||||
if ! use ncurses ; then
|
|
||||||
modules="${modules},curses"
|
|
||||||
fi
|
|
||||||
|
|
||||||
INSTALL="${EPREFIX}/usr/bin/install -c" econf \
|
|
||||||
--program-suffix=${MY_SUFFIX} \
|
|
||||||
--with-soname=ruby${MY_SUFFIX} \
|
|
||||||
--docdir=${EPREFIX}/usr/share/doc/${P} \
|
|
||||||
--enable-shared \
|
|
||||||
--enable-pthread \
|
|
||||||
--disable-rpath \
|
|
||||||
--with-out-ext="${modules}" \
|
|
||||||
$(use_enable socks5 socks) \
|
|
||||||
$(use_enable doc install-doc) \
|
|
||||||
--enable-ipv6 \
|
|
||||||
$(use_enable debug) \
|
|
||||||
${myconf} \
|
|
||||||
--enable-option-checking=no \
|
|
||||||
|| die "econf failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
emake -j1 V=1 test || die "make test failed"
|
|
||||||
|
|
||||||
elog "Ruby's make test has been run. Ruby also ships with a make check"
|
|
||||||
elog "that cannot be run until after ruby has been installed."
|
|
||||||
elog
|
|
||||||
if use rubytests; then
|
|
||||||
elog "You have enabled rubytests, so they will be installed to"
|
|
||||||
elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
|
|
||||||
elog "than root, and you must place them into a writeable directory."
|
|
||||||
elog "Then call: "
|
|
||||||
elog
|
|
||||||
elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
|
|
||||||
else
|
|
||||||
elog "Enable the rubytests USE flag to install the make check tests"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# Remove the remaining bundled gems. We do this late in the process
|
|
||||||
# since they are used during the build to e.g. create the
|
|
||||||
# documentation.
|
|
||||||
rm -rf ext/json || die
|
|
||||||
|
|
||||||
# Ruby is involved in the install process, we don't want interference here.
|
|
||||||
unset RUBYOPT
|
|
||||||
|
|
||||||
local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
|
|
||||||
|
|
||||||
LD_LIBRARY_PATH="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
|
|
||||||
RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
|
|
||||||
for d in $(find "${S}/ext" -type d) ; do
|
|
||||||
RUBYLIB="${RUBYLIB}:$d"
|
|
||||||
done
|
|
||||||
export LD_LIBRARY_PATH RUBYLIB
|
|
||||||
|
|
||||||
emake V=1 DESTDIR="${D}" install || die "make install failed"
|
|
||||||
|
|
||||||
# Remove installed rubygems copy
|
|
||||||
rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
|
|
||||||
rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
|
|
||||||
rm -r "${D}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
|
|
||||||
|
|
||||||
if use doc; then
|
|
||||||
make DESTDIR="${D}" install-doc || die "make install-doc failed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if use examples; then
|
|
||||||
insinto /usr/share/doc/${PF}
|
|
||||||
doins -r sample
|
|
||||||
fi
|
|
||||||
|
|
||||||
dodoc ChangeLog NEWS doc/NEWS* README* || die
|
|
||||||
|
|
||||||
if use rubytests; then
|
|
||||||
pushd test
|
|
||||||
insinto /usr/share/${PN}-${SLOT}/test
|
|
||||||
doins -r .
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
|
|
||||||
eselect ruby set ruby${MY_SUFFIX}
|
|
||||||
fi
|
|
||||||
|
|
||||||
elog
|
|
||||||
elog "To switch between available Ruby profiles, execute as root:"
|
|
||||||
elog "\teselect ruby set ruby(19|20|...)"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postrm() {
|
|
||||||
eselect ruby cleanup
|
|
||||||
}
|
|
@ -1,227 +0,0 @@
|
|||||||
# Copyright 1999-2015 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
#PATCHSET=1
|
|
||||||
|
|
||||||
inherit autotools eutils flag-o-matic multilib versionator
|
|
||||||
|
|
||||||
RUBYPL=$(get_version_component_range 4)
|
|
||||||
|
|
||||||
MY_P="${PN}-$(get_version_component_range 1-3)"
|
|
||||||
#MY_P="${PN}-$(get_version_component_range 1-3)-${RUBYPL:-0}"
|
|
||||||
S=${WORKDIR}/${MY_P}
|
|
||||||
|
|
||||||
SLOT=$(get_version_component_range 1-2)
|
|
||||||
MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
|
|
||||||
RUBYVERSION=2.1.0
|
|
||||||
|
|
||||||
if [[ -n ${PATCHSET} ]]; then
|
|
||||||
if [[ ${PVR} == ${PV} ]]; then
|
|
||||||
PATCHSET="${PV}-r0.${PATCHSET}"
|
|
||||||
else
|
|
||||||
PATCHSET="${PVR}.${PATCHSET}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
PATCHSET="${PVR}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
DESCRIPTION="An object-oriented scripting language"
|
|
||||||
HOMEPAGE="http://www.ruby-lang.org/"
|
|
||||||
SRC_URI="mirror://ruby/2.1/${MY_P}.tar.xz
|
|
||||||
https://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
|
|
||||||
|
|
||||||
LICENSE="|| ( Ruby-BSD BSD-2 )"
|
|
||||||
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
|
|
||||||
IUSE="berkdb debug doc examples gdbm ipv6 +rdoc rubytests socks5 ssl xemacs ncurses +readline"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
berkdb? ( sys-libs/db:= )
|
|
||||||
gdbm? ( sys-libs/gdbm )
|
|
||||||
ssl? ( dev-libs/openssl:0 )
|
|
||||||
socks5? ( >=net-proxy/dante-1.1.13 )
|
|
||||||
ncurses? ( sys-libs/ncurses:0= )
|
|
||||||
readline? ( sys-libs/readline:0 )
|
|
||||||
dev-libs/libyaml
|
|
||||||
virtual/libffi
|
|
||||||
sys-libs/zlib
|
|
||||||
>=app-eselect/eselect-ruby-20131227
|
|
||||||
!<dev-ruby/rdoc-3.9.4
|
|
||||||
!<dev-ruby/rubygems-1.8.10-r1"
|
|
||||||
|
|
||||||
DEPEND="${RDEPEND}"
|
|
||||||
PDEPEND="
|
|
||||||
virtual/rubygems[ruby_targets_ruby21]
|
|
||||||
>=dev-ruby/json-1.8.1[ruby_targets_ruby21]
|
|
||||||
>=dev-ruby/rake-0.9.6[ruby_targets_ruby21]
|
|
||||||
rdoc? ( >=dev-ruby/rdoc-4.0.1[ruby_targets_ruby21] )
|
|
||||||
xemacs? ( app-xemacs/ruby-modes )"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
|
|
||||||
epatch "${WORKDIR}/patches"
|
|
||||||
|
|
||||||
# We can no longer unbundle all of rake because rubygems now depends
|
|
||||||
# on this. We leave the actual rake code around to bootstrap
|
|
||||||
# rubygems, but remove the bits that would cause a file collision.
|
|
||||||
einfo "Unbundling gems..."
|
|
||||||
cd "$S"
|
|
||||||
rm -r \
|
|
||||||
{bin,lib}/rake lib/rake.rb man/rake.1 \
|
|
||||||
bin/gem || die "removal failed"
|
|
||||||
|
|
||||||
# Fix a hardcoded lib path in configure script
|
|
||||||
sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
|
|
||||||
configure.in || die "sed failed"
|
|
||||||
|
|
||||||
eautoreconf
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
local myconf=
|
|
||||||
|
|
||||||
# The Tk module can no longer be built because the module code is no
|
|
||||||
# longer compatible with newer stable versions.
|
|
||||||
# https://bugs.gentoo.org/show_bug.cgi?id=500894
|
|
||||||
local modules="tk"
|
|
||||||
|
|
||||||
# -fomit-frame-pointer makes ruby segfault, see bug #150413.
|
|
||||||
filter-flags -fomit-frame-pointer
|
|
||||||
# In many places aliasing rules are broken; play it safe
|
|
||||||
# as it's risky with newer compilers to leave it as it is.
|
|
||||||
append-flags -fno-strict-aliasing
|
|
||||||
# SuperH needs this
|
|
||||||
use sh && append-flags -mieee
|
|
||||||
|
|
||||||
# Socks support via dante
|
|
||||||
if use socks5 ; then
|
|
||||||
# Socks support can't be disabled as long as SOCKS_SERVER is
|
|
||||||
# set and socks library is present, so need to unset
|
|
||||||
# SOCKS_SERVER in that case.
|
|
||||||
unset SOCKS_SERVER
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Increase GC_MALLOC_LIMIT if set (default is 8000000)
|
|
||||||
if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
|
|
||||||
append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ipv6 hack, bug 168939. Needs --enable-ipv6.
|
|
||||||
use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
|
|
||||||
|
|
||||||
# Determine which modules *not* to build depending in the USE flags.
|
|
||||||
if ! use readline ; then
|
|
||||||
modules="${modules},readline"
|
|
||||||
fi
|
|
||||||
if ! use berkdb ; then
|
|
||||||
modules="${modules},dbm"
|
|
||||||
fi
|
|
||||||
if ! use gdbm ; then
|
|
||||||
modules="${modules},gdbm"
|
|
||||||
fi
|
|
||||||
if ! use ssl ; then
|
|
||||||
modules="${modules},openssl"
|
|
||||||
fi
|
|
||||||
if ! use ncurses ; then
|
|
||||||
modules="${modules},curses"
|
|
||||||
fi
|
|
||||||
|
|
||||||
INSTALL="${EPREFIX}/usr/bin/install -c" econf \
|
|
||||||
--program-suffix=${MY_SUFFIX} \
|
|
||||||
--with-soname=ruby${MY_SUFFIX} \
|
|
||||||
--docdir=${EPREFIX}/usr/share/doc/${P} \
|
|
||||||
--enable-shared \
|
|
||||||
--enable-pthread \
|
|
||||||
--disable-rpath \
|
|
||||||
--with-out-ext="${modules}" \
|
|
||||||
$(use_enable socks5 socks) \
|
|
||||||
$(use_enable doc install-doc) \
|
|
||||||
--enable-ipv6 \
|
|
||||||
$(use_enable debug) \
|
|
||||||
${myconf} \
|
|
||||||
--enable-option-checking=no \
|
|
||||||
|| die "econf failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
emake -j1 V=1 test || die "make test failed"
|
|
||||||
|
|
||||||
elog "Ruby's make test has been run. Ruby also ships with a make check"
|
|
||||||
elog "that cannot be run until after ruby has been installed."
|
|
||||||
elog
|
|
||||||
if use rubytests; then
|
|
||||||
elog "You have enabled rubytests, so they will be installed to"
|
|
||||||
elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
|
|
||||||
elog "than root, and you must place them into a writeable directory."
|
|
||||||
elog "Then call: "
|
|
||||||
elog
|
|
||||||
elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
|
|
||||||
else
|
|
||||||
elog "Enable the rubytests USE flag to install the make check tests"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
# Remove the remaining bundled gems. We do this late in the process
|
|
||||||
# since they are used during the build to e.g. create the
|
|
||||||
# documentation.
|
|
||||||
rm -rf ext/json || die
|
|
||||||
|
|
||||||
# Ruby is involved in the install process, we don't want interference here.
|
|
||||||
unset RUBYOPT
|
|
||||||
|
|
||||||
local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
|
|
||||||
|
|
||||||
LD_LIBRARY_PATH="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
|
|
||||||
RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
|
|
||||||
for d in $(find "${S}/ext" -type d) ; do
|
|
||||||
RUBYLIB="${RUBYLIB}:$d"
|
|
||||||
done
|
|
||||||
export LD_LIBRARY_PATH RUBYLIB
|
|
||||||
|
|
||||||
emake V=1 DESTDIR="${D}" install || die "make install failed"
|
|
||||||
|
|
||||||
# Remove installed rubygems copy
|
|
||||||
rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
|
|
||||||
rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
|
|
||||||
rm -r "${D}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
|
|
||||||
|
|
||||||
if use doc; then
|
|
||||||
make DESTDIR="${D}" install-doc || die "make install-doc failed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if use examples; then
|
|
||||||
insinto /usr/share/doc/${PF}
|
|
||||||
doins -r sample
|
|
||||||
fi
|
|
||||||
|
|
||||||
dodoc ChangeLog NEWS doc/NEWS* README* || die
|
|
||||||
|
|
||||||
if use rubytests; then
|
|
||||||
pushd test
|
|
||||||
insinto /usr/share/${PN}-${SLOT}/test
|
|
||||||
doins -r .
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
|
|
||||||
eselect ruby set ruby${MY_SUFFIX}
|
|
||||||
fi
|
|
||||||
|
|
||||||
elog
|
|
||||||
elog "To switch between available Ruby profiles, execute as root:"
|
|
||||||
elog "\teselect ruby set ruby(19|20|...)"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postrm() {
|
|
||||||
eselect ruby cleanup
|
|
||||||
}
|
|
@ -0,0 +1,36 @@
|
|||||||
|
# Copyright 1999-2016 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
EAPI=6
|
||||||
|
|
||||||
|
inherit eutils
|
||||||
|
|
||||||
|
DESCRIPTION="The Simple Recursive Functions programming language"
|
||||||
|
HOMEPAGE="http://www.stratigery.com/srf.html"
|
||||||
|
SRC_URI="http://www.stratigery.com/srf.html/${P}.tar.gz"
|
||||||
|
|
||||||
|
LICENSE="GPL-2"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~x86 ~x86-linux ~ppc-macos ~amd64"
|
||||||
|
IUSE=""
|
||||||
|
|
||||||
|
DEPEND="
|
||||||
|
sys-devel/flex
|
||||||
|
virtual/yacc"
|
||||||
|
RDEPEND=""
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
default
|
||||||
|
# Remove CVS directory Bug#371821
|
||||||
|
ecvs_clean
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
dobin srf rfunc/rfunc
|
||||||
|
doman srf.1
|
||||||
|
dodoc README srf.html
|
||||||
|
|
||||||
|
docinto examples
|
||||||
|
dodoc examples/*
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
# Copyright 1999-2016 Gentoo Foundation
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
EAPI=6
|
||||||
|
|
||||||
|
inherit eutils elisp-common flag-o-matic wxwidgets
|
||||||
|
|
||||||
|
DESCRIPTION="a reflective, functional programming language"
|
||||||
|
HOMEPAGE="https://www.cs.berkeley.edu/~bh/logo.html"
|
||||||
|
SRC_URI="ftp://ftp.cs.berkeley.edu/pub/${PN}/${P}.tar.gz"
|
||||||
|
|
||||||
|
LICENSE="GPL-2"
|
||||||
|
SLOT="0"
|
||||||
|
KEYWORDS="~amd64 ~x86"
|
||||||
|
IUSE="X"
|
||||||
|
|
||||||
|
DEPEND="
|
||||||
|
app-text/texi2html
|
||||||
|
dev-libs/libbsd
|
||||||
|
virtual/tex-base
|
||||||
|
virtual/texi2dvi
|
||||||
|
X? ( x11-libs/wxGTK:2.8[X] )"
|
||||||
|
|
||||||
|
PATCHES=(
|
||||||
|
"${FILESDIR}"/${P}-wx.patch
|
||||||
|
"${FILESDIR}"/${P}-no-libtermcap.patch
|
||||||
|
"${FILESDIR}"/${P}-texi.patch
|
||||||
|
"${FILESDIR}"/${P}-destdir.patch
|
||||||
|
)
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
default
|
||||||
|
|
||||||
|
sed -i -e "/math.h/d" coms.c || die
|
||||||
|
sed -i -e "/math.h/d" graphics.c || die
|
||||||
|
|
||||||
|
WX_GTK_VER=2.8 need-wxwidgets unicode
|
||||||
|
sed -i -e "s_/usr/local/bin/wx-config_${WX_CONFIG}_g" configure-gtk || die
|
||||||
|
sed -i -e 's_--host=gtk__g' configure-gtk || die
|
||||||
|
sed -i -e "s_/lib/logo_/lib/${P}_" makefile.in || die
|
||||||
|
sed -i -e "/doc$/s_\$_/${P}_" docs/makefile || die
|
||||||
|
|
||||||
|
rm -rf csls/CVS || die
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
local confsuffix
|
||||||
|
|
||||||
|
use X && confsuffix="-gtk"
|
||||||
|
"./configure${confsuffix}" --prefix=/usr $(use_with X x) || die
|
||||||
|
}
|
||||||
|
|
||||||
|
src_compile() {
|
||||||
|
strip-flags
|
||||||
|
emake CC="$(tc-getCC)" everything
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue