diff options
author | clement <clement@FreeBSD.org> | 2004-06-08 10:31:00 +0000 |
---|---|---|
committer | clement <clement@FreeBSD.org> | 2004-06-08 10:31:00 +0000 |
commit | bfe07e556129a056a4bdb4b80613d666c28ab533 (patch) | |
tree | cc3dfc527594129cda1438df55f6ac5c42a9dd29 /net/haproxy-devel | |
parent | f414a15ee02d9de6047cb263c099266446f341e2 (diff) | |
download | FreeBSD-ports-bfe07e556129a056a4bdb4b80613d666c28ab533.zip FreeBSD-ports-bfe07e556129a056a4bdb4b80613d666c28ab533.tar.gz |
- 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}.
Diffstat (limited to 'net/haproxy-devel')
-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 |
5 files changed, 72 insertions, 31 deletions
diff --git a/net/haproxy-devel/Makefile b/net/haproxy-devel/Makefile index c1b4945..76d0fbd 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 910ba84..ec41d47 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 e51b6a8..3b633d0 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 0000000..4cb845b --- /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 fd8b176..5e2d437 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%% |