aboutsummaryrefslogtreecommitdiffstats
path: root/www/gatling
diff options
context:
space:
mode:
authordhn <dhn@FreeBSD.org>2009-05-29 01:21:46 +0800
committerdhn <dhn@FreeBSD.org>2009-05-29 01:21:46 +0800
commit7ecbb64b66af3043c27600802a9fe4ddc6f40abc (patch)
tree0572fb107a54a13f64e8687d8fc1912be57c0979 /www/gatling
parent84890baf300e85324e8e8e4d6364517a7caa8b40 (diff)
downloadfreebsd-ports-gnome-7ecbb64b66af3043c27600802a9fe4ddc6f40abc.tar.gz
freebsd-ports-gnome-7ecbb64b66af3043c27600802a9fe4ddc6f40abc.tar.zst
freebsd-ports-gnome-7ecbb64b66af3043c27600802a9fe4ddc6f40abc.zip
- Update to 0.10
PR: ports/135027 Submitted by: Thomas-Martin Seck <tmseck@netcologne.de> (maintainer)
Diffstat (limited to 'www/gatling')
-rw-r--r--www/gatling/Makefile37
-rw-r--r--www/gatling/distinfo6
-rw-r--r--www/gatling/files/extra-patch-disable_smb11
-rw-r--r--www/gatling/files/gatling.in67
-rw-r--r--www/gatling/files/gatling_wrapper91
-rw-r--r--www/gatling/files/patch-GNUmakefile84
-rw-r--r--www/gatling/files/patch-bench.c10
-rw-r--r--www/gatling/files/patch-dl.c13
-rw-r--r--www/gatling/files/patch-gatling.c10
-rw-r--r--www/gatling/files/patch-http.c9
-rw-r--r--www/gatling/files/patch-matchiprange.c10
-rw-r--r--www/gatling/files/patch-rellink.c10
-rw-r--r--www/gatling/files/patch-strndup.c65
13 files changed, 353 insertions, 70 deletions
diff --git a/www/gatling/Makefile b/www/gatling/Makefile
index 6a94f20e255f..c1276610d5d5 100644
--- a/www/gatling/Makefile
+++ b/www/gatling/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= gatling
-PORTVERSION= 0.9
+PORTVERSION= 0.10
CATEGORIES= www benchmarks ftp ipv6
MASTER_SITES= http://dl.fefe.de/
@@ -18,6 +18,7 @@ BUILD_DEPENDS= libowfat>=0.25:${PORTSDIR}/devel/libowfat
USE_BZIP2= yes
USE_GMAKE= yes
USE_OPENSSL= yes
+USE_RC_SUBR= gatling
CFLAGS+= -I${LOCALBASE}/include/libowfat -I${OPENSSLINC}
LDFLAGS+= -L${LOCALBASE}/lib -L${OPENSSLLIB}
@@ -28,16 +29,18 @@ MAKE_ENV+= PTHREAD_LIBS="${PTHREAD_LIBS}"
bin= dl
sbin= gatling
MAN8= gatling.8
-PORTDOCS= CHANGES README README.cgi README.ftp README.htaccess \
+PORTDOCS= CHANGES README README.antidos README.cgi README.ftp \
+ README.htaccess \
README.http README.performance README.prefetch README.proxy \
README.redirect
-PORTEXAMPLES= run-gatling cgi acc hcat referrer
+PORTEXAMPLES= run-gatling cgi acc getlinks hcat hitprofile matchiprange \
+ referrer
OPTIONS= GATLING_BENCHMARKS "Install some benchmark programs" on \
- GATLING_ICONV "Use charset conversion" off \
- GATLING_TLS "Install tlsgatling" off \
- GATLING_ZLIB "Compress outgoing data" off \
- GATLING_OPTIMIZED_CFLAGS "Use optimized CFLAGS" on
+ GATLING_SMB "Add (read only) SMB support" on \
+ GATLING_TLS "Build and install tlsgatling" on \
+ GATLING_ZLIB "Compress outgoing data" on \
+ GATLING_OPTIMIZED_CFLAGS "Add additional optimizations" on
.include <bsd.port.pre.mk>
@@ -47,30 +50,38 @@ PORTDOCS+= README.bindbench README.forkbench README.httpbench \
bin+= bindbench forkbench forksbench httpbench ioerr manymapbench \
mktestdata mmapbench pthreadbench
examples+= prep run-bench
+MAN1+= bench.1
MAKE_ENV+= BENCHMARKS=1
.endif
-.if defined(WITH_GATLING_OPTIMIZED_CFLAGS)
+.if defined(WITH_GATLING_OPTIMIZED_CFLAGS) && !defined(WITH_DEBUG)
CFLAGS+= -O2 -fomit-frame-pointer
.endif
-.if defined(WITH_GATLING_ICONV)
+.if defined(WITH_GATLING_SMB)
USE_ICONV= yes
CFLAGS+= -I${LOCALBASE}/include
MAKE_ENV+= ICONV=1
+.else
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-disable_smb
.endif
.if defined(WITH_GATLING_TLS)
MAKE_ENV+= TLSGATLING=1
sbin+= tlsgatling
-portdocs+= README.tls
+PORTDOCS+= README.tls
.endif
.if defined(WITH_GATLING_ZLIB)
MAKE_ENV+= ZLIB=1
.endif
-PLIST_FILES= ${bin:S,^,bin/,} ${sbin:S,^,sbin/,}
+.if defined(WITH_DEBUG)
+MAKE_ENV+= DEBUG=1
+STRIP=
+.endif
+
+PLIST_FILES= ${bin:S,^,bin/,} ${sbin:S,^,sbin/,} sbin/gatling_wrapper
pre-install:
@cd ${WRKSRC} && ${CP} gatling.1 gatling.8
@@ -78,10 +89,14 @@ pre-install:
do-install:
cd ${WRKSRC} && ${INSTALL_PROGRAM} ${bin} ${PREFIX}/bin
cd ${WRKSRC} && ${INSTALL_PROGRAM} ${sbin} ${PREFIX}/sbin
+ ${INSTALL_SCRIPT} ${FILESDIR}/gatling_wrapper ${PREFIX}/sbin
.if !defined(NOPORTEXAMPLES)
${MKDIR} ${EXAMPLESDIR}
cd ${WRKSRC} && ${INSTALL_SCRIPT} ${PORTEXAMPLES} ${EXAMPLESDIR}
.endif
+.if !empty(MAN1)
+ cd ${WRKSRC} && ${INSTALL_MAN} ${MAN1} ${MAN1PREFIX}/man/man1
+.endif
cd ${WRKSRC} && ${INSTALL_MAN} ${MAN8} ${MAN8PREFIX}/man/man8
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
diff --git a/www/gatling/distinfo b/www/gatling/distinfo
index e3742330e38e..d276ad3cb185 100644
--- a/www/gatling/distinfo
+++ b/www/gatling/distinfo
@@ -1,3 +1,3 @@
-MD5 (gatling-0.9.tar.bz2) = bae9a695b7ced3ba0a4b359369273a66
-SHA256 (gatling-0.9.tar.bz2) = 6fa7c1278fd7d05422e073e4062cd931e10d2593fe73728fdcf0e2541db01bbe
-SIZE (gatling-0.9.tar.bz2) = 73831
+MD5 (gatling-0.10.tar.bz2) = 04e8434156d91657c77a8a038c5b27cf
+SHA256 (gatling-0.10.tar.bz2) = 1981ee8706a423e06e507c25202e83785595feabe68c148350818bc50380d416
+SIZE (gatling-0.10.tar.bz2) = 98422
diff --git a/www/gatling/files/extra-patch-disable_smb b/www/gatling/files/extra-patch-disable_smb
new file mode 100644
index 000000000000..438aa2fbc0b7
--- /dev/null
+++ b/www/gatling/files/extra-patch-disable_smb
@@ -0,0 +1,11 @@
+--- gatling_features.h.orig 2009-04-13 16:18:09.000000000 +0200
++++ gatling_features.h 2009-04-13 16:19:18.000000000 +0200
+@@ -6,7 +6,7 @@
+ // #define SUPPORT_BITTORRENT
+
+ #define SUPPORT_SERVERSTATUS
+-#define SUPPORT_SMB
++#undef SUPPORT_SMB
+ #define SUPPORT_FTP
+ #define SUPPORT_PROXY
+ /* #define DEBUG to enable more verbose debug messages for tracking fd
diff --git a/www/gatling/files/gatling.in b/www/gatling/files/gatling.in
new file mode 100644
index 000000000000..f6dccae7a479
--- /dev/null
+++ b/www/gatling/files/gatling.in
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: gatling
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Set "gatling_enable=yes" in either /etc/rc.conf, /etc/rc.conf.local or
+# /etc/rc.conf.d/gatling to enable gatling.
+#
+# Set gatling_root if you want to serve files from other locations than
+# the default (%%PREFIX%%/www/data).
+#
+# Set gatling_ftp_enable=yes to make gatling serve files via FTP, too.
+#
+# Set gatling_ssl_enable=yes to serve files via HTTPS/SSL (needs tlsgatling).
+#
+# Additionally, you can set gatling_effective_user and gatling_flags; please
+# see gatling(8) for further information about possible gatling_flags.
+
+check_user() {
+ /usr/sbin/pw usershow -n ${gatling_effective_user} -q >/dev/null
+}
+
+. %%RC_SUBR%%
+
+name=gatling
+rcvar=`set_rcvar`
+
+load_rc_config ${name}
+
+gatling_enable=${gatling_enable-"NO"}
+gatling_root=${gatling_root:-%%PREFIX%%/www/data}
+# needed to bind privileged ports at startup:
+gatling_user=root
+gatling_effective_user=${gatling_effective_user:-www}
+gatling_flags="-u ${gatling_effective_user} -c ${gatling_root} ${gatling_flags}"
+case "${gatling_ftp_enable}" in
+ [Yy][Ee][Ss])
+ gatling_flags="-f ${gatling_flags}"
+ ;;
+ *)
+ gatling_flags="-F ${gatling_flags}"
+ ;;
+esac
+
+case "${gatling_ssl_enable}" in
+ [Yy][Ee][Ss])
+ which_gatling="%%PREFIX%%/sbin/tlsgatling"
+ ;;
+ *)
+ which_gatling="%%PREFIX%%/sbin/gatling"
+ ;;
+esac
+
+gatling_flags="${which_gatling} ${gatling_flags} &"
+command="%%PREFIX%%/sbin/gatling_wrapper"
+command_interpreter="/bin/sh -T"
+pidfile=/var/run/gatling_wrapper.pid
+required_dirs="${gatling_root}"
+required_files="${which_gatling}"
+
+start_precmd=check_user
+run_rc_command "$1"
+
diff --git a/www/gatling/files/gatling_wrapper b/www/gatling/files/gatling_wrapper
new file mode 100644
index 000000000000..7b5e9a8c1b6d
--- /dev/null
+++ b/www/gatling/files/gatling_wrapper
@@ -0,0 +1,91 @@
+#!/bin/sh -T
+#
+#-
+# Copyright 2009 Thomas-Martin Seck. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted providing that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+# gatling_wrapper {gatling|tlsgatling} [options]
+#
+# A simple wrapper script for gatling (or any other program that does not
+# daemonize itself and logs to stdout).
+#
+# This wrapper tries to emulate part of the functionality usually supplied
+# by software like daemontools or runit.
+# It can be used by a FreeBSD port rc.d script to start a program
+# that does not daemonize itself and logs to stdout/stderr. It redirects stdout
+# and stderr to logger(1) via a fifo.
+#
+# Note: We need a shell that can offer us asynchronous trap handling in order
+# to be able to abort the infinite loop from outside. FreeBSD's /bin/sh offers
+# the "-T" switch for this purpose.
+#
+# TODO: send fd 2 output to never-never land to get rid of "Terminated" when we
+# kill this script but provide a way for errx() to communicate with the outside
+# world via stderr.
+
+errx() {
+ echo "${me}: $@" >&2
+ exit 1
+}
+
+cleanup() {
+ rm -rf ${tmpdir}
+ rm -f ${pidfile}
+}
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+me=${0##*/}
+logger=/usr/bin/logger
+daemon_log_facility=daemon.notice
+self_log_facility=daemon.notice
+pidfile=/var/run/${me}.pid
+daemon_name=gatling
+daemon_program="$1"
+shift
+
+test -x "${daemon_program}" || errx "cannot execute ${daemon_program}!"
+test -x ${logger} || errx "cannot execute ${logger}!"
+test -f ${pidfile} && errx "${pidfile} is already present -- is another instance of ${me} running?"
+echo $$ >${pidfile} || errx "cannot write to ${pidfile}!"
+tmpdir=`mktemp -d /tmp/${me}.XXXXXXXXXX` || errx "cannot generate tmpdir!"
+
+logfifo=${tmpdir}/fifo
+mkfifo -m 0600 ${logfifo} || errx "cannot generate fifo!"
+
+while true; do
+ trap 'break' 1 2 3 6 9 15
+ ${logger} -i -p ${daemon_log_facility} -t ${daemon_name} <${logfifo} &
+ log_pid=$!
+ "${daemon_program}" $@ >${logfifo} 2>&1 &
+ daemon_pid=$!
+ wait ${daemon_pid}
+ ${logger} -i -p ${self_log_facility} -t ${me} "${daemon_program} died -- restarting..."
+ sleep 2
+done
+
+kill -TERM ${daemon_pid} 2>/dev/null
+wait
+cleanup
diff --git a/www/gatling/files/patch-GNUmakefile b/www/gatling/files/patch-GNUmakefile
index ec969e4cd5cc..0ecb695d3c39 100644
--- a/www/gatling/files/patch-GNUmakefile
+++ b/www/gatling/files/patch-GNUmakefile
@@ -1,7 +1,7 @@
---- GNUmakefile.orig Wed Jan 31 18:05:38 2007
-+++ GNUmakefile Mon Aug 27 16:49:36 2007
-@@ -1,21 +1,26 @@
- #DEBUG=1
+--- GNUmakefile.orig 2009-04-09 19:00:23.000000000 +0200
++++ GNUmakefile 2009-04-10 17:46:56.000000000 +0200
+@@ -1,24 +1,23 @@
+-#DEBUG=1
-ZLIB=1
-prefix=/opt/diet
+prefix=${PREFIX}
@@ -10,34 +10,33 @@
man1dir=$(MANDIR)/man1
-TARGETS=gatling httpbench bindbench dl ioerr bench tlsgatling \
--pthreadbench cgi getlinks rellink acc hcat
+-pthreadbench cgi
-TARGETS2=mktestdata mmapbench manymapbench forkbench forksbench
-+TARGETS=cgi dl gatling getlinks rellink acc hcat referrer
++TARGETS=gatling dl \
++cgi
+TARGETS2=
+ifdef BENCHMARKS
-+TARGETS+=httpbench bindbench ioerr pthreadbench
++TARGETS+=httpbench bindbench ioerr bench pthreadbench
+TARGETS2+=mktestdata mmapbench manymapbench forkbench forksbench
+endif
+ifdef TLSGATLING
+TARGETS+=tlsgatling
+endif
+ ALLTARGETS=$(TARGETS) acc hcat referrer hitprofile matchiprange getlinks \
+ rellink $(TARGETS2)
--all: $(TARGETS) $(TARGETS2)
-+all: checklibs $(TARGETS) $(TARGETS2)
+ all: $(ALLTARGETS)
-CROSS=
-+#CROSS=
- #CROSS=i686-mingw32-
+-#CROSS=i686-mingw32-
-CC=$(CROSS)gcc
-CFLAGS=-pipe -Wall
-LDFLAGS=
-+#CC=$(CROSS)gcc
-+#CFLAGS=-pipe -Wall
-+#LDFLAGS=
-
+-
path = $(subst :, ,$(PATH))
diet_path = $(foreach dir,$(path),$(wildcard $(dir)/diet))
-@@ -32,15 +37,11 @@
+ ifeq ($(strip $(diet_path)),)
+@@ -34,15 +33,11 @@
# to build without diet libc support, use $ make DIET=
# see http://www.fefe.de/dietlibc/ for details about the diet libc
@@ -55,7 +54,7 @@
endif
LDLIBS=-lowfat
-@@ -66,7 +67,7 @@
+@@ -68,7 +63,7 @@
CC:=$(DIET) $(CC)
pthreadbench: pthreadbench.o
@@ -64,16 +63,20 @@
forksbench: forkbench.o
$(CC) -static -o $@ forkbench.o $(LDFLAGS) $(LDLIBS)
-@@ -74,7 +75,7 @@
- gatling.o: version.h havesetresuid.h
-
- tlsgatling: gatling.c ssl.o mime.o
-- -$(CC) -o $@ gatling.c ssl.o mime.o $(CFLAGS) -DSUPPORT_HTTPS $(LDFLAGS) -lssl -lcrypto $(LDLIBS)
-+ $(CC) -o $@ gatling.c ssl.o mime.o $(CFLAGS) -DSUPPORT_HTTPS $(LDFLAGS) -lssl -lcrypto $(LDLIBS)
+@@ -86,9 +81,11 @@
+ gatling: gatling.o $(OBJS) md5lib
+ $(CC) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LDLIBS) `cat md5lib`
- gatling: gatling.o mime.o
- $(CC) $(LDFLAGS) $@.o mime.o -o $@ $(LDLIBS)
-@@ -107,9 +108,13 @@
++dl: dl.c havestrndup havestrndup.h
++ $(CC) $(CFLAGS) dl.c `cat havestrndup` $(LDFLAGS) -lowfat -o $@
++
+ httpbench: httpbench.o
+ bindbench: bindbench.o
+-dl: dl.o
+ ioerr: ioerr.o
+ bench: bench.o
+ getlinks: getlinks.o
+@@ -121,9 +118,13 @@
rm -f trysocket
libiconv: tryiconv.c
@@ -81,7 +84,7 @@
- if $(CC) $(CFLAGS) -o tryiconv tryiconv.c -liconv >/dev/null 2>&1; then echo "-liconv"; \
- fi; fi > libiconv
+ifdef ICONV
-+ if $(CC) $(CFLAGS) -L$(LOCALBASE)/lib -o tryiconv tryiconv.c -liconv >/dev/null 2>&1; then echo "-L$(LOCALBASE)/lib -liconv"; else \
++ if $(CC) $(CFLAGS) $(LDFLAGS) -o tryiconv tryiconv.c -liconv >/dev/null 2>&1; then echo "-L$(LDFLAGS) -liconv"; else \
+ echo ""; \
+ fi > libiconv
+else
@@ -90,25 +93,14 @@
rm -f tryiconv
libcrypt: trycrypt.c
-@@ -130,9 +135,11 @@
- ar q $@ dummy.o
- -ranlib $@
+@@ -144,6 +145,10 @@
+ if $(CC) $(CFLAGS) -o tryresuid $^ >/dev/null 2>&1; then echo "#define LIBC_HAS_SETRESUID"; fi > $@
+ -rm -f tryresuid
-+checklibs: libsocket libiconv libcrypt
++havestrndup havestrndup.h: trystrndup.c
++ if $(CC) $(CFLAGS) -o trystrndup $^ >/dev/null 2>&1; then echo "">havestrndup; echo "#define LIBC_HAS_STRNDUP">havestrndup.h; else echo "strndup.c">havestrndup; echo "">havestrndup.h; fi
++ rm -f trystrndup
+
- LDLIBS+=`cat libsocket libiconv libcrypt`
-
--$(TARGETS): libsocketkludge.a libsocket libiconv libcrypt
-+$(TARGETS): libsocketkludge.a
-
- install: gatling dl getlinks
- install -d $(DESTDIR)$(BINDIR) $(man1dir)
-@@ -144,7 +151,7 @@
- rm -f $(DESTDIR)$(BINDIR)/gatling $(DESTDIR)$(BINDIR)/tlsgatling $(DESTDIR)$(man1dir)/gatling.1 $(DESTDIR)$(man1dir)/bench.1
-
- clean:
-- rm -f $(TARGETS) *.o version.h core *.core libsocket libsocketkludge.a dummy.c libiconv libcrypt havesetresuid.h
-+ rm -f $(TARGETS) $(TARGETS2) *.o version.h core *.core libsocket libsocketkludge.a dummy.c libiconv libcrypt havesetresuid.h
+ dummy.c:
+ touch $@
- VERSION=gatling-$(shell head -n 1 CHANGES|sed 's/://')
- CURNAME=$(notdir $(shell pwd))
diff --git a/www/gatling/files/patch-bench.c b/www/gatling/files/patch-bench.c
new file mode 100644
index 000000000000..e833944cc33c
--- /dev/null
+++ b/www/gatling/files/patch-bench.c
@@ -0,0 +1,10 @@
+--- bench.c.orig 2009-04-10 18:15:06.000000000 +0200
++++ bench.c 2009-04-10 18:15:19.000000000 +0200
+@@ -13,6 +13,7 @@
+ #include <errno.h>
+ #include <buffer.h>
+ #include <fcntl.h>
++#include <string.h>
+
+ void usage() {
+ die(0,"usage: bench [-n requests] [-c concurrency] [-t timeout] [-k] [-K count]\n"
diff --git a/www/gatling/files/patch-dl.c b/www/gatling/files/patch-dl.c
new file mode 100644
index 000000000000..e2828dc78ef7
--- /dev/null
+++ b/www/gatling/files/patch-dl.c
@@ -0,0 +1,13 @@
+--- dl.c.orig 2009-04-10 17:51:59.000000000 +0200
++++ dl.c 2009-04-10 17:56:31.000000000 +0200
+@@ -37,6 +37,10 @@
+ #include <assert.h>
+ #include <ctype.h>
+ #include <string.h>
++#include "havestrndup.h"
++#ifndef LIBC_HAS_STRNDUP
++char* strndup(const char*, size_t);
++#endif
+
+ int dostats;
+
diff --git a/www/gatling/files/patch-gatling.c b/www/gatling/files/patch-gatling.c
deleted file mode 100644
index 74c43a1a3e3e..000000000000
--- a/www/gatling/files/patch-gatling.c
+++ /dev/null
@@ -1,10 +0,0 @@
---- gatling.c.orig Mon Aug 27 16:08:00 2007
-+++ gatling.c Mon Aug 27 16:08:06 2007
-@@ -101,7 +101,6 @@
- #include <fcntl.h>
- #include <string.h>
- #include <ctype.h>
--#include <crypt.h>
- #include "havealloca.h"
- #include "havesetresuid.h"
-
diff --git a/www/gatling/files/patch-http.c b/www/gatling/files/patch-http.c
new file mode 100644
index 000000000000..13e52e79d9dd
--- /dev/null
+++ b/www/gatling/files/patch-http.c
@@ -0,0 +1,9 @@
+--- http.c.orig 2009-04-10 16:01:37.000000000 +0200
++++ http.c 2009-04-10 16:01:57.000000000 +0200
+@@ -1,4 +1,6 @@
++/* this define breaks the build on FreeBSD:
+ #define _XOPEN_SOURCE 500
++*/
+
+ #include "gatling.h"
+
diff --git a/www/gatling/files/patch-matchiprange.c b/www/gatling/files/patch-matchiprange.c
new file mode 100644
index 000000000000..c12afc7486c3
--- /dev/null
+++ b/www/gatling/files/patch-matchiprange.c
@@ -0,0 +1,10 @@
+--- matchiprange.c.orig 2009-04-10 18:17:38.000000000 +0200
++++ matchiprange.c 2009-04-10 18:17:58.000000000 +0200
+@@ -17,6 +17,7 @@
+ #include <fmt.h>
+ #include <ctype.h>
+ #include <ip6.h>
++#include <string.h>
+
+ char _buf[8192];
+
diff --git a/www/gatling/files/patch-rellink.c b/www/gatling/files/patch-rellink.c
new file mode 100644
index 000000000000..8503f2edd933
--- /dev/null
+++ b/www/gatling/files/patch-rellink.c
@@ -0,0 +1,10 @@
+--- rellink.c.orig 2009-04-10 18:15:33.000000000 +0200
++++ rellink.c 2009-04-10 18:15:46.000000000 +0200
+@@ -17,6 +17,7 @@
+ #include <fcntl.h>
+ #include <sys/mman.h>
+ #include <utime.h>
++#include <string.h>
+
+ static int canonicalize(stralloc* url,const char* baseurl) {
+ /* for the comments, assume baseurl is "http://www.fefe.de/x/y.html" */
diff --git a/www/gatling/files/patch-strndup.c b/www/gatling/files/patch-strndup.c
new file mode 100644
index 000000000000..0993ebceca87
--- /dev/null
+++ b/www/gatling/files/patch-strndup.c
@@ -0,0 +1,65 @@
+--- /dev/null 2009-04-10 17:44:00.000000000 +0200
++++ trystrndup.c 2009-04-10 17:01:00.000000000 +0200
+@@ -0,0 +1,6 @@
++#include <string.h>
++int main() {
++char* s;
++s=strndup("foo",3);
++return 0;
++}
+--- /dev/null 2009-04-10 16:55:00.000000000 +0200
++++ strndup.c 2009-01-08 10:50:20.000000000 +0100
+@@ -0,0 +1,53 @@
++/* $NetBSD: strndup.c,v 1.3 2007/01/14 23:41:24 cbiere Exp $ */
++
++/*
++ * Copyright (c) 1988, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#include <sys/cdefs.h>
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/www/gatling/files/Attic/patch-strndup.c,v 1.1 2009-05-28 17:21:46 dhn Exp $");
++
++#include <stddef.h>
++#include <stdlib.h>
++#include <string.h>
++
++char *
++strndup(const char *str, size_t n)
++{
++ size_t len;
++ char *copy;
++
++ for (len = 0; len < n && str[len]; len++)
++ continue;
++
++ if ((copy = malloc(len + 1)) == NULL)
++ return (NULL);
++ memcpy(copy, str, len);
++ copy[len] = '\0';
++ return (copy);
++}