commit:     0b67931ad054c8d109ea89faa8844b1f5a02e8ec
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 26 00:17:53 2017 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Jul 26 00:17:53 2017 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=0b67931a

Install the php-fpm init scripts conditional on --enable-fpm.

 Makefile.am  | 13 +++++++++----
 configure.ac | 12 ++++++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 15b0ca8..08359dc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,9 +1,5 @@
 eselectdir = $(datadir)/eselect/modules
 nodist_eselect_DATA = $(srcdir)/src/php.eselect
-initdir = $(sysconfdir)/init.d
-confdir = $(sysconfdir)/conf.d
-nodist_init_SCRIPTS = $(srcdir)/openrc/php-fpm
-nodist_conf_DATA = $(srcdir)/openrc/php-fpm.conf
 
 # Without EXTRA_DIST, these files don't wind up in the tarball.
 EXTRA_DIST = $(srcdir)/src/70_mod_php.conf.in openrc/*.*
@@ -14,6 +10,15 @@ if APACHE2
   nodist_apacheconf_DATA = $(srcdir)/src/70_mod_php.conf
 endif
 
+if FPM
+  # Same as the APACHE2 conditional.
+  initdir = $(sysconfdir)/init.d
+  nodist_init_SCRIPTS = $(srcdir)/openrc/php-fpm
+
+  confdir = $(sysconfdir)/conf.d
+  nodist_conf_DATA = $(srcdir)/openrc/php-fpm.conf
+endif
+
 # The next few rules allow us to replace bindir, libdir, etc.
 # within our script and conf file. The example is taken
 # from the autoconf documentation and can be found in the

diff --git a/configure.ac b/configure.ac
index 5e6ccfc..02aeaf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,18 @@ AC_ARG_ENABLE(
   esac],[apache2=false])
   AM_CONDITIONAL([APACHE2], [test x$apache2 = xtrue])
 
+# --enable-fpm flag, disabled by default, that decides whether or
+# not we install the php-fpm init script and config file.
+AC_ARG_ENABLE(
+       [fpm],
+       [  --enable-fpm    install the php-fpm init script [[default=no]]],
+       [case "${enableval}" in
+    yes) fpm=true ;;
+    no)  fpm=false ;;
+    *) AC_MSG_ERROR([bad value ${enableval} for --enable-fpm]) ;;
+  esac],[fpm=false])
+  AM_CONDITIONAL([FPM], [test x$fpm = xtrue])
+
 piddir=${piddir="@LOCALSTATEDIR@"}
 AC_ARG_WITH(piddir, AC_HELP_STRING([--with-piddir=DIR],
        [where php-fpm PID files are placed [LOCALSTATEDIR]]),

Reply via email to