Skip to content

Commit

Permalink
Improvements to the make install command...
Browse files Browse the repository at this point in the history
* Fix Missing dependency operator (freebsd)
* Install nginx sample config file
* --without-fpm-conf (no install) option
* Rename php-fpm.conf to php-fpm.conf.old
* Symlink php-fpm.conf -> php-fpm.conf.default
* Default /usr/local/etc/rc.d/php-fpm for freebsd (thanks kheechin)
* Default paths for netbsd, openbsd, arch linux
* Don't install init script for openbsd
* Installation notes, tips (readme.markdown)
* Regenerated with ./buildconf
  • Loading branch information
dreamcat4 authored and dreamcat four committed Oct 16, 2009
1 parent 1cea49f commit af22161
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 74 deletions.
53 changes: 38 additions & 15 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -737,27 +737,50 @@ install-fpm: $(php_fpm_bin)
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_pid_dir)
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_log_dir)
@$(INSTALL) -m 0755 $(php_fpm_bin) $(INSTALL_ROOT)$(php_fpm_bin_path)$(program_suffix)$(EXEEXT)
@echo "Installing PHP FPM config: $(INSTALL_ROOT)$(php_fpm_conf_path)"
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_conf_dir)
@$(INSTALL_DATA) $(php_fpm_conf) $(INSTALL_ROOT)$(php_fpm_conf_path)

@test "$(php_fpm_conf)" && \
@echo "Installing PHP FPM config: $(INSTALL_ROOT)$(php_fpm_conf_path)" && \
$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_conf_dir)

@test "$(php_fpm_conf)" && \
test -f "$(INSTALL_ROOT)$(php_fpm_conf_path)" && \
$(INSTALL_DATA) $(INSTALL_ROOT)$(php_fpm_conf_path) $(INSTALL_ROOT)$(php_fpm_conf_path).old

@test "$(php_fpm_conf)" && \
$(INSTALL_DATA) $(php_fpm_conf) $(INSTALL_ROOT)$(php_fpm_conf_path).default && \
ln -sf $(INSTALL_ROOT)$(php_fpm_conf_path).default $(INSTALL_ROOT)$(php_fpm_conf_path)

@echo "Installing PHP FPM man page: $(INSTALL_ROOT)$(mandir)/man1/$(php_fpm_bin)$(program_suffix).1"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) $(php_fpm_bin).1 $(INSTALL_ROOT)$(mandir)/man1/$(php_fpm_bin)$(program_suffix).1
ifneq ($(strip $(php_fpm_init)),)
@echo "Installing PHP FPM init script: $(INSTALL_ROOT)$(php_fpm_init_path)"
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_init_dir)
@$(INSTALL) -m 0755 init.d.$(php_fpm_init) $(INSTALL_ROOT)$(php_fpm_init_path)
@ENDIF@

@test "$(php_fpm_init)" && \
echo "Installing PHP FPM init script: $(INSTALL_ROOT)$(php_fpm_init_path)" && \
$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_init_dir) && \
$(INSTALL) -m 0755 init.d.$(php_fpm_init) $(INSTALL_ROOT)$(php_fpm_init_path)

@test -d /etc/nginx/ && \
echo "Installing NGINX sample config: /etc/nginx/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b nginx-site-conf.sample /etc/nginx/nginx-site-conf.sample

@test -d /usr/local/etc/nginx/ && \
echo "Installing NGINX sample config: /usr/local/etc/nginx/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b nginx-site-conf.sample /usr/local/etc/nginx/nginx-site-conf.sample

@test -d /usr/local/nginx/conf/ && \
echo "Installing NGINX sample config: /usr/local/nginx/conf/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b nginx-site-conf.sample /usr/local/nginx/conf/nginx-site-conf.sample

@echo ""
@echo "*** FPM Installation complete. ***"
@echo ""
ifneq ($(strip $(php_fpm_init)),)
@echo "run:"
@echo "\`update-rc.d $(php_fpm_init) defaults; invoke-rc.d $(php_fpm_init) start\`"
@echo ""
@echo "or system equivalent to start the $(php_fpm_init) service."
@echo ""
@ENDIF@

