diff options
-rw-r--r-- | UPDATING | 6 | ||||
-rw-r--r-- | net/haproxy-devel/Makefile | 22 | ||||
-rw-r--r-- | net/haproxy-devel/distinfo | 4 | ||||
-rw-r--r-- | net/haproxy-devel/files/haproxy.sh | 68 | ||||
-rw-r--r-- | net/haproxy-devel/pkg-message | 3 | ||||
-rw-r--r-- | net/haproxy-devel/pkg-plist | 6 | ||||
-rw-r--r-- | net/haproxy/Makefile | 22 | ||||
-rw-r--r-- | net/haproxy/distinfo | 4 | ||||
-rw-r--r-- | net/haproxy/files/haproxy.sh | 68 | ||||
-rw-r--r-- | net/haproxy/pkg-message | 3 | ||||
-rw-r--r-- | net/haproxy/pkg-plist | 6 |
11 files changed, 150 insertions, 62 deletions
@@ -6,6 +6,12 @@ You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20040608: + AFFECTS: users of net/haproxy + + The haproxy port must now be enabled / disabled and configured in + rc.conf. See the pkg-message or script for details. + 20040605: AFFECTS: users of www/apache2 diff --git a/net/haproxy-devel/Makefile b/net/haproxy-devel/Makefile index c1b494546213..76d0fbdf5a0c 100644 --- a/net/haproxy-devel/Makefile +++ b/net/haproxy-devel/Makefile @@ -6,7 +6,7 @@ # PORTNAME= haproxy -PORTVERSION= 1.1.27 +PORTVERSION= 1.1.28 CATEGORIES= net www MASTER_SITES= http://w.ods.org/tools/haproxy/src/ \ http://w.ods.org/tools/haproxy/src/old/ @@ -15,6 +15,8 @@ MAINTAINER= clement@FreeBSD.org COMMENT= High-performance and highly-robust TCP/HTTP load balancer USE_REINPLACE= yes +USE_RC_SUBR= yes +RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} STATS_INTERVAL?= 0 CFLAGS+= -DSTATTIME=${STATS_INTERVAL} @@ -41,19 +43,27 @@ pre-fetch: post-patch: @${REINPLACE_CMD} -e 's!localtime(!localtime((time_t *)!' ${WRKSRC}/haproxy.c + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/haproxy.sh > ${WRKDIR}/haproxy.sh do-build: - cd ${WRKSRC} && ${CC} ${CFLAGS} ${LDFLAGS} ${PORTNAME}.c -o ${PORTNAME} + @cd ${WRKSRC} && \ + ${CC} ${CFLAGS} ${LDFLAGS} ${PORTNAME}.c -o ${PORTNAME} do-install: @${INSTALL_PROGRAM} ${WRKSRC}/haproxy ${PREFIX}/sbin - @${INSTALL_DATA} ${WRKSRC}/examples/haproxy.cfg \ - ${PREFIX}/etc/haproxy.cfg.sample - @${INSTALL_SCRIPT} ${FILESDIR}/haproxy.sh \ - ${PREFIX}/etc/rc.d/haproxy.sh.sample + @${INSTALL_SCRIPT} ${WRKDIR}/haproxy.sh \ + ${PREFIX}/etc/rc.d/haproxy.sh + .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} + @${MKDIR} ${EXAMPLESDIR} @${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR} + @${INSTALL_DATA} ${WRKSRC}/examples/haproxy.cfg \ + ${EXAMPLESDIR}/haproxy.cfg .endif +post-install: + @${CAT} ${PKGMESSAGE} + .include <bsd.port.mk> diff --git a/net/haproxy-devel/distinfo b/net/haproxy-devel/distinfo index 910ba848f648..ec41d4736fe0 100644 --- a/net/haproxy-devel/distinfo +++ b/net/haproxy-devel/distinfo @@ -1,2 +1,2 @@ -MD5 (haproxy-1.1.27.tar.gz) = 8379ebfc91a5fbf1f49ca65e36b460af -SIZE (haproxy-1.1.27.tar.gz) = 90455 +MD5 (haproxy-1.1.28.tar.gz) = 193ff4d73dfc503bf6e7b8e4cd825e5e +SIZE (haproxy-1.1.28.tar.gz) = 97764 diff --git a/net/haproxy-devel/files/haproxy.sh b/net/haproxy-devel/files/haproxy.sh index e51b6a855662..3b633d089d7b 100644 --- a/net/haproxy-devel/files/haproxy.sh +++ b/net/haproxy-devel/files/haproxy.sh @@ -1,22 +1,50 @@ #!/bin/sh +# +# $FreeBSD$ +# -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in - start) - [ -x ${PREFIX}/sbin/haproxy ] && \ - [ -r ${PREFIX}/etc/haproxy.cfg ] && \ - ${PREFIX}/sbin/haproxy -f ${PREFIX}/etc/haproxy.cfg && \ - echo -n ' haproxy' - - ;; - stop) - killall haproxy && echo -n ' haproxy' - ;; - *) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac +# PROVIDE: haproxy +# REQUIRE: NETWORKING SERVERS +# BEFORE: DAEMON +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable haproxy: +# haproxy_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable haproxy +# haproxylimits_enable (bool):Set to "NO" by default. +# Set it to yes to run `limits $limits_args` +# just before haproxy starts. +# haproxy_flags (str): Set to "" by default. +# Extra flags passed to start command +# haproxylimits_args (str): Default to "-e -C daemon" +# Arguments of pre-start limits run. +# +. %%RC_SUBR%% + +name="haproxy" +rcvar=`set_rcvar` + +command="%%PREFIX%%/sbin/haproxy" +pidfile="/var/run/haproxy.pid" +required_files=%%PREFIX%%/etc/haproxy.conf + +[ -z "$haproxy_enable" ] && haproxy_enable="NO" +[ -z "$haproxy_flags" ] && haproxy_flags="-p ${pidfile}" +[ -z "$haproxylimits_enable" ] && haproxylimits_enable="NO" +[ -z "$haproxylimits_args" ] && haproxylimits_args="-e -C daemon" + +load_rc_config $name + +checkyesno haproxylimits_enable && \ + start_precmd="eval `/usr/bin/limits ${haproxylimits_args}` 2>/dev/null" + +sig_gracefulstop=SIGUSR1 + +haproxy_gracefulstop() { + echo "Gracefully shutdown haproxy ($rc_pid)" + kill -${sig_gracefulstop} ${rc_pid} + } + +extra_commands="gracefulstop" +run_rc_command "$1" diff --git a/net/haproxy-devel/pkg-message b/net/haproxy-devel/pkg-message new file mode 100644 index 000000000000..4cb845b4df81 --- /dev/null +++ b/net/haproxy-devel/pkg-message @@ -0,0 +1,3 @@ +===> BE CAREFULL HOW TO BOOT on 1.1.28 or after: + To run haproxy from startup, add haproxy_enable="YES" in your + /etc/rc.conf. diff --git a/net/haproxy-devel/pkg-plist b/net/haproxy-devel/pkg-plist index fd8b17619ca1..5e2d4373eb8e 100644 --- a/net/haproxy-devel/pkg-plist +++ b/net/haproxy-devel/pkg-plist @@ -1,6 +1,6 @@ sbin/haproxy -etc/haproxy.cfg.sample -etc/rc.d/haproxy.sh.sample +etc/rc.d/haproxy.sh %%PORTDOCS%%%%DOCSDIR%%/haproxy-en.txt %%PORTDOCS%%%%DOCSDIR%%/haproxy-fr.txt -@dirrm %%DOCSDIR%% +%%PORTDOCS%%%%EXAMPLESDIR%%/haproxy.cfg +%%PORTDOCS%%@dirrm %%DOCSDIR%% diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index c1b494546213..76d0fbdf5a0c 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -6,7 +6,7 @@ # PORTNAME= haproxy -PORTVERSION= 1.1.27 +PORTVERSION= 1.1.28 CATEGORIES= net www MASTER_SITES= http://w.ods.org/tools/haproxy/src/ \ http://w.ods.org/tools/haproxy/src/old/ @@ -15,6 +15,8 @@ MAINTAINER= clement@FreeBSD.org COMMENT= High-performance and highly-robust TCP/HTTP load balancer USE_REINPLACE= yes +USE_RC_SUBR= yes +RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} STATS_INTERVAL?= 0 CFLAGS+= -DSTATTIME=${STATS_INTERVAL} @@ -41,19 +43,27 @@ pre-fetch: post-patch: @${REINPLACE_CMD} -e 's!localtime(!localtime((time_t *)!' ${WRKSRC}/haproxy.c + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/haproxy.sh > ${WRKDIR}/haproxy.sh do-build: - cd ${WRKSRC} && ${CC} ${CFLAGS} ${LDFLAGS} ${PORTNAME}.c -o ${PORTNAME} + @cd ${WRKSRC} && \ + ${CC} ${CFLAGS} ${LDFLAGS} ${PORTNAME}.c -o ${PORTNAME} do-install: @${INSTALL_PROGRAM} ${WRKSRC}/haproxy ${PREFIX}/sbin - @${INSTALL_DATA} ${WRKSRC}/examples/haproxy.cfg \ - ${PREFIX}/etc/haproxy.cfg.sample - @${INSTALL_SCRIPT} ${FILESDIR}/haproxy.sh \ - ${PREFIX}/etc/rc.d/haproxy.sh.sample + @${INSTALL_SCRIPT} ${WRKDIR}/haproxy.sh \ + ${PREFIX}/etc/rc.d/haproxy.sh + .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} + @${MKDIR} ${EXAMPLESDIR} @${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR} + @${INSTALL_DATA} ${WRKSRC}/examples/haproxy.cfg \ + ${EXAMPLESDIR}/haproxy.cfg .endif +post-install: + @${CAT} ${PKGMESSAGE} + .include <bsd.port.mk> diff --git a/net/haproxy/distinfo b/net/haproxy/distinfo index 910ba848f648..ec41d4736fe0 100644 --- a/net/haproxy/distinfo +++ b/net/haproxy/distinfo @@ -1,2 +1,2 @@ -MD5 (haproxy-1.1.27.tar.gz) = 8379ebfc91a5fbf1f49ca65e36b460af -SIZE (haproxy-1.1.27.tar.gz) = 90455 +MD5 (haproxy-1.1.28.tar.gz) = 193ff4d73dfc503bf6e7b8e4cd825e5e +SIZE (haproxy-1.1.28.tar.gz) = 97764 diff --git a/net/haproxy/files/haproxy.sh b/net/haproxy/files/haproxy.sh index e51b6a855662..3b633d089d7b 100644 --- a/net/haproxy/files/haproxy.sh +++ b/net/haproxy/files/haproxy.sh @@ -1,22 +1,50 @@ #!/bin/sh +# +# $FreeBSD$ +# -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in - start) - [ -x ${PREFIX}/sbin/haproxy ] && \ - [ -r ${PREFIX}/etc/haproxy.cfg ] && \ - ${PREFIX}/sbin/haproxy -f ${PREFIX}/etc/haproxy.cfg && \ - echo -n ' haproxy' - - ;; - stop) - killall haproxy && echo -n ' haproxy' - ;; - *) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac +# PROVIDE: haproxy +# REQUIRE: NETWORKING SERVERS +# BEFORE: DAEMON +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable haproxy: +# haproxy_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable haproxy +# haproxylimits_enable (bool):Set to "NO" by default. +# Set it to yes to run `limits $limits_args` +# just before haproxy starts. +# haproxy_flags (str): Set to "" by default. +# Extra flags passed to start command +# haproxylimits_args (str): Default to "-e -C daemon" +# Arguments of pre-start limits run. +# +. %%RC_SUBR%% + +name="haproxy" +rcvar=`set_rcvar` + +command="%%PREFIX%%/sbin/haproxy" +pidfile="/var/run/haproxy.pid" +required_files=%%PREFIX%%/etc/haproxy.conf + +[ -z "$haproxy_enable" ] && haproxy_enable="NO" +[ -z "$haproxy_flags" ] && haproxy_flags="-p ${pidfile}" +[ -z "$haproxylimits_enable" ] && haproxylimits_enable="NO" +[ -z "$haproxylimits_args" ] && haproxylimits_args="-e -C daemon" + +load_rc_config $name + +checkyesno haproxylimits_enable && \ + start_precmd="eval `/usr/bin/limits ${haproxylimits_args}` 2>/dev/null" + +sig_gracefulstop=SIGUSR1 + +haproxy_gracefulstop() { + echo "Gracefully shutdown haproxy ($rc_pid)" + kill -${sig_gracefulstop} ${rc_pid} + } + +extra_commands="gracefulstop" +run_rc_command "$1" diff --git a/net/haproxy/pkg-message b/net/haproxy/pkg-message new file mode 100644 index 000000000000..4cb845b4df81 --- /dev/null +++ b/net/haproxy/pkg-message @@ -0,0 +1,3 @@ +===> BE CAREFULL HOW TO BOOT on 1.1.28 or after: + To run haproxy from startup, add haproxy_enable="YES" in your + /etc/rc.conf. diff --git a/net/haproxy/pkg-plist b/net/haproxy/pkg-plist index fd8b17619ca1..5e2d4373eb8e 100644 --- a/net/haproxy/pkg-plist +++ b/net/haproxy/pkg-plist @@ -1,6 +1,6 @@ sbin/haproxy -etc/haproxy.cfg.sample -etc/rc.d/haproxy.sh.sample +etc/rc.d/haproxy.sh %%PORTDOCS%%%%DOCSDIR%%/haproxy-en.txt %%PORTDOCS%%%%DOCSDIR%%/haproxy-fr.txt -@dirrm %%DOCSDIR%% +%%PORTDOCS%%%%EXAMPLESDIR%%/haproxy.cfg +%%PORTDOCS%%@dirrm %%DOCSDIR%% |