pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Add haproxy with LUA support.
Module Name: pkgsrc-wip
Committed By: Juraj Lutter <juraj%lutter.sk@localhost>
Pushed By: otis
Date: Mon Oct 31 23:05:54 2016 +0000
Changeset: a4e6c2ed5defb224b589d07bff5c89534770fe63
Added Files:
haproxy/DESCR
haproxy/Makefile
haproxy/PLIST
haproxy/PLIST.Linux
haproxy/distinfo
haproxy/files/haproxy.sh
haproxy/files/smf/manifest.xml
haproxy/options.mk
haproxy/patches/patch-Makefile
Log Message:
Add haproxy with LUA support.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=a4e6c2ed5defb224b589d07bff5c89534770fe63
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
haproxy/DESCR | 6 ++++
haproxy/Makefile | 64 ++++++++++++++++++++++++++++++++++++++++++
haproxy/PLIST | 11 ++++++++
haproxy/PLIST.Linux | 2 ++
haproxy/distinfo | 7 +++++
haproxy/files/haproxy.sh | 43 ++++++++++++++++++++++++++++
haproxy/files/smf/manifest.xml | 28 ++++++++++++++++++
haproxy/options.mk | 53 ++++++++++++++++++++++++++++++++++
haproxy/patches/patch-Makefile | 16 +++++++++++
9 files changed, 230 insertions(+)
diffs:
diff --git a/haproxy/DESCR b/haproxy/DESCR
new file mode 100644
index 0000000..f2e3c28
--- /dev/null
+++ b/haproxy/DESCR
@@ -0,0 +1,6 @@
+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.
+Supporting tens of thousands of connections is clearly realistic with
+todays hardware.
diff --git a/haproxy/Makefile b/haproxy/Makefile
new file mode 100644
index 0000000..2bfcafd
--- /dev/null
+++ b/haproxy/Makefile
@@ -0,0 +1,64 @@
+# $NetBSD: Makefile,v 1.29 2016/10/13 19:08:34 morr Exp $
+
+DISTNAME= haproxy-1.6.9
+PKGREVISION= 1
+CATEGORIES= net www
+MASTER_SITES= http://www.haproxy.org/download/1.6/src/
+
+MAINTAINER= morr%NetBSD.org@localhost
+HOMEPAGE= http://haproxy.org/
+COMMENT= Reliable, high performance TCP/HTTP load balancer
+LICENSE= gnu-gpl-v2
+
+USE_TOOLS+= gmake
+BUILD_MAKE_FLAGS+= TARGET=${TARGET} ADDLIB=${COMPILER_RPATH_FLAG}${PREFIX}/lib \
+ USE_ZLIB=1 \
+ USE_REGPARM=1
+
+INSTALL_MAKE_FLAGS+= TARGET=${TARGET}
+INSTALL_MAKE_FLAGS+= PREFIX=${PREFIX}
+INSTALL_MAKE_FLAGS+= DOCDIR=${PREFIX}/share/doc/${PKGBASE}
+INSTALL_MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}
+
+.include "options.mk"
+
+RCD_SCRIPTS= haproxy
+EGDIR= ${PREFIX}/share/examples/${PKGBASE}
+DOCDIR= ${PREFIX}/share/doc/${PKGBASE}
+INSTALLATION_DIRS+= ${EGDIR}
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "NetBSD"
+TARGET=netbsd
+.elif ${OPSYS} == "FreeBSD"
+TARGET=freebsd
+.elif ${OPSYS} == "OpenBSD"
+TARGET=openbsd
+.elif ${OPSYS} == "SunOS"
+TARGET=solaris
+.elif ${OPSYS} == "Linux"
+. if !empty(OS_VERSION:M2.6.*)
+TARGET=linux26
+. elif !empty(OS_VERSION:M2.4.*)
+. if exists(/usr/include/linux/eventpoll.h)
+TARGET=linux24e
+. else
+TARGET=linux24
+. endif
+. else
+TARGET=generic
+. endif
+.else
+TARGET=generic
+.endif
+
+LIBS.SunOS+= -lxnet
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/doc/architecture.txt ${DESTDIR}${DOCDIR}/
+ ${INSTALL_DATA} ${WRKSRC}/doc/configuration.txt ${DESTDIR}${DOCDIR}/
+ ${INSTALL_DATA} ${WRKSRC}/examples/*.cfg ${DESTDIR}${EGDIR}/
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/haproxy/PLIST b/haproxy/PLIST
new file mode 100644
index 0000000..7a1ddd0
--- /dev/null
+++ b/haproxy/PLIST
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST,v 1.7 2016/03/14 09:23:31 fhajny Exp $
+man/man1/haproxy.1
+sbin/haproxy
+share/doc/haproxy/architecture.txt
+share/doc/haproxy/configuration.txt
+share/examples/haproxy/acl-content-sw.cfg
+share/examples/haproxy/auth.cfg
+share/examples/haproxy/content-sw-sample.cfg
+share/examples/haproxy/option-http_proxy.cfg
+share/examples/haproxy/ssl.cfg
+share/examples/haproxy/transparent_proxy.cfg
diff --git a/haproxy/PLIST.Linux b/haproxy/PLIST.Linux
new file mode 100644
index 0000000..9a37715
--- /dev/null
+++ b/haproxy/PLIST.Linux
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.Linux,v 1.1 2016/06/03 12:07:20 jperkin Exp $
+sbin/haproxy-systemd-wrapper
diff --git a/haproxy/distinfo b/haproxy/distinfo
new file mode 100644
index 0000000..73a7282
--- /dev/null
+++ b/haproxy/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.24 2016/10/13 19:08:34 morr Exp $
+
+SHA1 (haproxy-1.6.9.tar.gz) = a40a9fb1b2ac409e6afcd2924327c21ac32e7b5b
+RMD160 (haproxy-1.6.9.tar.gz) = f2c1c2ec78bf72246ad70298712229b05a5e6035
+SHA512 (haproxy-1.6.9.tar.gz) = 0060a93c628689e1ca9e5845f9f93641f7647efc176cbf093bce59be19496492c317c8101fa50dd6181b130f861c74a20199f18e41ebd6995715364b1ea46a2e
+Size (haproxy-1.6.9.tar.gz) = 1566715 bytes
+SHA1 (patch-Makefile) = f635093d547270603ffea8837a42a8cca2e03bdf
diff --git a/haproxy/files/haproxy.sh b/haproxy/files/haproxy.sh
new file mode 100644
index 0000000..3e3081f
--- /dev/null
+++ b/haproxy/files/haproxy.sh
@@ -0,0 +1,43 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: haproxy.sh,v 1.3 2016/02/16 21:59:45 morr Exp $
+#
+
+# PROVIDE: haproxy
+# REQUIRE: network
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="haproxy"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+conf_file="@PKG_SYSCONFDIR@/${name}.cfg"
+required_files="${conf_file}"
+command_args="-f ${conf_file}"
+extra_commands="configtest"
+configtest_cmd="haproxy_configtest"
+haproxy_fdlimit=${haproxy_fdlimit-"1024"}
+
+haproxy_configtest()
+{
+ if [ ! -f ${conf_file} ]; then
+ warn "${conf_file} does not exist."
+ return 1;
+ fi
+ ${command} -c -f ${conf_file}
+}
+
+# A default limit of 64 (at least on NetBSD) may be too low for many people
+SOFT_FDLIMIT=`ulimit -S -n`
+HARD_FDLIMIT=`ulimit -H -n`
+
+if [ ${haproxy_fdlimit} -gt ${SOFT_FDLIMIT} ]; then
+ if [ ${haproxy_fdlimit} -le ${HARD_FDLIMIT} ]; then
+ ulimit -S -n ${haproxy_fdlimit}
+ else
+ ulimit -S -n ${HARD_FDLIMIT}
+ fi
+fi
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/haproxy/files/smf/manifest.xml b/haproxy/files/smf/manifest.xml
new file mode 100644
index 0000000..e1a9f8d
--- /dev/null
+++ b/haproxy/files/smf/manifest.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="export">
+ <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
+ <create_default_instance enabled="false" />
+ <single_instance />
+ <dependency name="network" grouping="require_all" restart_on="error" type="service">
+ <service_fmri value="svc:/milestone/network:default" />
+ </dependency>
+ <dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
+ <service_fmri value="svc:/system/filesystem/local" />
+ </dependency>
+ <exec_method type="method" name="start" exec="@PREFIX@/sbin/haproxy -f %{config_file} -D" timeout_seconds="60" />
+ <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
+ <property_group name="startd" type="framework">
+ <propval name="duration" type="astring" value="contract" />
+ <propval name="ignore_error" type="astring" value="core,signal" />
+ </property_group>
+ <property_group name="application" type="application">
+ <propval name="config_file" type="astring" value="@PKG_SYSCONFDIR@/haproxy.cfg" />
+ </property_group>
+ <template>
+ <common_name>
+ <loctext xml:lang="C">HAProxy</loctext>
+ </common_name>
+ </template>
+ </service>
+</service_bundle>
diff --git a/haproxy/options.mk b/haproxy/options.mk
new file mode 100644
index 0000000..7692c83
--- /dev/null
+++ b/haproxy/options.mk
@@ -0,0 +1,53 @@
+# $NetBSD: options.mk,v 1.4 2016/01/03 17:13:40 morr Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.haproxy
+PKG_SUPPORTED_OPTIONS= pcre ssl deviceatlas lua
+PKG_SUGGESTED_OPTIONS= pcre ssl
+
+.include "../../mk/bsd.options.mk"
+
+###
+### Use libpcre rather than libc for header processing regexp
+###
+.if !empty(PKG_OPTIONS:Mpcre)
+. include "../../devel/pcre/buildlink3.mk"
+BUILD_MAKE_FLAGS+= USE_PCRE=1
+.endif
+
+###
+### Use LUA
+###
+.if !empty(PKG_OPTIONS:Mlua)
+. include "../../lang/lua/luaversion.mk"
+BUILD_MAKE_FLAGS+= USE_LUA=1
+BUILD_MAKE_FLAGS+= LUA_VERSION_ACCEPTED=53
+BUILD_MAKE_FLAGS+= LUA_INC=${PREFIX}/${LUA_INCDIR}
+. include "../../lang/lua/buildlink3.mk"
+.endif
+
+###
+### Support DeviceAtlas detection.
+###
+.if !empty(PKG_OPTIONS:Mpcre) && !empty(PKG_OPTIONS:Mdeviceatlas)
+DEVICEATLAS_VERSION= 2.1
+DEVICEATLAS_DISTFILE= deviceatlas-enterprise-c-${DEVICEATLAS_VERSION}
+DISTFILES= ${DISTNAME}.tar.gz ${DEVICEATLAS_DISTFILE}.zip
+DEVICEATLAS_HOMEPAGE= https://www.deviceatlas.com/deviceatlas-haproxy-module
+
+BUILD_MAKE_FLAGS+= USE_DEVICEATLAS=1 DEVICEATLAS_SRC=../${DEVICEATLAS_DISTFILE}
+
+.if !exists(${DISTDIR}/${DEVICEATLAS_DISTFILE}.zip)
+FETCH_MESSAGE= "Please fetch ${DEVICEATLAS_DISTFILE}.zip manually from"
+FETCH_MESSAGE+= "${DEVICEATLAS_HOMEPAGE}"
+FETCH_MESSAGE+= "and put into"
+FETCH_MESSAGE+= "${DISTDIR}"
+.endif
+.endif
+
+###
+### Support OpenSSL for termination.
+###
+.if !empty(PKG_OPTIONS:Mssl)
+. include "../../security/openssl/buildlink3.mk"
+BUILD_MAKE_FLAGS+= USE_OPENSSL=1
+.endif
diff --git a/haproxy/patches/patch-Makefile b/haproxy/patches/patch-Makefile
new file mode 100644
index 0000000..a1f44fd
--- /dev/null
+++ b/haproxy/patches/patch-Makefile
@@ -0,0 +1,16 @@
+$NetBSD: patch-Makefile,v 1.2 2016/07/03 14:06:45 morr Exp $
+
+Skip installing unnecessary documentation.
+
+--- Makefile.orig 2016-06-26 17:41:01.000000000 +0000
++++ Makefile
+@@ -812,9 +812,6 @@ DOCUMENTATION = $(filter-out $(EXCLUDE_D
+
+ install-doc:
+ install -d "$(DESTDIR)$(DOCDIR)"
+- for x in $(DOCUMENTATION); do \
+- install -m 644 doc/$$x.txt "$(DESTDIR)$(DOCDIR)" ; \
+- done
+
+ install-bin:
+ @for i in haproxy $(EXTRA); do \
Home |
Main Index |
Thread Index |
Old Index