@test "$(php_fpm_init)" && \
echo "run:" && \
echo "\`update-rc.d $(php_fpm_init) defaults; invoke-rc.d $(php_fpm_init) start\`" && \
echo "" && \
echo "or system equivalent to start the $(php_fpm_init) service." && \
echo ""
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
53 changes: 38 additions & 15 deletions ac/Makefile.frag
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,48 @@ install-fpm: $(SAPI_FPM_PATH)
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_pid_dir)
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_log_dir)
@$(INSTALL) -m 0755 $(SAPI_FPM_PATH) $(INSTALL_ROOT)$(php_fpm_bin_path)$(program_suffix)$(EXEEXT)
@echo "Installing PHP FPM config: $(INSTALL_ROOT)$(php_fpm_conf_path)"
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_conf_dir)
@$(INSTALL_DATA) sapi/fpm/$(php_fpm_conf) $(INSTALL_ROOT)$(php_fpm_conf_path)

@test "$(php_fpm_conf)" && \
@echo "Installing PHP FPM config: $(INSTALL_ROOT)$(php_fpm_conf_path)" && \
$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_conf_dir)

@test "$(php_fpm_conf)" && \
test -f "$(INSTALL_ROOT)$(php_fpm_conf_path)" && \
$(INSTALL_DATA) $(INSTALL_ROOT)$(php_fpm_conf_path) $(INSTALL_ROOT)$(php_fpm_conf_path).old

@test "$(php_fpm_conf)" && \
$(INSTALL_DATA) sapi/fpm/$(php_fpm_conf) $(INSTALL_ROOT)$(php_fpm_conf_path).default && \
ln -sf $(INSTALL_ROOT)$(php_fpm_conf_path).default $(INSTALL_ROOT)$(php_fpm_conf_path)

@echo "Installing PHP FPM man page: $(INSTALL_ROOT)$(mandir)/man1/$(php_fpm_bin)$(program_suffix).1"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) sapi/fpm/$(php_fpm_bin).1 $(INSTALL_ROOT)$(mandir)/man1/$(php_fpm_bin)$(program_suffix).1
ifneq ($(strip $(php_fpm_init)),)
@echo "Installing PHP FPM init script: $(INSTALL_ROOT)$(php_fpm_init_path)"
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_init_dir)
@$(INSTALL) -m 0755 sapi/fpm/init.d.$(php_fpm_init) $(INSTALL_ROOT)$(php_fpm_init_path)
endif

@test "$(php_fpm_init)" && \
echo "Installing PHP FPM init script: $(INSTALL_ROOT)$(php_fpm_init_path)" && \
$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_init_dir) && \
$(INSTALL) -m 0755 sapi/fpm/init.d.$(php_fpm_init) $(INSTALL_ROOT)$(php_fpm_init_path)

@test -d /etc/nginx/ && \
echo "Installing NGINX sample config: /etc/nginx/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b sapi/fpm/nginx-site-conf.sample /etc/nginx/nginx-site-conf.sample

@test -d /usr/local/etc/nginx/ && \
echo "Installing NGINX sample config: /usr/local/etc/nginx/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b sapi/fpm/nginx-site-conf.sample /usr/local/etc/nginx/nginx-site-conf.sample

@test -d /usr/local/nginx/conf/ && \
echo "Installing NGINX sample config: /usr/local/nginx/conf/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b sapi/fpm/nginx-site-conf.sample /usr/local/nginx/conf/nginx-site-conf.sample

@echo ""
@echo "*** FPM Installation complete. ***"
@echo ""
ifneq ($(strip $(php_fpm_init)),)
@echo "run:"
@echo "\`update-rc.d $(php_fpm_init) defaults; invoke-rc.d $(php_fpm_init) start\`"
@echo ""
@echo "or system equivalent to start the $(php_fpm_init) service."
@echo ""
endif

@test "$(php_fpm_init)" && \
echo "run:" && \
echo "\`update-rc.d $(php_fpm_init) defaults; invoke-rc.d $(php_fpm_init) start\`" && \
echo "" && \
echo "or system equivalent to start the $(php_fpm_init) service." && \
echo ""

