public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/eselect-php:master commit in: /, src/
@ 2016-01-22  3:15 Michael Orlitzky
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2016-01-22  3:15 UTC (permalink / raw
  To: gentoo-commits

commit:     1d1a53e19a9dab621249c1cdf698e2aec30d5d1a
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 22 00:30:25 2016 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Fri Jan 22 00:45:28 2016 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=1d1a53e1

Add 70_mod_php.conf.in to the project source.

We are currently shipping 70_mod_php.conf as part of the Gentoo ebuild
for eselect-php. This introduces a potential disconnect between the
path in php.eselect and the path in 70_mod_php.conf. By adding the
conf file to the project, we are able to ensure that they are both
set to the same value. Moreover, the new autotools directory magic
lets us set them both based on @localstatedir@. So, for example, in
the conf file we have "@localstatedir <AT> /lib/eselect-php/mod_php.conf"
and in php.eselect we have "@localstatedir@/lib/eselect-php".

We have followed the PHP project's lead in assuming that
$localstatedir will be set to (for example) /var and not /var/lib.
See Gentoo bug 572002. For testing, you should now use something like,

  ./configure --bindir=/usr/bin --sysconfdir=/etc --localstatedir=/var

Of course, the ebuild for eselect-php will automatically pass the
correct values to ./configure.

 Makefile.am            |  6 +++++-
 src/70_mod_php.conf.in | 24 ++++++++++++++++++++++++
 src/php.eselect.in.in  |  2 +-
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 073abf9..9487f1b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,9 @@
 eselectdir = $(datadir)/eselect/modules
 nodist_eselect_DATA = $(srcdir)/src/php.eselect
 
+apacheconfdir = $(sysconfdir)/apache2/modules.d
+nodist_apacheconf_DATA = $(srcdir)/src/70_mod_php.conf
+
 # The next few rules allow us to replace bindir, libdir, and
 # localstatedir within our script and conf file. The example is taken
 # from the autoconf documentation and can be found in the
@@ -9,7 +12,7 @@ edit = sed -e 's|@bindir[@]|$(bindir)|g' \
            -e 's|@libdir[@]|$(libdir)|g' \
            -e 's|@localstatedir[@]|$(localstatedir)|g'
 
-$(nodist_eselect_DATA): Makefile
+$(nodist_eselect_DATA) $(nodist_apacheconf_DATA): Makefile
 	rm -f $@ $@.tmp
 	srcdir=''; \
 	  test -f ./$@.in || srcdir=$(srcdir)/; \
@@ -17,3 +20,4 @@ $(nodist_eselect_DATA): Makefile
 	mv $@.tmp $@
 
 $(srcdir)/src/php.eselect: $(srcdir)/src/php.eselect.in
+$(srcdir)/src/70_mod_php.conf: $(srcdir)/src/70_mod_php.conf.in

diff --git a/src/70_mod_php.conf.in b/src/70_mod_php.conf.in
new file mode 100644
index 0000000..4b97354
--- /dev/null
+++ b/src/70_mod_php.conf.in
@@ -0,0 +1,24 @@
+<IfDefine PHP>
+	# The mod_php.so symlink is controlled by
+	# eselect-php. However, the module name changed from
+	# php5_module to php7_module so we can't blindly load whatever
+	# is there. Instead we let eselect-php manage a small
+	# configuration file that loads the appropriate module.
+	Include "@localstatedir@/lib/eselect-php/mod_php.conf"
+
+	# Tell apache that mod_php should handle PHP files.
+	#
+	# NOTE: Avoiding AddHandler/AddType for security (bug
+	# #538822). Please read the related news item!
+	<FilesMatch "\.(php|php[57]|phtml)$">
+		SetHandler application/x-httpd-php
+	</FilesMatch>
+
+	# PHP source files which are meant to be displayed as
+	# syntax-highlighted source code.
+	<FilesMatch "\.phps$">
+		SetHandler application/x-httpd-php-source
+	</FilesMatch>
+
+	DirectoryIndex index.php index.phtml
+</IfDefine>

diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in
index e24cd39..689b1db 100644
--- a/src/php.eselect.in.in
+++ b/src/php.eselect.in.in
@@ -332,7 +332,7 @@ get_sapi_active_target() {
 #
 write_mod_php_conf() {
 	local target="${1}"
-	local conf_dir="${EROOT}"/var/lib/eselect-php
+	local conf_dir="@localstatedir@/lib/eselect-php"
 	local conf_path="${conf_dir}/mod_php.conf"
 
 	@MKDIR_P@ "${conf_dir}" || die "failed to create ${conf_dir}"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/eselect-php:master commit in: /, src/
@ 2020-01-23 15:06 Michael Orlitzky
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2020-01-23 15:06 UTC (permalink / raw
  To: gentoo-commits

commit:     4b7d40cb0dd5213674766c48193efba1da74edff
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 22 17:22:26 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Jan 22 22:51:43 2020 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=4b7d40cb

src/php-fpm.logrotate.in: add a logrotate script for php-fpm.

Since all of the log files for php-fpm wind up in the same place
regardless of slot, we install a single logrotate file as part of
eselect-php. The contents of the file may not be perfect -- they were
taken from the example submitted on bug 692194 untested -- but will be
easy to update in the future.

Bug: https://bugs.gentoo.org/692194
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .gitignore               | 1 +
 Makefile.am              | 9 +++++++--
 src/php-fpm.logrotate.in | 7 +++++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9bfa566..420a5c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@ openrc/init.d/php-fpm.in
 src/php.eselect
 src/php.eselect.in
 src/php-fpm-launcher
+src/php-fpm.logrotate

diff --git a/Makefile.am b/Makefile.am
index f544739..e425c84 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,8 @@ nodist_eselect_DATA = $(srcdir)/src/php.eselect
 # Without EXTRA_DIST, these files don't wind up in the tarball.
 EXTRA_DIST = $(srcdir)/openrc \
              $(srcdir)/src/70_mod_php.conf.in \
-             $(srcdir)/src/php-fpm-launcher.in
+             $(srcdir)/src/php-fpm-launcher.in \
+             $(srcdir)/src/php-fpm.logrotate.in
 
 if APACHE2
   # Without these set, we won't try to install the conf file.
@@ -22,6 +23,9 @@ if FPM
 
   nodist_libexec_SCRIPTS = $(srcdir)/src/php-fpm-launcher
 
+  logrotatedir = $(sysconfdir)/logrotate.d
+  nodist_logrotate_DATA = $(srcdir)/src/php-fpm.logrotate
+
   tmpfilesdir = $(prefix)/lib/tmpfiles.d
   dist_tmpfiles_DATA = $(srcdir)/src/php-fpm.conf
 endif
@@ -37,7 +41,7 @@ edit = sed -e 's|@BINDIR[@]|$(bindir)|g' \
            -e 's|@SYSCONFDIR[@]|$(sysconfdir)|g'
 
 
-$(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS) $(nodist_libexec_SCRIPTS): Makefile
+$(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS) $(nodist_libexec_SCRIPTS) $(nodist_logrotate_DATA): Makefile
 	rm -f $@ $@.tmp
 	srcdir=''; \
 	  test -f ./$@.in || srcdir=$(srcdir)/; \
@@ -46,5 +50,6 @@ $(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS) $(nodist
 
 $(srcdir)/src/php.eselect: $(srcdir)/src/php.eselect.in
 $(srcdir)/src/php-fpm-launcher: $(srcdir)/src/php-fpm-launcher.in
+$(srcdir)/src/php-fpm.logrotate: $(srcdir)/src/php-fpm.logrotate.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.logrotate.in b/src/php-fpm.logrotate.in
new file mode 100644
index 0000000..5847fdc
--- /dev/null
+++ b/src/php-fpm.logrotate.in
@@ -0,0 +1,7 @@
+@LOCALSTATEDIR@/log/php-fpm.log @LOCALSTATEDIR@/log/php-fpm-*.log.slow {
+  create 600 root root
+  size 5M
+  copytruncate
+  notifempty
+  missingok
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/eselect-php:master commit in: /, src/
@ 2020-01-23 15:06 Michael Orlitzky
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2020-01-23 15:06 UTC (permalink / raw
  To: gentoo-commits

commit:     355d4102019daaafd9f803bf4435af127e315988
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 22 15:05:57 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Jan 22 17:15:08 2020 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=355d4102

src/php-fpm-launcher.in: add php-fpm-launcher wrapper script.

While OpenRC services are powerful enough to compute the selected
version of php-fpm, the corresponding systemd services are not and
must use a fixed path. The executable at that fixed path must
therefore decide which version of php-fpm to run before running it.
This commit adds a script to do just that.

This script is already present in the app-eselect/eselect-php
package, tacked on from $FILESDIR. It's a better fit as part of
the repository.

Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .gitignore              |  1 +
 Makefile.am             | 10 ++++++++--
 src/php-fpm-launcher.in | 11 +++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 97ae412..9bfa566 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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" "${@}"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/eselect-php:master commit in: /, src/
@ 2020-01-23 15:06 Michael Orlitzky
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Orlitzky @ 2020-01-23 15:06 UTC (permalink / raw
  To: gentoo-commits

commit:     5e69b74fc8c9542faa6891c56b736f1d73da3202
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 22 17:19:33 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Jan 22 22:44:15 2020 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=5e69b74f

src/php-fpm.conf: move the php-fpm tmpfiles.d entry "upstream."

The tmpfiles.d entry for php-fpm creates one "runstate" directory for
all slots of php-fpm. Since none of that depends on the currently
selected slot, we ship it as part of eselect-php rather than
dev-lang/php which would either install one copy for each slot.

Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 Makefile.am      | 3 +++
 src/php-fpm.conf | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index fbca127..f544739 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,6 +21,9 @@ if FPM
   nodist_conf_DATA = $(srcdir)/openrc/conf.d/php-fpm
 
   nodist_libexec_SCRIPTS = $(srcdir)/src/php-fpm-launcher
+
+  tmpfilesdir = $(prefix)/lib/tmpfiles.d
+  dist_tmpfiles_DATA = $(srcdir)/src/php-fpm.conf
 endif
 
 # The next few rules allow us to replace bindir, libdir, etc.

diff --git a/src/php-fpm.conf b/src/php-fpm.conf
new file mode 100644
index 0000000..a49ba7b
--- /dev/null
+++ b/src/php-fpm.conf
@@ -0,0 +1,5 @@
+# tmpfiles.d entry for php-fmp
+#
+# When autoconf-2.70 is released and --runstatedir is supported,
+# we should change this /run to @RUNSTATEDIR@.
+d /run/php-fpm 755 root root


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-23 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-23 15:06 [gentoo-commits] proj/eselect-php:master commit in: /, src/ Michael Orlitzky
  -- strict thread matches above, loose matches on Subject: below --
2020-01-23 15:06 Michael Orlitzky
2020-01-23 15:06 Michael Orlitzky
2016-01-22  3:15 Michael Orlitzky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox