ports/150152: [Patch][Maintainer Update] net/haproxy-devel: v1.3.25 -> v1.5.d2

Ross West freebsd at linepoint.com
Tue Aug 31 15:10:05 UTC 2010


>Number:         150152
>Category:       ports
>Synopsis:       [Patch][Maintainer Update] net/haproxy-devel: v1.3.25 -> v1.5.d2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 31 15:10:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Ross West
>Release:        FreeBSD 8.0-RELEASE amd64
>Organization:
>Environment:
>Description:

Update of haproxy-devel back to the development branch of the software.

This update fixes a few things:
 - adds usage of port OPTIONS
 - license options defined
 - Correct compilation using gmake
 - Updated rc.d file
 - Correct dependency listings

Major new feature in development is the addition of request throttling per IP address.  Please check out the changelog for a longer listing of things done!
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN --exclude=CVS /usr/ports/net/haproxy-devel.1.3.25/Makefile /usr/ports/net/haproxy-devel/Makefile
--- /usr/ports/net/haproxy-devel.1.3.25/Makefile        2010-07-05 03:19:07.000000000 -0400
+++ /usr/ports/net/haproxy-devel/Makefile       2010-08-31 10:52:03.000000000 -0400
@@ -6,41 +6,54 @@
 #

 PORTNAME=      haproxy
-PORTVERSION=   1.3.25
-CATEGORIES=    net
-MASTER_SITES=  http://haproxy.1wt.eu/download/1.3/src/
 PKGNAMESUFFIX= -devel
+PORTVERSION=   1.5.d2
+DISTVERSION=   1.5-dev2
+CATEGORIES=    net
+MASTER_SITES=  http://haproxy.1wt.eu/download/1.5/src/devel/
+
+LICENSE_COMB=  multi
+LICENSE=       GPLv2 LGPL21

 MAINTAINER=    freebsd at linepoint.com
-COMMENT=       The Reliable, High Performance TCP/HTTP Load Balancer
+COMMENT=       The Reliable, High Performance TCP/HTTP Load Balancer - development branch

-CONFLICTS=     haproxy-1.[24]*
+CONFLICTS=     haproxy-1.[234]\.*
 USE_RC_SUBR=   haproxy
+USE_GMAKE=     YES
+SUB_FILES=     pkg-message
+MAN1=          haproxy.1

-MAKEFILE=      Makefile.bsd
+OPTIONS=       PCRE            "Use PCRE regex library"        On\
+               STATIC_PCRE     "Use static PCRE regex library" Off

-do-install:
-       @${INSTALL_PROGRAM} ${WRKSRC}/haproxy ${PREFIX}/sbin
+.include <bsd.port.options.mk>
+
+MAKE_ARGS=     TARGET=freebsd DEFINE=-DFREEBSD_PORTS

+.if defined(WITH_PCRE)
+LIB_DEPENDS+=  pcre.0:${PORTSDIR}/devel/pcre
+MAKE_ARGS+=    "USE_PCRE=1"
+.endif
+
+.if defined(WITH_STATIC_PCRE)
+LIB_DEPENDS+=  pcre.0:${PORTSDIR}/devel/pcre
+MAKE_ARGS+=    "USE_STATIC_PCRE=1"
+.endif
+
+do-install:
+       @${INSTALL_PROGRAM} ${WRKSRC}/haproxy ${PREFIX}/sbin/
+       @${INSTALL_MAN} ${WRKSRC}/doc/haproxy.1 ${MAN1PREFIX}/man/man1
 .if !defined(NOPORTDOCS)
        @${MKDIR} ${DOCSDIR}
-       @${MKDIR} ${DOCSDIR}/design-thoughts
-       @${MKDIR} ${DOCSDIR}/internals
-       @${INSTALL_DATA} ${WRKSRC}/doc/*.txt ${DOCSDIR}/
-       @(cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} internals ${DOCSDIR}/)
-       @(cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} design-thoughts ${DOCSDIR}/)
+       (cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} \* ${DOCSDIR})
+.endif
+.if !defined(NOPORTEXAMPLES)
+       @${MKDIR} ${EXAMPLESDIR}
+       (cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} \* ${EXAMPLESDIR})
 .endif
-       @${INSTALL_DATA} ${WRKSRC}/examples/haproxy.cfg \
-                               ${PREFIX}/etc/haproxy.conf-dist

 post-install:
-       @${ECHO_MSG} ""
-       @${ECHO_MSG} ""
-       @${ECHO_MSG} ""
-       @${ECHO_MSG} "${PORTNAME} is now installed."
-       @${ECHO_MSG} "To configure it, rename ${PREFIX}/etc/haproxy.conf-dist"
-       @${ECHO_MSG} "and add haproxy_enable=\"YES\" to /etc/rc.conf"
-       @${ECHO_MSG} ""
-       @${ECHO_MSG} ""
+       @${CAT} ${PKGMESSAGE}

 .include <bsd.port.mk>
diff -ruN --exclude=CVS /usr/ports/net/haproxy-devel.1.3.25/distinfo /usr/ports/net/haproxy-devel/distinfo
--- /usr/ports/net/haproxy-devel.1.3.25/distinfo        2010-07-05 03:19:07.000000000 -0400
+++ /usr/ports/net/haproxy-devel/distinfo       2010-08-31 10:26:33.000000000 -0400
@@ -1,3 +1,3 @@
-MD5 (haproxy-1.3.25.tar.gz) = 6d46732bfdb569133870169c555c0f6c
-SHA256 (haproxy-1.3.25.tar.gz) = 50dbe7b515c32a643b7caaac32ec3152ba536e589242e4d50ff42618a85f5a78
-SIZE (haproxy-1.3.25.tar.gz) = 662198
+MD5 (haproxy-1.5-dev2.tar.gz) = d2b664c543de6b956810cda2419a2d6f
+SHA256 (haproxy-1.5-dev2.tar.gz) = f4707f5136fc33ab2366baf55d7bcdb4b7cc4e1018d78aaed9bb6eed3a7f6743
+SIZE (haproxy-1.5-dev2.tar.gz) = 804792
diff -ruN --exclude=CVS /usr/ports/net/haproxy-devel.1.3.25/files/haproxy.in /usr/ports/net/haproxy-devel/files/haproxy.in
--- /usr/ports/net/haproxy-devel.1.3.25/files/haproxy.in        2010-03-26 20:13:44.000000000 -0400
+++ /usr/ports/net/haproxy-devel/files/haproxy.in       2010-08-27 15:54:03.000000000 -0400
@@ -1,52 +1,99 @@
 #!/bin/sh
-#
-# $FreeBSD: ports/net/haproxy-devel/files/haproxy.in,v 1.3 2010/03/27 00:13:44 dougb Exp $
-#

 # PROVIDE: haproxy
-# REQUIRE: NETWORKING SERVERS
-# BEFORE: DAEMON
+# REQUIRE: DAEMON
 # KEYWORD: 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.
 #
+# haproxy_enable (bool):       default: "NO"
+#                              Set to "YES" to enable haproxy
+# haproxy_pidfile (str):       default: /var/run/${name}.pid
+#                              Set to the full path of the pid file
+# haproxy_config (str):                default: /usr/local/etc/${name}.conf
+#                              Set to the full path of the config file
+# haproxy_flags (str):         default: Autogenerated using pidfile and config options
+#                              Set to override with your own options
+#
+#######
+#
+# rc.d Script Runtime Options:
+#
+# start                - starts application normally
+# stop         - (softstop) stops all proxies and exits once all sessions are closed
+# forcestop    - (immediate) stops all proxies and kills active sessions
+# reload       - hot-reconfig using "-sf" option (active sessions kept)
+# forcereload  - hot-reconfig using "-st" option (active sessions killed)
+# restart      - equiv to "stop" then "start"
+# checkconfig  - checks configuration file defined in haproxy_config
+#
+#######
+
 . /etc/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} -f /usr/local/etc/haproxy.conf"
-[ -z "$haproxylimits_enable" ] && haproxylimits_enable="NO"
-[ -z "$haproxylimits_args" ]   && haproxylimits_args="-e -C daemon"

+# Load Configs/Set Defaults
 load_rc_config $name
+: ${haproxy_enable:="NO"}
+: ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"}
+: ${haproxy_pidfile:="/var/run/${name}.pid"}
+: ${haproxy_flags="-q -f ${haproxy_config} -p ${haproxy_pidfile}"}
+
+# Update the globals
+pidfile=${haproxy_pidfile}
+required_files=${haproxy_config}
+
+# Commands: start, stop, restart, reload, checkconfig
+extra_commands="reload checkconfig"
+
+checkconfig_cmd="haproxy_checkconfig"
+reload_cmd="haproxy_reload"
+
+haproxy_reload()
+{
+       # Check configuration file quietly first
+       ${command} -q -c -f ${haproxy_config}
+       if [ $? -ne 0 ]; then
+               echo "Error found in ${haproxy_config} - not reloading current process!"
+               return
+       fi
+       rc_pid=$(check_pidfile ${haproxy_pidfile} ${command})
+       if [ $rc_pid ]; then
+               if [ $rc_force ]; then
+                       ${command} ${haproxy_flags} -st ${rc_pid}
+               else
+                       ${command} ${haproxy_flags} -sf ${rc_pid}
+               fi
+       else
+               echo "No process found.  Maybe $command isn't running?"
+       fi
+}
+
+haproxy_checkconfig()
+{
+       ${command} -c -f ${haproxy_config}
+}
+
+haproxy_prestart()
+{
+       ${command} -q -c -f ${haproxy_config}
+       rc_flags=${haproxy_flags}
+}
+
+haproxy_prestop()
+{
+       # SIGUSR1 = softstop, SIGTERM = faststop
+       if [ $rc_force ]; then
+               sig_stop="SIGTERM"
+       else
+               sig_stop="SIGUSR1"
+       fi
+}

-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}
-       }
-
-reload_cmd="$command $haproxy_flags -sf $(cat $pidfile)"

-extra_commands="reload gracefulstop"
 run_rc_command "$1"
diff -ruN --exclude=CVS /usr/ports/net/haproxy-devel.1.3.25/files/patch-Makefile.bsd /usr/ports/net/haproxy-devel/files/patch-Makefile.bsd
--- /usr/ports/net/haproxy-devel.1.3.25/files/patch-Makefile.bsd        2008-07-08 05:19:03.000000000 -0400
+++ /usr/ports/net/haproxy-devel/files/patch-Makefile.bsd       1969-12-31 19:00:00.000000000 -0500
@@ -1,96 +0,0 @@
---- ./Makefile.bsd.orig        2007-12-05 16:25:44.000000000 -0800
-+++ ./Makefile.bsd     2008-01-17 11:26:47.695860700 -0800
-@@ -1,4 +1,4 @@
--# This makefile is dedicated to OpenBSD (and possibly other BSDs)
-+# This makefile is dedicated to FreeBSD (and possibly other BSDs)
- # You should use it this way :
- #   make TARGET=os CPU=cpu
- #
-@@ -9,31 +9,31 @@
-
- # Select target OS. TARGET must match a system for which COPTS and LIBS are
- # correctly defined below.
--TARGET = openbsd
-+TARGET = freebsd
-
- # pass CPU=<cpu_name> to make to optimize for a particular CPU
--CPU = generic
-+#CPU = generic
- #CPU = i586
- #CPU = i686
- #CPU = ultrasparc
-
- # By default, we use libc's regex. WARNING! On Solaris 8/Sparc, group
- # references seem broken using libc ! Use pcre instead.
--REGEX=libc
-+REGEX?=libc
- #REGEX=pcre
- #REGEX=static-pcre
-
- # tools options
--CC = gcc
--LD = gcc
-+CC? = gcc
-+LD? = gcc
-
- # This is the directory hosting include/pcre.h and lib/libpcre.* when REGEX=pcre
--PCREDIR!= pcre-config --prefix 2>/dev/null || :
--#PCREDIR=/usr/local
-+#PCREDIR!= pcre-config --prefix 2>/dev/null || :
-+PCREDIR=${LOCALBASE}
-
--# This is for OpenBSD 3.0 and above
--COPTS.openbsd = -DENABLE_POLL -DENABLE_KQUEUE
--LIBS.openbsd =
-+# This is for FreeBSD
-+COPTS.freebsd = -DENABLE_POLL -DENABLE_KQUEUE
-+LIBS.freebsd =
-
- # CPU dependant optimizations
- COPTS.generic = -O2
-@@ -55,7 +55,7 @@
-
- # you can enable debug arguments with "DEBUG=-g" or disable them with "DEBUG="
- #DEBUG = -g -DDEBUG_MEMORY -DDEBUG_FULL
--DEBUG = -g
-+#DEBUG = -g
-
- # if small memory footprint is required, you can reduce the buffer size. There
- # are 2 buffers per concurrent session, so 16 kB buffers will eat 32 MB memory
-@@ -63,7 +63,7 @@
- # will avoid the additionnal paramters to overflow a page. 8030 bytes is
- # exactly 5.5 TCP segments of 1460 bytes.
- #SMALL_OPTS =
--SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024
-+#SMALL_OPTS = -DBUFSIZE=8030 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=1024
-
- # redefine this if you want to add some special PATH to include/libs
- ADDINC =
-@@ -75,7 +75,7 @@
- # set some defines when needed.
- # Known ones are -DENABLE_POLL
- # - use -DTPROXY to compile with transparent proxy support.
--DEFINE = -DTPROXY
-+#DEFINE = -DTPROXY
-
- # May be changed to patch PAGE_SIZE on every platform when using dlmalloc
- DLMALLOC_THRES=4096
-@@ -95,7 +95,7 @@
- COPTS   = -Iinclude $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) $(REGEX_OPTS) \
-           $(SMALL_OPTS) $(VER_OPTS) $(DEFINE)
- LIBS    = $(LIBS.$(TARGET)) $(LIBS.$(REGEX)) $(ADDLIB)
--CFLAGS  = -Wall $(COPTS) $(DEBUG)
-+CFLAGS  += -Wall $(COPTS)
- LDFLAGS = -g
-
- OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \
-@@ -112,7 +112,8 @@
- all: haproxy
-
- haproxy: $(OBJS) $(OPT_OBJS)
--      $(LD) $(LDFLAGS) -o $@ $> $(LIBS)
-+#     $(LD) $(LDFLAGS) -o $@ $> $(LIBS)
-+      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $> $(LIBS)
-
- .SUFFIXES: .c.o
-
diff -ruN --exclude=CVS /usr/ports/net/haproxy-devel.1.3.25/files/pkg-message.in /usr/ports/net/haproxy-devel/files/pkg-message.in
--- /usr/ports/net/haproxy-devel.1.3.25/files/pkg-message.in    1969-12-31 19:00:00.000000000 -0500
+++ /usr/ports/net/haproxy-devel/files/pkg-message.in   2010-08-27 15:54:03.000000000 -0400
@@ -0,0 +1,16 @@
+
+************************************************
+*  THIS IS THE DEVELOPMENT BRANCH OF HAPROXY!  *
+************************************************
+
+Please use the main port (net/haproxy) for the
+stable branch of haproxy for general production
+use of the software.
+
+Check the following directories for further info:
+  documentation:  '%%DOCSDIR%%/haproxy'
+  examples:       '%%EXAMPLESDIR%%/haproxy'
+
+rc.conf variables listing can be found in:
+  '%%PREFIX%%/etc/rc.d/haproxy'
+
diff -ruN --exclude=CVS /usr/ports/net/haproxy-devel.1.3.25/pkg-descr /usr/ports/net/haproxy-devel/pkg-descr
--- /usr/ports/net/haproxy-devel.1.3.25/pkg-descr       2007-08-05 15:42:52.000000000 -0400
+++ /usr/ports/net/haproxy-devel/pkg-descr      2010-08-27 15:54:03.000000000 -0400
@@ -1,8 +1,9 @@
-HAproxy is a high-performance and highly-robust TCP/HTTP load balancer which
-provides cookie-based persistence, automatic failover, header insertion,
-deletion, modification on the fly, advanced logging contents to help trouble-
-shooting buggy applications and/or networks, and a few other features. It uses
-its own state machine to achieve up to ten thousands hits per second on modern
-hardware, even with thousands simultaneous connections.
+HAProxy is a free, very fast and reliable solution offering high
+availability, load balancing, and proxying for TCP and HTTP-based
+applications. It is particularly suited for web sites crawling under
+very high loads while needing persistence or Layer7 processing.
+
+This is the development branch of the software, which may contain
+new features, but also possibly new bugs.

 WWW: http://haproxy.1wt.eu/


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list