36 changes: 27 additions & 9 deletions ac/fpm_conf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,44 @@ AC_DEFUN([AC_FPM_VARS],
php_fpm_port="$PHP_FPM_PORT"
fi
if test -z "$PHP_FPM_CONF" -o "$PHP_FPM_CONF" = "yes" -o "$PHP_FPM_CONF" = "no"; then
php_fpm_conf_path="/etc/php-fpm.conf"
if test -z "$PHP_FPM_CONF" -o "$PHP_FPM_CONF" = "yes"; then
case $host_os in
freebsd*|dragonfly*) php_fpm_conf_path="/usr/local/etc/php-fpm.conf" ;;
*) php_fpm_conf_path="/etc/php-fpm.conf" ;;
esac
elif test "$PHP_FPM_CONF" = "no"; then
php_fpm_conf_path=""
else
php_fpm_conf_path="$PHP_FPM_CONF"
fi
php_fpm_conf=`basename $php_fpm_conf_path`
php_fpm_conf_dir=`dirname $php_fpm_conf_path`
if test -z "$with_fpm_conf_path"; then
php_fpm_conf=""
php_fpm_conf_dir=""
else
php_fpm_conf=`basename $php_fpm_conf_path`
php_fpm_conf_dir=`dirname $php_fpm_conf_path`
fi
if test -z "$PHP_FPM_INIT" -o "$PHP_FPM_INIT" = "yes"; then
php_fpm_init_path="/etc/init.d/php-fpm"
php_fpm_init=`basename $php_fpm_init_path`
php_fpm_init_dir=`dirname $php_fpm_init_path`
case $host_os in
openbsd*) php_fpm_init_path="" ;;
netbsd*) php_fpm_init_path="/etc/rc.d/php-fpm" ;;
*bsd*|dragonfly*) php_fpm_init_path="/usr/local/etc/rc.d/php-fpm" ;;
*) php_fpm_init_path="/etc/init.d/php-fpm" ;;
esac
test -f /etc/arch-release && php_fpm_init_path="/etc/rc.d/php-fpm" # arch linux
elif test "$PHP_FPM_INIT" = "no"; then
php_fpm_init_path=""
else
php_fpm_init_path="$PHP_FPM_INIT"
fi
if test -z "$with_fpm_init_path"; then
php_fpm_init=""
php_fpm_init_dir=""
else
php_fpm_init_path="$PHP_FPM_INIT"
php_fpm_init=`basename $php_fpm_init_path`
php_fpm_init_dir=`dirname $php_fpm_init_path`
php_fpm_init_dir=`dirname $php_fpm_init_path`
fi
if test -z "$PHP_FPM_LOG" -o "$PHP_FPM_LOG" = "yes" -o "$PHP_FPM_LOG" = "no"; then
Expand Down
38 changes: 28 additions & 10 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -436,26 +436,44 @@ AC_DEFUN([AC_FPM_PATHS],
php_fpm_port="$with_fpm_port"
fi
if test -z "$with_fpm_conf" -o "$with_fpm_conf" = "yes" -o "$with_fpm_conf" = "no"; then
php_fpm_conf_path="/etc/php-fpm.conf"
if test -z "$with_fpm_conf" -o "$with_fpm_conf" = "yes"; then
case $host_os in
freebsd*|dragonfly*) php_fpm_conf_path="/usr/local/etc/php-fpm.conf" ;;
*) php_fpm_conf_path="/etc/php-fpm.conf" ;;
esac
elif test "$with_fpm_conf" = "no"; then
php_fpm_conf_path=""
else
php_fpm_conf_path="$with_fpm_conf"
fi
php_fpm_conf=`basename $php_fpm_conf_path`
php_fpm_conf_dir=`dirname $php_fpm_conf_path`
if test -z "$with_fpm_conf_path"; then
php_fpm_conf=""
php_fpm_conf_dir=""
else
php_fpm_conf=`basename $php_fpm_conf_path`
php_fpm_conf_dir=`dirname $php_fpm_conf_path`
fi
if test -z "$with_fpm_init" -o "$with_fpm_init" = "yes"; then
php_fpm_init_path="/etc/init.d/php-fpm"
php_fpm_init=`basename $php_fpm_init_path`
php_fpm_init_dir=`dirname $php_fpm_init_path`
case $host_os in
openbsd*) php_fpm_init_path="" ;;
netbsd*) php_fpm_init_path="/etc/rc.d/php-fpm" ;;
*bsd*|dragonfly*) php_fpm_init_path="/usr/local/etc/rc.d/php-fpm" ;;
*) php_fpm_init_path="/etc/init.d/php-fpm" ;;
esac
test -f /etc/arch-release && php_fpm_init_path="/etc/rc.d/php-fpm" # arch linux
elif test "$with_fpm_init" = "no"; then
php_fpm_init_path=""
else
php_fpm_init_path="$with_fpm_init"
fi
if test -z "$with_fpm_init_path"; then
php_fpm_init=""
php_fpm_init_dir=""
else
php_fpm_init_path="$with_fpm_init"
php_fpm_init=`basename $php_fpm_init_path`
php_fpm_init_dir=`dirname $php_fpm_init_path`
php_fpm_init_dir=`dirname $php_fpm_init_path`
fi
if test -z "$with_fpm_log" -o "$with_fpm_log" = "yes" -o "$with_fpm_log" = "no"; then
Expand Down
34 changes: 26 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -20593,24 +20593,42 @@ fi;
php_fpm_port="$with_fpm_port"
fi

