diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile.am | 10 | ||||
-rw-r--r-- | src/php-fpm-launcher.in | 11 |
3 files changed, 20 insertions, 2 deletions
@@ -11,3 +11,4 @@ openrc/init.d/php-fpm openrc/init.d/php-fpm.in src/php.eselect src/php.eselect.in +src/php-fpm-launcher diff --git a/Makefile.am b/Makefile.am index f351b49..fbca127 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,9 @@ eselectdir = $(datadir)/eselect/modules nodist_eselect_DATA = $(srcdir)/src/php.eselect # Without EXTRA_DIST, these files don't wind up in the tarball. -EXTRA_DIST = $(srcdir)/src/70_mod_php.conf.in openrc +EXTRA_DIST = $(srcdir)/openrc \ + $(srcdir)/src/70_mod_php.conf.in \ + $(srcdir)/src/php-fpm-launcher.in if APACHE2 # Without these set, we won't try to install the conf file. @@ -17,6 +19,8 @@ if FPM confdir = $(sysconfdir)/conf.d nodist_conf_DATA = $(srcdir)/openrc/conf.d/php-fpm + + nodist_libexec_SCRIPTS = $(srcdir)/src/php-fpm-launcher endif # The next few rules allow us to replace bindir, libdir, etc. @@ -29,7 +33,8 @@ edit = sed -e 's|@BINDIR[@]|$(bindir)|g' \ -e 's|@LOCALSTATEDIR[@]|$(localstatedir)|g' \ -e 's|@SYSCONFDIR[@]|$(sysconfdir)|g' -$(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS): Makefile + +$(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS) $(nodist_libexec_SCRIPTS): Makefile rm -f $@ $@.tmp srcdir=''; \ test -f ./$@.in || srcdir=$(srcdir)/; \ @@ -37,5 +42,6 @@ $(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS): Makefil mv $@.tmp $@ $(srcdir)/src/php.eselect: $(srcdir)/src/php.eselect.in +$(srcdir)/src/php-fpm-launcher: $(srcdir)/src/php-fpm-launcher.in $(srcdir)/src/70_mod_php.conf: $(srcdir)/src/70_mod_php.conf.in $(srcdir)/openrc/init.d/php-fpm: $(srcdir)/openrc/init.d/php-fpm.in diff --git a/src/php-fpm-launcher.in b/src/php-fpm-launcher.in new file mode 100644 index 0000000..940cec9 --- /dev/null +++ b/src/php-fpm-launcher.in @@ -0,0 +1,11 @@ +#!/bin/sh + +# If there are no arguments, then "shift" will fail (bug 626496). +if [ $# -eq 0 ]; then + PHP_SLOT=$(eselect php show fpm) +else + PHP_SLOT=$1 + shift +fi + +exec "@LIBDIR@/${PHP_SLOT}/bin/php-fpm" "${@}" |