Skip to content

Commit

Permalink
These extra configuration are needed for building the debian package
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamcat4 committed Aug 20, 2009
1 parent 528734c commit bbc1b7f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 10 deletions.
34 changes: 33 additions & 1 deletion acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ AC_DEFUN([AC_FPM_PHP],

AC_DEFUN([AC_FPM_LIBEVENT_EMBEDDED],
[
libevent_configure="cd ./libevent ; CC=\"$CC\" CFLAGS=\"$AM_CFLAGS\" ../$srcdir/libevent/configure --disable-shared"
echo "$srcdir" | grep -qv '^/'; if test $? = 0 ; then le_rel_pfx=../; fi
libevent_configure="cd ./libevent ; CC=\"$CC\" CFLAGS=\"$AM_CFLAGS\" $le_rel_pfx$srcdir/libevent/configure --disable-shared"
$mkdir_p ./libevent
Expand All @@ -462,6 +463,9 @@ dnl LIBEVENT_LIBS=".a `echo "@LIBS@" | ./libevent/config.status --file=-:-`"

AC_DEFUN([AC_FPM_PATHS],
[
AC_ARG_WITH([fpm-bin],
AC_HELP_STRING([--with-fpm-bin=PATH], [Set the path for php-fpm binary. Default: $prefix/bin/php-fpm]))
AC_ARG_WITH([fpm-conf],
AC_HELP_STRING([--with-fpm-conf=PATH], [Set the path for php-fpm configuration file. Default: $prefix/etc/php-fpm.conf]))
Expand All @@ -471,17 +475,31 @@ AC_DEFUN([AC_FPM_PATHS],
AC_ARG_WITH([fpm-pid],
AC_HELP_STRING([--with-fpm-pid=PATH], [Set the path for php-fpm pid file. Default: $prefix/logs/php-fpm.pid]))
AC_ARG_WITH([fpm-user],
AC_HELP_STRING([--with-fpm-user=PATH], [Set the user for php-fpm to run as. Default: nobody]))
AC_ARG_WITH([fpm-group],
AC_HELP_STRING([--with-fpm-group=PATH], [Set the group for php-fpm to run as. Default: nobody]))
if test "$prefix" = "NONE" ; then
fpm_prefix=/usr/local
else
fpm_prefix="$prefix"
fi
if test -z "$with_fpm_bin" -o "$with_fpm_bin" = "yes" -o "$with_fpm_bin" = "no"; then
php_fpm_bin_path="$fpm_prefix/bin/php-fpm"
else
php_fpm_bin_path="$with_fpm_bin"
fi
PHP_FPM_BIN=`basename $php_fpm_bin_path`
if test -z "$with_fpm_conf" -o "$with_fpm_conf" = "yes" -o "$with_fpm_conf" = "no"; then
php_fpm_conf_path="$fpm_prefix/etc/php-fpm.conf"
else
php_fpm_conf_path="$with_fpm_conf"
fi
php_fpm_conf=`basename $php_fpm_conf_path`
if test -z "$with_fpm_log" -o "$with_fpm_log" = "yes" -o "$with_fpm_log" = "no"; then
php_fpm_log_path="$fpm_prefix/logs/php-fpm.log"
Expand All @@ -494,6 +512,20 @@ AC_DEFUN([AC_FPM_PATHS],
else
php_fpm_pid_path="$with_fpm_pid"
fi
if test -z "$with_fpm_user" -o "$with_fpm_user" = "yes" -o "$with_fpm_user" = "no"; then
php_fpm_user="nobody"
else
php_fpm_user="$with_fpm_user"
fi
if test -z "$with_fpm_group" -o "$with_fpm_group" = "yes" -o "$with_fpm_group" = "no"; then
php_fpm_group="nobody"
else
php_fpm_group="$with_fpm_group"
fi
AC_SUBST(PHP_FPM_BIN)
])

AC_DEFUN([AC_FPM_CC],
Expand Down
10 changes: 5 additions & 5 deletions conf/php-fpm.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
Set permissions for unix socket, if one used.
In Linux read/write permissions must be set in order to allow connections from web server.
Many BSD-derrived systems allow connections regardless of permissions.
<value name="owner"></value>
<value name="group"></value>
<value name="owner">@php_fpm_user@</value>
<value name="group">@php_fpm_group@</value>
<value name="mode">0666</value>
</value>

Expand All @@ -60,10 +60,10 @@
</value>

Unix user of processes
<!-- <value name="user">nobody</value> -->
<value name="user">@php_fpm_user@</value>

Unix group of processes
<!-- <value name="group">@php_fpm_group@</value> -->
<value name="group">@php_fpm_group@</value>

Process manager settings
<value name="pm">
Expand Down Expand Up @@ -107,7 +107,7 @@
<value name="request_slowlog_timeout">0s</value>

The log file for slow requests
<value name="slowlog">logs/slow.log</value>
<value name="slowlog">@[email protected]</value>

Set open file desc rlimit
<value name="rlimit_files">1024</value>
Expand Down
11 changes: 10 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ AC_SUBST(php_fpm_ADD_LIBS)

AC_DEFINE_UNQUOTED(PHP_FPM_VERSION, "$PACKAGE_VERSION", [fpm version])

AC_SUBST(php_fpm_bin_path)
AC_DEFINE_UNQUOTED(PHP_FPM_BIN_PATH, "$php_fpm_bin_path", [fpm bin file path])

AC_SUBST(php_fpm_conf_path)
AC_DEFINE_UNQUOTED(PHP_FPM_CONF_PATH, "$php_fpm_conf_path", [fpm conf file path])

Expand All @@ -47,8 +50,14 @@ AC_DEFINE_UNQUOTED(PHP_FPM_LOG_PATH, "$php_fpm_log_path", [fpm log file path])
AC_SUBST(php_fpm_pid_path)
AC_DEFINE_UNQUOTED(PHP_FPM_PID_PATH, "$php_fpm_pid_path", [fpm pid file path])

AC_SUBST(php_fpm_user)
AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name])

AC_SUBST(php_fpm_group)
AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name])


AC_CONFIG_FILES([Makefile src/Makefile src/sapi/Makefile src/fpm/Makefile])

AC_OUTPUT(src/php-fpm.conf:conf/php-fpm.conf.in src/init.d.php-fpm:init.d/php-fpm.in)
AC_OUTPUT(src/$php_fpm_conf:conf/php-fpm.conf.in src/init.d.$PHP_FPM_BIN:init.d/php-fpm.in)

2 changes: 1 addition & 1 deletion init.d/php-fpm.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

php_fpm_BIN=@prefix@/bin/php-cgi
php_fpm_BIN=@php_fpm_bin_path@
php_fpm_CONF=@php_fpm_conf_path@
php_fpm_PID=@php_fpm_pid_path@

Expand Down
7 changes: 5 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@

SUBDIRS = sapi fpm

bin_PROGRAMS = php-fpm
bin_PROGRAMS = $(PHP_FPM_BIN)

$(PHP_FPM_BIN): php_fpm
ln -s php_fpm $(PHP_FPM_BIN)

EXTRA_PROGRAMS = php_fpm
php_fpm_SOURCES =

php_fpm_LDADD = \
Expand All @@ -19,4 +23,3 @@ BUILT_SOURCES = ../libevent/event-config.h

../libevent/event-config.h: ../libevent/Makefile
cd ../libevent && $(MAKE) event-config.h

0 comments on commit bbc1b7f

Please sign in to comment.