if test -z "$with_fpm_conf" -o "$with_fpm_conf" = "yes" -o "$with_fpm_conf" = "no"; then
php_fpm_conf_path="/etc/php-fpm.conf"
if test -z "$with_fpm_conf" -o "$with_fpm_conf" = "yes"; then
case $host_os in
freebsd*|dragonfly*) php_fpm_conf_path="/usr/local/etc/php-fpm.conf" ;;
*) php_fpm_conf_path="/etc/php-fpm.conf" ;;
esac
elif test "$with_fpm_conf" = "no"; then
php_fpm_conf_path=""
else
php_fpm_conf_path="$with_fpm_conf"
fi
php_fpm_conf=`basename $php_fpm_conf_path`
php_fpm_conf_dir=`dirname $php_fpm_conf_path`
if test -z "$with_fpm_conf_path"; then
php_fpm_conf=""
php_fpm_conf_dir=""
else
php_fpm_conf=`basename $php_fpm_conf_path`
php_fpm_conf_dir=`dirname $php_fpm_conf_path`
fi

if test -z "$with_fpm_init" -o "$with_fpm_init" = "yes"; then
php_fpm_init_path="/etc/init.d/php-fpm"
php_fpm_init=`basename $php_fpm_init_path`
php_fpm_init_dir=`dirname $php_fpm_init_path`
case $host_os in
openbsd*) php_fpm_init_path="" ;;
netbsd*) php_fpm_init_path="/etc/rc.d/php-fpm" ;;
*bsd*|dragonfly*) php_fpm_init_path="/usr/local/etc/rc.d/php-fpm" ;;
*) php_fpm_init_path="/etc/init.d/php-fpm" ;;
esac
test -f /etc/arch-release && php_fpm_init_path="/etc/rc.d/php-fpm" # arch linux

elif test "$with_fpm_init" = "no"; then
php_fpm_init_path=""
else
php_fpm_init_path="$with_fpm_init"
fi
if test -z "$with_fpm_init_path"; then
php_fpm_init=""
php_fpm_init_dir=""
else
php_fpm_init_path="$with_fpm_init"
php_fpm_init=`basename $php_fpm_init_path`
php_fpm_init_dir=`dirname $php_fpm_init_path`
fi
Expand Down
53 changes: 38 additions & 15 deletions m4/Makefile.frag
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,48 @@ install-fpm: $(php_fpm_bin)
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_pid_dir)
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_log_dir)
@$(INSTALL) -m 0755 $(php_fpm_bin) $(INSTALL_ROOT)$(php_fpm_bin_path)$(program_suffix)$(EXEEXT)
@echo "Installing PHP FPM config: $(INSTALL_ROOT)$(php_fpm_conf_path)"
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_conf_dir)
@$(INSTALL_DATA) $(php_fpm_conf) $(INSTALL_ROOT)$(php_fpm_conf_path)

@test "$(php_fpm_conf)" && \
@echo "Installing PHP FPM config: $(INSTALL_ROOT)$(php_fpm_conf_path)" && \
$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_conf_dir)

@test "$(php_fpm_conf)" && \
test -f "$(INSTALL_ROOT)$(php_fpm_conf_path)" && \
$(INSTALL_DATA) $(INSTALL_ROOT)$(php_fpm_conf_path) $(INSTALL_ROOT)$(php_fpm_conf_path).old

@test "$(php_fpm_conf)" && \
$(INSTALL_DATA) $(php_fpm_conf) $(INSTALL_ROOT)$(php_fpm_conf_path).default && \
ln -sf $(INSTALL_ROOT)$(php_fpm_conf_path).default $(INSTALL_ROOT)$(php_fpm_conf_path)

