diff options
author | Clement Laforet <clement@FreeBSD.org> | 2004-06-08 10:31:00 +0000 |
---|---|---|
committer | Clement Laforet <clement@FreeBSD.org> | 2004-06-08 10:31:00 +0000 |
commit | c62a21e3581d3635d271cb94f0db481b7893cd6f (patch) | |
tree | 6f8ea1c9d84a07e531f664fb5bf88cca14bcd92e /net/haproxy | |
parent | 5ae350cd7e6b6cd85a700d5d22b83798acc54229 (diff) | |
download | ports-c62a21e3581d3635d271cb94f0db481b7893cd6f.tar.gz ports-c62a21e3581d3635d271cb94f0db481b7893cd6f.zip |
- Update to 1.1.28
- RCng'ify startup script
- small plist fix if NOPORTDOCS is defined
- Add an entry in UPDATING
- move configuration example to ${EXAMPLESDIR}.
Notes
Notes:
svn path=/head/; revision=111077
Diffstat (limited to 'net/haproxy')
-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 |
5 files changed, 72 insertions, 31 deletions
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%% |