aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Shelton <stuart@shelton.me>2016-02-15 14:43:42 +0000
committerStuart Shelton <stuart@shelton.me>2016-02-15 14:43:42 +0000
commit5aff4cc981343bf7a5da3c7087af62dee67d9dcf (patch)
tree933ddc0b286a4142769f10f5cc7375db947545f4 /app-eselect
parentUpdate sys-apps/iproute2-4.3.0 (diff)
downloadsrcshelton-5aff4cc981343bf7a5da3c7087af62dee67d9dcf.tar.gz
srcshelton-5aff4cc981343bf7a5da3c7087af62dee67d9dcf.tar.bz2
srcshelton-5aff4cc981343bf7a5da3c7087af62dee67d9dcf.zip
Add app-eselect/eselect-php-0.9.1
Diffstat (limited to 'app-eselect')
-rw-r--r--app-eselect/eselect-php/Manifest3
-rw-r--r--app-eselect/eselect-php/eselect-php-0.9.1.ebuild68
-rw-r--r--app-eselect/eselect-php/files/php-fpm.init-r470
3 files changed, 141 insertions, 0 deletions
diff --git a/app-eselect/eselect-php/Manifest b/app-eselect/eselect-php/Manifest
index e082a0ba..1f459a67 100644
--- a/app-eselect/eselect-php/Manifest
+++ b/app-eselect/eselect-php/Manifest
@@ -3,8 +3,11 @@ AUX 70_mod_php5.conf-apache2-r1 486 SHA256 83c041f18919c04ec31c2bf7491fbf9465a5c
AUX php-fpm-launcher 134 SHA256 d7e944a016a8a282b9a684de1820c8e5c00791c27471a528b1ee8dc620eb83e8 SHA512 4304ea6df7093af06f1b7df5bf5d8ed7692403cc64a5c4c516e49d36fa866b33e4815876d28cc365f5ccb1e301ef7ce9b57e15ed959a41c91fb25af7236fed29 WHIRLPOOL f6123fb338a10e23f21616ab1bbfa385289748cff9523c2a1d39e82f53f104eacc0f3b088794a12b678551b7d8ef1b6262480882b62ce38067e923e7592b4629
AUX php-fpm-r1.init 1207 SHA256 59ac0166b12eb454b6d0c92694b3d54cce3b3fb92cc0c9fbe0ac9f9ed9ca2cc5 SHA512 ec8f2d74e4c4c7f36bb9207386bbc4f705547829e2e0282f2799d224f42ebc6ee3a021b6be6e6597b16bf64316421687de80eb446134e42c6c7310d4027725af WHIRLPOOL 751cd97fe962ba7177f346a4280b619c98b622214df6d9a626519d29e2a3ae71e292e1ff5fb384b9ff570865087f877f61dee017b101c409e3d743e0ab228c76
AUX php-fpm.conf 33 SHA256 99f2c030d6d37c8f846c9d06ac1953d82750725f2eaff65dded5e0e2a1e2556a SHA512 5c5bcc95343ffc31066276eca98a771082a27e3d015827a97d3d9d6cd837c41064a560cedd92df2388a4f2c139a0bfe5ead8e5e27f4b8149a1b6beb60a01a5a5 WHIRLPOOL bf9e56395425224c8f08680e12e5ba33d6c3ca7be036a2d93db473221e610440b191992ac1ab40185e944c2bbda288fde2cacf12905250ea895a6c48e0679312
+AUX php-fpm.init-r4 1908 SHA256 df18eb5f87be879c3fd842b5045b1ab9d889563e4fd71c8b69e8ebbd42e4f799 SHA512 9e9a2f90a6d51950af8573fe75acbcc9e00c8e182e89d93b3dc9d645285334d56f7c285e651812a154231eb56acdd117a1d742f60e38a14f12c4d713234bcfe3 WHIRLPOOL 4bffc6ee647b70aac96e902a1fe1d0f8f319ce3c616143d3c15c6731b8e83f03ab73aaa8198962aad92a1511444f589277dfe7b9c9a06847612c4c0ae9ae5380
AUX php-fpm_at.service 321 SHA256 2bd9ae1dacba4db39c4dc39000c6450234dd6fce06be6fe32cbd6adb96d56b50 SHA512 298c05211748212b00ea9b1debb1cde04df0ca3bde6ee5e30634c510e4c4bdc5bf8dcb998f63a5a3bb232dabb53ebc105ab5bd10c4de21863b5744363d80cbe6 WHIRLPOOL 415686e54ac9da2b051ba5a1c9a65952d683f03f7e434c4a8f74f5176a5d591f570b5fb1314e4b793568ff3d6eac944d9e12e4b71dc31447f36a8e3d6845630d
DIST eselect-php-0.7.1.bz2 2251 SHA256 10aa400e2d08bc71989366993f12ddb546a0ea29f191c40e37beba1d11d7abd7 SHA512 a6b4c1475dda9f368d799db7658c50cef7d6f71482a53a186fb1394e7ea1fff3c0ef123c82b7ca4d1e45aadb0a034d36f213fc9450766878a60d28639761cb3d WHIRLPOOL a4e45492068616ff30fd888b0cc64441a6eb6e6656e0107d00bd2cf15360dce15052d4d62089ab89d43e6bb36e126529aa101c70e8bd94a9fc916a5369463e3b
+DIST eselect-php-0.9.1.tar.xz 47548 SHA256 0c9768c9dd361dd3910f26e11956fc2121467ab56c52ba80d7620b1d757bc143 SHA512 bea84b4ae386d60cea2703d1b1c2a91bdc19188dfe151619750a1979dcfbdf2a2ada05d87faa7e0f371ab003e05be6fc7dd15f96459ae6e998c62e6d5caeb64a WHIRLPOOL 3d74edfa6962942836aa3823e9901b461433ce57f2fcb624eb1652b36245599a1bc076db5cb902b675747f2255f00ac887a5e35859dbcf62279944595ea02d6c
EBUILD eselect-php-0.7.1-r2.ebuild 1358 SHA256 e6b2bcea9ab338b8356d3df97370451da1836674610d14d141fe214df9947b1f SHA512 17fbf652b6f338783bf3e6f1927fe2fa638e89ede27d96a02896461c21ac7673b6f103cc20cfefd8ded7a3cfc334ee0bd4acd9ac63b384733d756f7e76e126fc WHIRLPOOL 9d4210c971eb0a158418d335b50e0e478f91a2be919630ca9e88c567593f15eb299ef875cead7d3da1dfc4fc21ba1b16d3765e796ba45e5de7f44984a6c8c4dd
EBUILD eselect-php-0.7.1-r3.ebuild 1285 SHA256 e01dfaed85ae348cf88d3954753509b0021138d2d5e289edabb4608ca66062ba SHA512 cd1268b9dd6fb070d24cd0beaa06adeaf977cfdce379532c01b4a4a6301e02b08854ee10d5f23b753ca43a390f520027aba736bef82022de9e761a6c6b509501 WHIRLPOOL 4b5220c024fb1e41b82813983e98cf24c86bcea15f86f3959f0ddcecd88a875ca91234618e9365f92ae4f88169b0e8748dce8306ae889bdfd7ef422e51d540a5
EBUILD eselect-php-0.7.1-r4.ebuild 1322 SHA256 2dd6f164e481eba402052bd5fab9fdd73e689df0e42ddd66955f8174cd3de959 SHA512 29a6dd0bca9c379587fe0203e5dbd4fc50b1bb1ab6ae940934ceead545b144291f622a79381df0e73ead17185c7fbf85ca1124b0e2fa6bd39fe284176ad9396a WHIRLPOOL 90c1d7de188905810b7505aa65ab809e0d50e9ff01863ebe062e14724c1af05060b3af0e58a46d29f31df6a240dd64f422e4d862b96c00be14fa77a1c10e554e
+EBUILD eselect-php-0.9.1.ebuild 2183 SHA256 eb4a7672ba8178669822f0c415c1becc5819c21f40217df1e4b224919e86731e SHA512 0e6316159550c13b886a36d5a64e08478aaea8fef3707cf66dc1a422a076dedc1708233c50ca5123bf7a97f1f3b01dcdc97dd3a07f9dfbe068c440c7b000f024 WHIRLPOOL 24274f2243657b238f41b3fb47a6dd9a71063c4d12e72fd5ca5d5ac39c049a410fcad51aeee216f7ac44d62909db87b4259900f5e154eec5960175fba87c3bf2
diff --git a/app-eselect/eselect-php/eselect-php-0.9.1.ebuild b/app-eselect/eselect-php/eselect-php-0.9.1.ebuild
new file mode 100644
index 00000000..4c5e2c29
--- /dev/null
+++ b/app-eselect/eselect-php/eselect-php-0.9.1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: 419ffab344b24403af0cab4de006bbf8b52f424d $
+
+EAPI=6
+
+inherit depend.apache systemd
+
+DESCRIPTION="PHP eselect module"
+HOMEPAGE="https://gitweb.gentoo.org/proj/eselect-php.git/"
+SRC_URI="
+ https://dev.gentoo.org/~mjo/distfiles/${P}.tar.xz
+ https://dev.gentoo.org/~grknight/distfiles/${P}.tar.xz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~arm64 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"
+IUSE="fpm apache2 systemd"
+
+# The "DirectoryIndex" line in 70_mod_php.conf requires mod_dir.
+RDEPEND="app-admin/eselect
+ apache2? ( www-servers/apache[apache2_modules_dir] )"
+
+want_apache
+
+src_configure(){
+ # We expect localstatedir to be "var"ish, not "var/lib"ish, because
+ # that's what PHP upstream expects. See for example the FPM
+ # configuration where they put logs in @localstatedir@/log.
+ econf --localstatedir="${EPREFIX}"/var $(use_enable apache2)
+}
+
+src_install() {
+ default
+
+ # After a while, this can go, along with the want_apache call and
+ # depend.apache eclass.
+ if use apache2 ; then
+ insinto "${APACHE_MODULES_CONFDIR#${EPREFIX}}"
+ newins "${FILESDIR}/70_mod_php5.backcompat.conf" 70_mod_php5.conf
+ fi
+
+ if use fpm ; then
+ newinitd "${FILESDIR}/php-fpm.init-r4" "php-fpm"
+ if use systemd ; then
+ systemd_dotmpfilesd "${FILESDIR}/php-fpm.conf"
+ fi
+ exeinto /usr/libexec
+ doexe "${FILESDIR}/php-fpm-launcher"
+ fi
+}
+
+pkg_postinst() {
+ if use apache2 ; then
+ elog
+ elog "If you are upgrading, be warned that our mod_php configuration"
+ elog "file has changed! You should now define -DPHP for the apache2"
+ elog "daemon, and inspect the new 70_mod_php.conf which has been"
+ elog "installed. Module loading involves eselect as of this version."
+ elog
+ elog "You must run eselect at least once to choose your apache2 target"
+ elog "before the new configuration will work. Afterwards, and after you"
+ elog "have reviewed your new configuration, you are advised to remove"
+ elog "the obsolete 70_mod_php5.conf file."
+ elog
+ fi
+}
diff --git a/app-eselect/eselect-php/files/php-fpm.init-r4 b/app-eselect/eselect-php/files/php-fpm.init-r4
new file mode 100644
index 00000000..0d871ed0
--- /dev/null
+++ b/app-eselect/eselect-php/files/php-fpm.init-r4
@@ -0,0 +1,70 @@
+#!/sbin/openrc-run
+
+extra_started_commands="reload"
+extra_commands="configtest"
+
+set_phpvars() {
+ PHPSLOT="${SVCNAME#php-fpm-}"
+ PHP_FPM_PID="/run/php-fpm-${PHPSLOT}.pid"
+ if [ "${PHPSLOT}" = "php-fpm" ] ; then
+ PHPSLOT="$(eselect php show fpm)"
+ PHP_FPM_PID="/var/run/php-fpm.pid"
+ fi
+
+ PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf"
+ PHP_FPM_BIN="/usr/lib/${PHPSLOT}/bin/php-fpm"
+}
+
+start() {
+ # If configtest fails, we don't have to sit around for five
+ # seconds waiting for a pid to show up.
+ configtest || return $?
+ ebegin "Starting PHP FastCGI Process Manager"
+ set_phpvars
+ start-stop-daemon --start --pidfile "${PHP_FPM_PID}" \
+ --exec "${PHP_FPM_BIN}" \
+ -- \
+ --fpm-config "${PHP_FPM_CONF}" \
+ --pid "${PHP_FPM_PID}"
+ local i=0
+ local timeout=5
+ while [ ! -f "${PHP_FPM_PID}" ] && [ $i -le $timeout ]; do
+ sleep 1
+ i=$(($i + 1))
+ done
+
+ [ $timeout -gt $i ]
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping PHP FastCGI Process Manager"
+ set_phpvars
+ start-stop-daemon --signal QUIT \
+ --stop \
+ --exec "${PHP_FPM_BIN}" \
+ --pidfile "${PHP_FPM_PID}"
+ eend $?
+}
+
+reload() {
+ configtest || return $?
+ ebegin "Reloading PHP FastCGI Process Manager"
+ set_phpvars
+ [ -f "${PHP_FPM_PID}" ] && kill -USR2 $(cat "${PHP_FPM_PID}")
+ eend $?
+}
+
+configtest() {
+ ebegin "Testing PHP FastCGI Process Manager configuration"
+ set_phpvars
+ # Hide the "test is successful" message (which goes to stderr) if
+ # the test passed, but show the entire output if the test failed
+ # because it may contain hints about the problem.
+ OUTPUT=$( "${PHP_FPM_BIN}" --fpm-config "${PHP_FPM_CONF}" --test 2>&1 )
+
+ # Save this so `echo` doesn't clobber it.
+ local exit_code=$?
+ [ $exit_code -ne 0 ] && echo "${OUTPUT}" >&2
+ eend $exit_code
+}