@echo "Installing PHP FPM man page: $(INSTALL_ROOT)$(mandir)/man1/$(php_fpm_bin)$(program_suffix).1"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
@$(INSTALL_DATA) $(php_fpm_bin).1 $(INSTALL_ROOT)$(mandir)/man1/$(php_fpm_bin)$(program_suffix).1
ifneq ($(strip $(php_fpm_init)),)
@echo "Installing PHP FPM init script: $(INSTALL_ROOT)$(php_fpm_init_path)"
@$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_init_dir)
@$(INSTALL) -m 0755 init.d.$(php_fpm_init) $(INSTALL_ROOT)$(php_fpm_init_path)
@ENDIF@

@test "$(php_fpm_init)" && \
echo "Installing PHP FPM init script: $(INSTALL_ROOT)$(php_fpm_init_path)" && \
$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_init_dir) && \
$(INSTALL) -m 0755 init.d.$(php_fpm_init) $(INSTALL_ROOT)$(php_fpm_init_path)

@test -d /etc/nginx/ && \
echo "Installing NGINX sample config: /etc/nginx/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b nginx-site-conf.sample /etc/nginx/nginx-site-conf.sample

@test -d /usr/local/etc/nginx/ && \
echo "Installing NGINX sample config: /usr/local/etc/nginx/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b nginx-site-conf.sample /usr/local/etc/nginx/nginx-site-conf.sample

@test -d /usr/local/nginx/conf/ && \
echo "Installing NGINX sample config: /usr/local/nginx/conf/nginx-site-conf.sample" && \
@$(INSTALL_DATA) -b nginx-site-conf.sample /usr/local/nginx/conf/nginx-site-conf.sample

@echo ""
@echo "*** FPM Installation complete. ***"
@echo ""
ifneq ($(strip $(php_fpm_init)),)
@echo "run:"
@echo "\`update-rc.d $(php_fpm_init) defaults; invoke-rc.d $(php_fpm_init) start\`"
@echo ""
@echo "or system equivalent to start the $(php_fpm_init) service."
@echo ""
@ENDIF@

@test "$(php_fpm_init)" && \
echo "run:" && \
echo "\`update-rc.d $(php_fpm_init) defaults; invoke-rc.d $(php_fpm_init) start\`" && \
echo "" && \
echo "or system equivalent to start the $(php_fpm_init) service." && \
echo ""

10 changes: 9 additions & 1 deletion readme-ru.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ PHP-FPM это Fast-CGI фронтэнд для php и расширение php-
--with-libevent[=PATH] Путь до libevent, для fpm SAPI [/usr/local]
--with-fpm-bin[=PATH] Путь для откомпилированного php-fpm [/usr/local/bin/php-fpm]
--with-fpm-port[=PORT] TCP порт для cgi запросов [9000]
--with-fpm-conf[=PATH] Путь до файла конфигурации php-fpm [/etc/php-fpm.conf]
--with[out]-fpm-conf[=PATH] Путь до файла конфигурации php-fpm [/etc/php-fpm.conf]
--with[out]-fpm-init[=PATH] Путь до init-файла php-fpm [/etc/init.d/php-fpm]
--with-fpm-log[=PATH] Путь до лог-файла php-fpm [/var/log/php-fpm.log]
--with-fpm-pid[=PATH] Путь до pid-файла php-fpm [/var/run/php-fpm.pid]
Expand All @@ -92,6 +92,14 @@ PHP-FPM это Fast-CGI фронтэнд для php и расширение php-
# Установить в '/opt'
sudo INSTALL_ROOT=/opt make install

Notes:

* (Upgrade) When overwriting existing FPM installation files: A previous configuration file `php-fpm.conf` will be moved to `php-fpm.conf.old`. Then a newer (default) configuration file will be installed in it's place. If you have any custom XML settings which you wish to keep, its recommended to copy these back over manually.

* (BSD) the default init.d path is `/usr/local/etc/rc.d/php-fpm` or disable: `--without-fpm-init`

* (Nginx) An example nginx configuration file is generated. The file `nginx-site-conf.sample` may be installed into your nginx configuration directory, if exists: `/etc/nginx/`, `/usr/local/etc/nginx/`, or `/usr/local/nginx/conf`

## Больше о процессе сборки PHP-FPM

Процесс сборки можно описать так:
Expand Down
Loading

0 comments on commit af22161

Please sign in to comment.