diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-proxy/haproxy |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-proxy/haproxy')
-rw-r--r-- | net-proxy/haproxy/Manifest | 24 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy-1.7-contrib.patch | 31 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy.confd | 14 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy.initd-r2 | 46 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy.initd-r4 | 85 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy.initd-r5 | 85 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.5.14.ebuild | 134 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.5.19-r1.ebuild | 135 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.6.11-r1.ebuild | 164 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.6.13-r2.ebuild | 158 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.6.9999-r1.ebuild | 159 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.7.7.ebuild | 159 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.7.8.ebuild | 159 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.7.9.ebuild | 159 | ||||
-rw-r--r-- | net-proxy/haproxy/haproxy-1.7.9999-r1.ebuild | 159 | ||||
-rw-r--r-- | net-proxy/haproxy/metadata.xml | 30 |
16 files changed, 1701 insertions, 0 deletions
diff --git a/net-proxy/haproxy/Manifest b/net-proxy/haproxy/Manifest new file mode 100644 index 000000000000..6c2eb8599d9c --- /dev/null +++ b/net-proxy/haproxy/Manifest @@ -0,0 +1,24 @@ +AUX haproxy-1.7-contrib.patch 1066 SHA256 e1da3b60e465e1f0ebe3afdd302f83a03201b7ff9841c4651ff1bc96546571a7 SHA512 a26846f3d970b288e6ba8c2cc67190242b41101ebb1b3b14a8ce543109b79d30a1f3257e1b2767033b3208dd223c1597b8a21824c622f16349bc849e9034f631 WHIRLPOOL 96dbf3ff0650167bde4f3233c7793bcb94bef3e7dbf6e8b3149823eaae30a3a4953fede6d5b348d4a4f5c7f60d357c2b2b204d0a28f926badbb136577e34cc18 +AUX haproxy.confd 610 SHA256 63c8ca11842b2e7817cea256f3912e2bd6bd38b7f57e61906cfd827ee66b1b81 SHA512 80a6e109432c7e751e9e1063853f73d3269c4c3967728a90cf94230cb32308b396f9f9ad7795b74b919dae4f61e5a29a9ae7badf0908148accbe0e8ca2238913 WHIRLPOOL c569e2473b6c945abb91389d080c0cec30b66f91143e887ec63f865809865def4084e24ca104382f67b270d88865f504f257d45e63c8f5d2addf6aa7bde68588 +AUX haproxy.initd-r2 978 SHA256 25237f8046bdcf145f89114561e551f01438148b74fc1b7ef26b8c13b97483fa SHA512 039f14980fd6acba7db76abb3c0e0f341bd1a741b126aa956ef2d07670a8e8d79176e378d8c1545701ec11d9779ca0f57298052f74912c58de7801fb06810e73 WHIRLPOOL 815b1cf08742837c86a3b4c262c47b355950b7450d0908638f279abb3eb8ecfd26d914af57757fcf499ae645b7474ee076b1aa5b412049703b8d20f5bbb13d53 +AUX haproxy.initd-r4 1690 SHA256 246a7a18f26190e0c47f4419ba4812c811369afa48d36a9830242c0f7886a922 SHA512 9431dcfcecf58fb0ee8681c5a649cca725c941a51f0073e67d0bd5ad67ee3f800999f8f4ae593cae06b859e58bc76d9374478c8efd81a36ccf18f54681f89de5 WHIRLPOOL d9a6e92bec579b602fcad130bfc01aa079ae6e7432a83a7971f6d5cbbdb3d1a7379340f82bb70ac1245ee8916c7bec15e8e27d19d4810df993cac4f506e5eafe +AUX haproxy.initd-r5 1691 SHA256 90f8135f1e158928ac73eba87f262bd95d5b11e5363ef0f3f3e9e62439a8e8e0 SHA512 9eca44db0701ebbb418fd6ba27d2e44f2ec33a20b5aeac9b86faaddf026cb5ea99ab2d6fd4bc150480e53c08c673710bfbbdafd3806c213ceb6149909aa664a4 WHIRLPOOL a0f11b2fd4da945bbd497a89c505229d39678a78f2311efb43dd3775cfda2064fa4776f156d7c1f31bb7ebb9862f80552979fdd4cffb1a4bab5a540d836fae33 +DIST haproxy-1.5.14.tar.gz 1345345 SHA256 9565dd38649064d0350a2883fa81ccfe92eb17dcda457ebdc01535e1ab0c8f99 SHA512 83d6101fd402f37845ab3febc914335e4c6d9bdebbb0ff81c8e048d5252ffa5a1b77c4250a434fed5dd541ef1f1f2c47d969b59f7a51d6ab9aea38a8646a9798 WHIRLPOOL 7d2c580589b9b31e1eba169e4bf930ac42d2564e21eb1c25adbdd39b701abd221fd671ebc227167ab956a48b2c30eeb740a6394355a8fa748c408ee42fdff6fc +DIST haproxy-1.5.19.tar.gz 1362834 SHA256 e00ae2a633da614967f2e3ebebdb817ec537cba8383b833fc8d9a506876e0d5e SHA512 3462458350d76fe5634428f7b443f21e2d8d4a171ab6254736db2d64587707d11d0df1d851d629c5a2cdfb2858e98cc9345d592859c6d6d8a352b57542dc465a WHIRLPOOL 0cb297dd48e8b9e0c2d6291aa7549c0b6b11e75c58ace3bd50205d7218cf95187129126b21cd13572e0287fc5b311c94ad2ccf664ff30d83a3bc782aea7714ff +DIST haproxy-1.6.11.tar.gz 1574029 SHA256 62fe982edb102a9f55205792bc14b0d05745cc7993cd6bee5d73cd3c5ae16ace SHA512 73ff1c7301197b3bd75a3b1355787419676854d132ce2dcdacb2a296e297dcdfc52b0c571a4fb715e369f1126e1a58196fabb21f828c880f15904032da78e434 WHIRLPOOL 4454c51da89bb089579aefcf54093fd4c09b42918e81e41772d263ebc19f243a37b42135a02c4012705e4cc31370f377cf0b429e81707f307cffe9ed23f5183b +DIST haproxy-1.6.13.tar.gz 1580214 SHA256 7d318583f3a1bf185e857bd40449004b29c95547c89bbb36718f284e29502a1b SHA512 ffed3b347e0cd9cefdc379c91890a3c104d6848b976a9f28984878a9c2d05ca7ddea678f7a93f75cb9d29ae2be921e5a5bd295b1a8771765b099d1c619ded7a3 WHIRLPOOL 70176ee090dacbbdc822c74bba137589f168482c560734c06b98dc23b4d957ed1e016309f11f25a0b486bc6917633455f1174dc6688d6aef53667c61b83a9ff3 +DIST haproxy-1.7.7.tar.gz 1745024 SHA256 81196ca449e4ada45fbd743fe3804bb82c25563ff9653e136872181ee5603ae2 SHA512 aa4720962e94b00c2b6090f62fb875e8977783256d877eb799b6a48c884833bac00b12d04fabd440011007e2af1914e0d67ab485026a447d8a61d58128d04a5a WHIRLPOOL d730dd21f1d8c2132297011e3dfbbbc12b6aa2cc61b67ee1cb9001b9f320e1e403ba917b81c8159fc7e2b43a0e3c95fd27172e1c86aada4963d3a4ecaebb3e2e +DIST haproxy-1.7.8.tar.gz 1746321 SHA256 ec90153ccedd20ad4015d3eaf76b502ff1f61b431d54c22b8457b5784a9ae142 SHA512 e1d65c8a4607c01d52628f36f8c7342096267130a0f949474746f571158e4f795281f78765004c214a0527f74ce180760f9cc910d3650d30026776076d721c0c WHIRLPOOL f781963b2cf80bfb6219399120821a4dd035dd89c07dc4191d45e2a7e4eaf6e8439f4eaa3174dd7a93ceb6f156d9124806f9c6490f8715bf127f37f0b33f9e17 +DIST haproxy-1.7.9.tar.gz 1748159 SHA256 1072337e54fa188dc6e0cfe3ba4c2200b07082e321cbfe5a0882d85d54db068e SHA512 d1ed791bc9607dbeabcfc6a1853cf258e28b3a079923b63d3bf97504dd59e64a5f5f44f9da968c23c12b4279e8d45ff3bd39418942ca6f00d9d548c9a0ccfd73 WHIRLPOOL efd7671925bfd260c0fce9d611ca24f3253a5553677687e5a136f6371a85852caaa4069df9bd1ba3ebe0d86ebdeef5e3c139609fc922eb0c10467cf28570e151 +EBUILD haproxy-1.5.14.ebuild 3269 SHA256 4bd6b8936a619a0f9d16fb06dce7884806a047a2d6b33cc4977ce1cf2897ee86 SHA512 41d1cfec30d177661f4402143ccf1335f5407adeb9f1581ea866011b1ec26c99da67fb2edd33e71e96b64665fa9c62641fd4b5dc1cd1383cc49877a0ce4292b4 WHIRLPOOL 6a4f67b97dbf7dc1a6c488df1f0649ab9714b3d8386f81943d1373f1993d799b6414ff00855f99835cc1e3b04a181cf452753c5da05c7681f7848b10ab2ab4ff +EBUILD haproxy-1.5.19-r1.ebuild 3283 SHA256 699347d5e1e42730009326e7f871e8758709a0de2decab525d775c38fa05bb5c SHA512 2c789983ee584f5b917411c55fcfbedf52b284b0b13779b9f587970ae362d63f28013bcd07c858ad9a7de81ca6258336a1875375a1ed46c2b9c2a0e021408f27 WHIRLPOOL fb7326822130aaeef9e37f9390e6166e4c7e7b4f01f49243151d3d1f47c28d82ac7c9771e5de23ab75594a34a68751284788f40d028b6700af622ed236e758b0 +EBUILD haproxy-1.6.11-r1.ebuild 4672 SHA256 bacb9fc26123bfe7d350bbae5b7ee6bcdf41f71b44542997836f85bcd05af381 SHA512 26dd867d496ecad3d860c5563633e528bf6c41ac7abe1549d090c8d664dc9575788f7ba887b94d910a8b7d20b1732c2ffc336905ab3ea4a8c877ba5872b502cb WHIRLPOOL 76174f7d757bcdc503c69a55ee22f8b25c0e4846b862a4f79f1560db33bbe6cb265ee800f52439e0c897f9525b3e7bb1a94243ee800af3fbf8ba12db34aca851 +EBUILD haproxy-1.6.13-r2.ebuild 4608 SHA256 0b17f7ef332a860444ee027655bdf0662e9770fdb90c4b1ebf1dfea9dcb01000 SHA512 3d1e9ddac3421d08ec325a762e8bbbe603242ef9c1deac0d3954a5c6178b0f6e3837533f6e4ebd3251d9329276c316c15e7239edc57c0c1607bef1865c17bb9d WHIRLPOOL 72eaddcdc60c008265aa30aa822c62d39ba37c6fce82c08e7f73d6be8ea1e2b719e71f4035637f79b6a47a204088254f61343ad84209c168e8b5602b7f47ac40 +EBUILD haproxy-1.6.9999-r1.ebuild 4632 SHA256 057b1ae544887bffabf327c0d5da3075e731918c85620074956dcf17023d0b7b SHA512 4d2dc75aed69988b14e8a34b22d67fab99fefc6a4ae3b6ca03cd33e14a82f85a82325f10bb65a2423c8d1ba70723f8345f3bc3912d865a775a07a2935d0495c3 WHIRLPOOL d5c3c9c88e5012c82ce2d47bb5a27c9738fc922c797c51fc08e7f1815cb58767d53b12a47e75e66a99e985bece90e216615d4ba5e0608ce79f9f391940962d4b +EBUILD haproxy-1.7.7.ebuild 4632 SHA256 057b1ae544887bffabf327c0d5da3075e731918c85620074956dcf17023d0b7b SHA512 4d2dc75aed69988b14e8a34b22d67fab99fefc6a4ae3b6ca03cd33e14a82f85a82325f10bb65a2423c8d1ba70723f8345f3bc3912d865a775a07a2935d0495c3 WHIRLPOOL d5c3c9c88e5012c82ce2d47bb5a27c9738fc922c797c51fc08e7f1815cb58767d53b12a47e75e66a99e985bece90e216615d4ba5e0608ce79f9f391940962d4b +EBUILD haproxy-1.7.8.ebuild 4632 SHA256 057b1ae544887bffabf327c0d5da3075e731918c85620074956dcf17023d0b7b SHA512 4d2dc75aed69988b14e8a34b22d67fab99fefc6a4ae3b6ca03cd33e14a82f85a82325f10bb65a2423c8d1ba70723f8345f3bc3912d865a775a07a2935d0495c3 WHIRLPOOL d5c3c9c88e5012c82ce2d47bb5a27c9738fc922c797c51fc08e7f1815cb58767d53b12a47e75e66a99e985bece90e216615d4ba5e0608ce79f9f391940962d4b +EBUILD haproxy-1.7.9.ebuild 4632 SHA256 057b1ae544887bffabf327c0d5da3075e731918c85620074956dcf17023d0b7b SHA512 4d2dc75aed69988b14e8a34b22d67fab99fefc6a4ae3b6ca03cd33e14a82f85a82325f10bb65a2423c8d1ba70723f8345f3bc3912d865a775a07a2935d0495c3 WHIRLPOOL d5c3c9c88e5012c82ce2d47bb5a27c9738fc922c797c51fc08e7f1815cb58767d53b12a47e75e66a99e985bece90e216615d4ba5e0608ce79f9f391940962d4b +EBUILD haproxy-1.7.9999-r1.ebuild 4632 SHA256 057b1ae544887bffabf327c0d5da3075e731918c85620074956dcf17023d0b7b SHA512 4d2dc75aed69988b14e8a34b22d67fab99fefc6a4ae3b6ca03cd33e14a82f85a82325f10bb65a2423c8d1ba70723f8345f3bc3912d865a775a07a2935d0495c3 WHIRLPOOL d5c3c9c88e5012c82ce2d47bb5a27c9738fc922c797c51fc08e7f1815cb58767d53b12a47e75e66a99e985bece90e216615d4ba5e0608ce79f9f391940962d4b +MISC ChangeLog 9654 SHA256 70ab86b15be3b3833f3d223582f21f2e2abddaea63c5b887c50e7ce432111806 SHA512 e1f7b4c7459e0c1a39bfe99c9de092981f82a64002e4eb6fad16fb141332d6dec87a83c6721221120a76aa4b3709a245bf8a7c5be195b4faa017117d756eeb75 WHIRLPOOL 891e45c2a0e7bb87d4f3ab862856a80fa1bc04984504c8709598ee5f5c89239f29413775a792b3b6252c0160ac7f7a200f0ed3c2648883c9fc6e7bf9a661c766 +MISC ChangeLog-2015 20405 SHA256 30b754ea77c21ac83dee50de917c2ad46234a7028e009c919c5ef5a6df66bb01 SHA512 77606fd8e3c692bd55a6cb6add77cdd3a56af6037544d7821726b8c10689e20fbadd46ede33330e7a1e82267221bf278fd46fb45e60a267b98d5304c17a9ce59 WHIRLPOOL 1c8d1b3112a926a2d107a5c23df3714fc7ab1e4f69f55895c1f4f19cd45d18dbf3b7a3d4afa00dca0f6988ac17dfbd6b5574cced06b72b2da87086b85e740d98 +MISC metadata.xml 1945 SHA256 8304b377e7170832d57c57296b6faaf1568c2cf560d09ef29d90ccf1b5ef854f SHA512 f5c13a273fcbf50e5d10f67d471b6f0e6cc8f7c5e08d5ed1cb24aa3e5db2c7c6c89f0d6d24d2a9bb4aa26b79b48738af9ded91232050126be145704a0c54b73a WHIRLPOOL f2ae7f2299701e9f42c7d19975fc987f556c041d556cffe79c3250a961d043a10bcb1566f15a6275f6c5d6d63329a4713de4c7e4053f0df877500715d98064c5 diff --git a/net-proxy/haproxy/files/haproxy-1.7-contrib.patch b/net-proxy/haproxy/files/haproxy-1.7-contrib.patch new file mode 100644 index 000000000000..9ecffe7e3c78 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy-1.7-contrib.patch @@ -0,0 +1,31 @@ +diff -Nuar --exclude '*~' haproxy-1.7.9999.orig/contrib/tcploop/Makefile haproxy-1.7.9999/contrib/tcploop/Makefile +--- haproxy-1.7.9999.orig/contrib/tcploop/Makefile 2016-12-04 16:08:05.497256646 -0800 ++++ haproxy-1.7.9999/contrib/tcploop/Makefile 2016-12-04 16:12:20.558141392 -0800 +@@ -5,7 +5,7 @@ + OBJS = tcploop + + tcploop: tcploop.c +- $(CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) -o $@ $^ ++ $(CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) $(LDFLAGS) -o $@ $^ $(LIBS) + + clean: + rm -f $(OBJS) *.[oas] *~ +diff -Nuar --exclude '*~' haproxy-1.7.9999.orig/contrib/spoa_example/Makefile haproxy-1.7.9999/contrib/spoa_example/Makefile +--- haproxy-1.7.9999.orig/contrib/spoa_example/Makefile 2016-12-04 15:56:49.068302156 -0800 ++++ haproxy-1.7.9999/contrib/spoa_example/Makefile 2016-12-04 15:58:51.360644213 -0800 +@@ -6,13 +6,13 @@ + LD = $(CC) + + CFLAGS = -g -O2 -Wall -Werror -pthread +-LDFLAGS = -lpthread ++LIBS = -lpthread + + OBJS = spoa.o + + + spoa: $(OBJS) +- $(LD) $(LDFLAGS) -o $@ $^ ++ $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) + + install: spoa + install spoa $(DESTDIR)$(BINDIR) diff --git a/net-proxy/haproxy/files/haproxy.confd b/net-proxy/haproxy/files/haproxy.confd new file mode 100644 index 000000000000..30739eb8bf23 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.confd @@ -0,0 +1,14 @@ +# HAProxy config file(s), space separated +#CONFIGS="/etc/haproxy/haproxy.cfg" + +# Additional HAProxy command line options +HAPROXY_OPTS="" + +# If you want to make use ot the new seamless reload you can just write your own +# reload_seamless function here. It will be called by the init script. +# For more information on how to use that feature please have a look at the +# "seamless_reload.txt" documentation file (requires net-proxy/haproxy[examples]) +#reload_seamless() { +# checkpath -d -m 0700 haproxy:haproxy "/run/haproxy/" +# socat /run/haproxy/socket - <<< "show servers state" > /run/haproxy/global.state +#} diff --git a/net-proxy/haproxy/files/haproxy.initd-r2 b/net-proxy/haproxy/files/haproxy.initd-r2 new file mode 100644 index 000000000000..e58c7c1fbfb0 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.initd-r2 @@ -0,0 +1,46 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="checkconfig" +extra_started_commands="reload" + +command="/usr/bin/haproxy" +pidfile="/run/${SVCNAME}.pid" + +if [ -z "${CONFFILE}" -a -d "/etc/haproxy" -a -f "/etc/haproxy/${SVCNAME}.cfg" ]; then + CONFFILE=/etc/haproxy/${SVCNAME}.cfg +else + CONFFILE=/etc/${SVCNAME}.cfg +fi + +command_args="-D -p ${pidfile} -f ${CONFFILE}" + +depend() { + need net + use dns logger +} + +checkconfig() { + if [ ! -f "${CONFFILE}" ]; then + eerror "${CONFFILE} does not exist!" + return 1 + fi + + ebegin "Checking ${CONFFILE}" + $command -q -c -f "${CONFFILE}" + eend $? +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + checkconfig || return 1 + fi +} + +reload() { + ebegin "Reloading ${SVCNAME}" + checkconfig || { eerror "Reloading failed, please fix your ${CONFFILE} first"; return 1; } + $command -D -p "${pidfile}" -f "${CONFFILE}" -sf $(cat "${pidfile}") + eend $? +} diff --git a/net-proxy/haproxy/files/haproxy.initd-r4 b/net-proxy/haproxy/files/haproxy.initd-r4 new file mode 100644 index 000000000000..c37719b16752 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.initd-r4 @@ -0,0 +1,85 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="checkconfig" +extra_started_commands="reload" + +command="/usr/bin/haproxy" + +pidfile="${HAPROXY_PIDFILE:-/run/${SVCNAME}.pid}" + +configs= + +if [ -z "${CONFIGS}" ]; then + if [ -f "/etc/haproxy/${SVCNAME}.cfg" ]; then + CONFIGS=/etc/haproxy/${SVCNAME}.cfg + elif [ -f "/etc/${SVCNAME}.cfg" ]; then + CONFIGS=/etc/${SVCNAME}.cfg # Deprecated + fi +fi + +for conf in $CONFIGS; do + configs="${configs} -f ${conf}" +done + +command_args="-D -p ${pidfile} ${configs} ${HAPROXY_OPTS}" + +depend() { + need net + use dns logger +} + +checkconfig() { + if [ -z "${CONFIGS}" ]; then + eerror "No config(s) has been specified" + return 1 + fi + + for conf in $CONFIGS; do + if [ ! -f "${conf}" ]; then + eerror "${conf} does not exist!" + return 1 + fi + done + + ebegin "Checking ${CONFIGS}" + $command -q -c $configs $HAPROXY_OPTS + eend $? +} + +start_pre() { + if [ "${RC_CMD}" != "restart" ]; then + checkconfig || return 1 + fi +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + checkconfig || return 1 + fi +} + +stop() { + local _t _pid + + _t="$(mktemp)" + for _pid in $(cat ${pidfile}) ; do + echo "${_pid}" > "${_t}" + pidfile="${_t}" default_stop + done + rm -f "${_t}" +} + +reload() { + checkconfig || { eerror "Reloading failed, please fix your config(s) first"; return 1; } + + if [ "$(command -v reload_seamless)" = "reload_seamless" ]; then + einfo "Calling user-defined reload_seamless()" + reload_seamless || { eerror "reload_seamless() failed!"; return 1; } + fi + + ebegin "Reloading ${SVCNAME}" + $command -D -p "${pidfile}" $configs $HAPROXY_OPTS -sf $(cat "${pidfile}") + eend $? +} diff --git a/net-proxy/haproxy/files/haproxy.initd-r5 b/net-proxy/haproxy/files/haproxy.initd-r5 new file mode 100644 index 000000000000..0f2435f74339 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.initd-r5 @@ -0,0 +1,85 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="checkconfig" +extra_started_commands="reload" + +command="/usr/sbin/haproxy" + +pidfile="${HAPROXY_PIDFILE:-/run/${SVCNAME}.pid}" + +configs= + +if [ -z "${CONFIGS}" ]; then + if [ -f "/etc/haproxy/${SVCNAME}.cfg" ]; then + CONFIGS=/etc/haproxy/${SVCNAME}.cfg + elif [ -f "/etc/${SVCNAME}.cfg" ]; then + CONFIGS=/etc/${SVCNAME}.cfg # Deprecated + fi +fi + +for conf in $CONFIGS; do + configs="${configs} -f ${conf}" +done + +command_args="-D -p ${pidfile} ${configs} ${HAPROXY_OPTS}" + +depend() { + need net + use dns logger +} + +checkconfig() { + if [ -z "${CONFIGS}" ]; then + eerror "No config(s) has been specified" + return 1 + fi + + for conf in $CONFIGS; do + if [ ! -f "${conf}" ]; then + eerror "${conf} does not exist!" + return 1 + fi + done + + ebegin "Checking ${CONFIGS}" + $command -q -c $configs $HAPROXY_OPTS + eend $? +} + +start_pre() { + if [ "${RC_CMD}" != "restart" ]; then + checkconfig || return 1 + fi +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + checkconfig || return 1 + fi +} + +stop() { + local _t _pid + + _t="$(mktemp)" + for _pid in $(cat ${pidfile}) ; do + echo "${_pid}" > "${_t}" + pidfile="${_t}" default_stop + done + rm -f "${_t}" +} + +reload() { + checkconfig || { eerror "Reloading failed, please fix your config(s) first"; return 1; } + + if [ "$(command -v reload_seamless)" = "reload_seamless" ]; then + einfo "Calling user-defined reload_seamless()" + reload_seamless || { eerror "reload_seamless() failed!"; return 1; } + fi + + ebegin "Reloading ${SVCNAME}" + $command -D -p "${pidfile}" $configs $HAPROXY_OPTS -sf $(cat "${pidfile}") + eend $? +} diff --git a/net-proxy/haproxy/haproxy-1.5.14.ebuild b/net-proxy/haproxy/haproxy-1.5.14.ebuild new file mode 100644 index 000000000000..6a343de9ba80 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.5.14.ebuild @@ -0,0 +1,134 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit user versionator toolchain-funcs flag-o-matic systemd + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="amd64 ppc x86" +IUSE="+crypt examples +pcre pcre-jit ssl tools vim-syntax +zlib" + +DEPEND="pcre? ( dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( dev-libs/openssl:0[zlib?] ) + zlib? ( sys-libs/zlib )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy +} + +src_prepare() { + sed -e 's:@SBINDIR@:'/usr/bin':' contrib/systemd/haproxy.service.in \ + > contrib/systemd/haproxy.service || die + + sed -ie 's:/usr/sbin/haproxy:/usr/bin/haproxy:' src/haproxy-systemd-wrapper.c || die +} + +src_compile() { + local args="TARGET=linux2628 USE_GETADDRINFO=1" + + if use pcre ; then + args="${args} USE_PCRE=1" + if use pcre-jit; then + args="${args} USE_PCRE_JIT=1" + else + args="${args} USE_PCRE_JIT=" + fi + else + args="${args} USE_PCRE= USE_PCRE_JIT=" + fi + +# if use kernel_linux; then +# args="${args} USE_LINUX_SPLICE=1 USE_LINUX_TPROXY=1" +# else +# args="${args} USE_LINUX_SPLICE= USE_LINUX_TPROXY=" +# fi + + if use crypt ; then + args="${args} USE_LIBCRYPT=1" + else + args="${args} USE_LIBCRYPT=" + fi + + if use ssl ; then + args="${args} USE_OPENSSL=1" + else + args="${args} USE_OPENSSL=" + fi + + if use zlib ; then + args="${args} USE_ZLIB=1" + else + args="${args} USE_ZLIB=" + fi + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args} + + if use tools ; then + for contrib in halog iprange ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args} + done + fi +} + +src_install() { + dobin haproxy + + newinitd "${FILESDIR}/haproxy.initd-r2" haproxy + + # Don't install useless files +# rm examples/build.cfg doc/*gpl.txt + + dodoc CHANGELOG ROADMAP doc/{configuration,haproxy-en}.txt + doman doc/haproxy.1 + + dobin haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + if use tools ; then + for contrib in halog iprange ; do + dobin contrib/${contrib}/${contrib} + done + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${ROOT}/etc/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${ROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${ROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/haproxy-1.5.19-r1.ebuild b/net-proxy/haproxy/haproxy-1.5.19-r1.ebuild new file mode 100644 index 000000000000..2b0bc8af0a4b --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.5.19-r1.ebuild @@ -0,0 +1,135 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit user versionator toolchain-funcs flag-o-matic systemd + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~x86" +IUSE="+crypt examples libressl +pcre pcre-jit ssl tools vim-syntax +zlib" + +DEPEND=" + pcre? ( + dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( + !libressl? ( dev-libs/openssl:0=[zlib?] ) + libressl? ( dev-libs/libressl:0= ) + ) + zlib? ( sys-libs/zlib )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy +} + +src_compile() { + local args="TARGET=linux2628 USE_GETADDRINFO=1" + + if use pcre ; then + args="${args} USE_PCRE=1" + if use pcre-jit; then + args="${args} USE_PCRE_JIT=1" + else + args="${args} USE_PCRE_JIT=" + fi + else + args="${args} USE_PCRE= USE_PCRE_JIT=" + fi + +# if use kernel_linux; then +# args="${args} USE_LINUX_SPLICE=1 USE_LINUX_TPROXY=1" +# else +# args="${args} USE_LINUX_SPLICE= USE_LINUX_TPROXY=" +# fi + + if use crypt ; then + args="${args} USE_LIBCRYPT=1" + else + args="${args} USE_LIBCRYPT=" + fi + + if use ssl ; then + args="${args} USE_OPENSSL=1" + else + args="${args} USE_OPENSSL=" + fi + + if use zlib ; then + args="${args} USE_ZLIB=1" + else + args="${args} USE_ZLIB=" + fi + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args} + emake -C contrib/systemd SBINDIR=/usr/sbin + + if use tools ; then + for contrib in halog iprange ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args} + done + fi +} + +src_install() { + dosbin haproxy + dosym /usr/sbin/haproxy /usr/bin/haproxy + + newinitd "${FILESDIR}/haproxy.initd-r5" haproxy + + # Don't install useless files +# rm examples/build.cfg doc/*gpl.txt + + dodoc CHANGELOG ROADMAP doc/{configuration,haproxy-en}.txt + doman doc/haproxy.1 + + dosbin haproxy-systemd-wrapper + dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + if use tools ; then + for contrib in halog iprange ; do + dobin contrib/${contrib}/${contrib} + done + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${ROOT}/etc/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${ROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${ROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/haproxy-1.6.11-r1.ebuild b/net-proxy/haproxy/haproxy-1.6.11-r1.ebuild new file mode 100644 index 000000000000..06254314e424 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.6.11-r1.ebuild @@ -0,0 +1,164 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +[[ ${PV} == *9999 ]] && SCM="git-r3" +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +if [[ ${PV} != *9999 ]]; then + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + KEYWORDS="amd64 arm ppc x86" +else + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/" + EGIT_BRANCH=master +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl" +REQUIRED_USE="pcre-jit? ( pcre ) + ?? ( slz zlib )" + +DEPEND=" + pcre? ( + dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( + !libressl? ( dev-libs/openssl:0=[zlib?] ) + libressl? ( dev-libs/libressl:0= ) + ) + slz? ( dev-libs/libslz:= ) + zlib? ( sys-libs/zlib ) + lua? ( dev-lang/lua:5.3 ) + device-atlas? ( dev-libs/device-atlas-api-c )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch ) +CONTRIBS=( halog iprange ) +# ip6range is present in 1.6, but broken. +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) + +haproxy_use() { + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>" + + usex "${1}" "USE_${2}=1" "USE_${2}=" +} + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy + + if use net_ns; then + CONFIG_CHECK="~NET_NS" + linux-info_pkg_setup + fi +} + +src_prepare() { + default + + sed -e 's:@SBINDIR@:'/usr/bin':' contrib/systemd/haproxy.service.in \ + > contrib/systemd/haproxy.service || die + + sed -ie 's:/usr/sbin/haproxy:/usr/bin/haproxy:' src/haproxy-systemd-wrapper.c || die +} + +src_compile() { + local -a args=( + TARGET=linux2628 + USE_GETADDRINFO=1 + USE_TFO=1 + ) + + args+=( $(haproxy_use crypt LIBCRYPT) ) + args+=( $(haproxy_use net_ns NS) ) + args+=( $(haproxy_use pcre PCRE) ) + args+=( $(haproxy_use pcre-jit PCRE_JIT) ) + args+=( $(haproxy_use ssl OPENSSL) ) + args+=( $(haproxy_use slz SLZ) ) + args+=( $(haproxy_use zlib ZLIB) ) + args+=( $(haproxy_use lua LUA) ) + args+=( $(haproxy_use 51degrees 51DEGREES) ) + args+=( $(haproxy_use device-atlas DEVICEATLAS) ) + args+=( $(haproxy_use wurfl WURFL) ) + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + + if use tools ; then + for contrib in ${CONTRIBS[@]} ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + done + fi +} + +src_install() { + dobin haproxy + + newconfd "${FILESDIR}/${PN}.confd" $PN + newinitd "${FILESDIR}/${PN}.initd-r4" $PN + + doman doc/haproxy.1 + + dobin haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + einstalldocs + + # The errorfiles are used by upstream defaults. + insinto /etc/haproxy/errors/ + doins examples/errorfiles/* + + if use doc; then + dodoc ROADMAP doc/*.txt + #if use lua; then + # TODO: doc/lua-api/ + #fi + fi + + if use tools ; then + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + dodoc examples/seamless_reload.txt + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${EROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/haproxy-1.6.13-r2.ebuild b/net-proxy/haproxy/haproxy-1.6.13-r2.ebuild new file mode 100644 index 000000000000..5d3f45d2f516 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.6.13-r2.ebuild @@ -0,0 +1,158 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +[[ ${PV} == *9999 ]] && SCM="git-r3" +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +if [[ ${PV} != *9999 ]]; then + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~ppc ~x86" +else + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/" + EGIT_BRANCH=master +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl" +REQUIRED_USE="pcre-jit? ( pcre ) + ?? ( slz zlib )" + +DEPEND=" + pcre? ( + dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( + !libressl? ( dev-libs/openssl:0=[zlib?] ) + libressl? ( dev-libs/libressl:0= ) + ) + slz? ( dev-libs/libslz:= ) + zlib? ( sys-libs/zlib ) + lua? ( dev-lang/lua:5.3 ) + device-atlas? ( dev-libs/device-atlas-api-c )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch ) +CONTRIBS=( halog iprange ) +# ip6range is present in 1.6, but broken. +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) + +haproxy_use() { + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>" + + usex "${1}" "USE_${2}=1" "USE_${2}=" +} + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy + + if use net_ns; then + CONFIG_CHECK="~NET_NS" + linux-info_pkg_setup + fi +} + +src_compile() { + local -a args=( + TARGET=linux2628 + USE_GETADDRINFO=1 + USE_TFO=1 + ) + + args+=( $(haproxy_use crypt LIBCRYPT) ) + args+=( $(haproxy_use net_ns NS) ) + args+=( $(haproxy_use pcre PCRE) ) + args+=( $(haproxy_use pcre-jit PCRE_JIT) ) + args+=( $(haproxy_use ssl OPENSSL) ) + args+=( $(haproxy_use slz SLZ) ) + args+=( $(haproxy_use zlib ZLIB) ) + args+=( $(haproxy_use lua LUA) ) + args+=( $(haproxy_use 51degrees 51DEGREES) ) + args+=( $(haproxy_use device-atlas DEVICEATLAS) ) + args+=( $(haproxy_use wurfl WURFL) ) + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + emake -C contrib/systemd SBINDIR=/usr/sbin + + if use tools ; then + for contrib in ${CONTRIBS[@]} ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + done + fi +} + +src_install() { + dosbin haproxy + dosym /usr/sbin/haproxy /usr/bin/haproxy + + newconfd "${FILESDIR}/${PN}.confd" $PN + newinitd "${FILESDIR}/${PN}.initd-r5" $PN + + doman doc/haproxy.1 + + dosbin haproxy-systemd-wrapper + dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + einstalldocs + + # The errorfiles are used by upstream defaults. + insinto /etc/haproxy/errors/ + doins examples/errorfiles/* + + if use doc; then + dodoc ROADMAP doc/*.txt + #if use lua; then + # TODO: doc/lua-api/ + #fi + fi + + if use tools ; then + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + dodoc examples/seamless_reload.txt + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${EROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/haproxy-1.6.9999-r1.ebuild b/net-proxy/haproxy/haproxy-1.6.9999-r1.ebuild new file mode 100644 index 000000000000..43c58bdf5bc1 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.6.9999-r1.ebuild @@ -0,0 +1,159 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +[[ ${PV} == *9999 ]] && SCM="git-r3" +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +if [[ ${PV} != *9999 ]]; then + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~ppc ~x86" +else + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/" + EGIT_BRANCH=master +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl" +REQUIRED_USE="pcre-jit? ( pcre ) + device-atlas? ( pcre ) + ?? ( slz zlib )" + +DEPEND=" + pcre? ( + dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( + !libressl? ( dev-libs/openssl:0=[zlib?] ) + libressl? ( dev-libs/libressl:0= ) + ) + slz? ( dev-libs/libslz:= ) + zlib? ( sys-libs/zlib ) + lua? ( dev-lang/lua:5.3 ) + device-atlas? ( dev-libs/device-atlas-api-c )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch ) +CONTRIBS=( halog iprange ) +# ip6range is present in 1.6, but broken. +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) + +haproxy_use() { + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>" + + usex "${1}" "USE_${2}=1" "USE_${2}=" +} + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy + + if use net_ns; then + CONFIG_CHECK="~NET_NS" + linux-info_pkg_setup + fi +} + +src_compile() { + local -a args=( + TARGET=linux2628 + USE_GETADDRINFO=1 + USE_TFO=1 + ) + + args+=( $(haproxy_use crypt LIBCRYPT) ) + args+=( $(haproxy_use net_ns NS) ) + args+=( $(haproxy_use pcre PCRE) ) + args+=( $(haproxy_use pcre-jit PCRE_JIT) ) + args+=( $(haproxy_use ssl OPENSSL) ) + args+=( $(haproxy_use slz SLZ) ) + args+=( $(haproxy_use zlib ZLIB) ) + args+=( $(haproxy_use lua LUA) ) + args+=( $(haproxy_use 51degrees 51DEGREES) ) + args+=( $(haproxy_use device-atlas DEVICEATLAS) ) + args+=( $(haproxy_use wurfl WURFL) ) + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + emake -C contrib/systemd SBINDIR=/usr/sbin + + if use tools ; then + for contrib in ${CONTRIBS[@]} ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + done + fi +} + +src_install() { + dosbin haproxy + dosym /usr/sbin/haproxy /usr/bin/haproxy + + newconfd "${FILESDIR}/${PN}.confd" $PN + newinitd "${FILESDIR}/${PN}.initd-r5" $PN + + doman doc/haproxy.1 + + dosbin haproxy-systemd-wrapper + dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + einstalldocs + + # The errorfiles are used by upstream defaults. + insinto /etc/haproxy/errors/ + doins examples/errorfiles/* + + if use doc; then + dodoc ROADMAP doc/*.txt + #if use lua; then + # TODO: doc/lua-api/ + #fi + fi + + if use tools ; then + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + dodoc examples/seamless_reload.txt + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${EROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/haproxy-1.7.7.ebuild b/net-proxy/haproxy/haproxy-1.7.7.ebuild new file mode 100644 index 000000000000..43c58bdf5bc1 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.7.7.ebuild @@ -0,0 +1,159 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +[[ ${PV} == *9999 ]] && SCM="git-r3" +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +if [[ ${PV} != *9999 ]]; then + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~ppc ~x86" +else + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/" + EGIT_BRANCH=master +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl" +REQUIRED_USE="pcre-jit? ( pcre ) + device-atlas? ( pcre ) + ?? ( slz zlib )" + +DEPEND=" + pcre? ( + dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( + !libressl? ( dev-libs/openssl:0=[zlib?] ) + libressl? ( dev-libs/libressl:0= ) + ) + slz? ( dev-libs/libslz:= ) + zlib? ( sys-libs/zlib ) + lua? ( dev-lang/lua:5.3 ) + device-atlas? ( dev-libs/device-atlas-api-c )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch ) +CONTRIBS=( halog iprange ) +# ip6range is present in 1.6, but broken. +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) + +haproxy_use() { + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>" + + usex "${1}" "USE_${2}=1" "USE_${2}=" +} + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy + + if use net_ns; then + CONFIG_CHECK="~NET_NS" + linux-info_pkg_setup + fi +} + +src_compile() { + local -a args=( + TARGET=linux2628 + USE_GETADDRINFO=1 + USE_TFO=1 + ) + + args+=( $(haproxy_use crypt LIBCRYPT) ) + args+=( $(haproxy_use net_ns NS) ) + args+=( $(haproxy_use pcre PCRE) ) + args+=( $(haproxy_use pcre-jit PCRE_JIT) ) + args+=( $(haproxy_use ssl OPENSSL) ) + args+=( $(haproxy_use slz SLZ) ) + args+=( $(haproxy_use zlib ZLIB) ) + args+=( $(haproxy_use lua LUA) ) + args+=( $(haproxy_use 51degrees 51DEGREES) ) + args+=( $(haproxy_use device-atlas DEVICEATLAS) ) + args+=( $(haproxy_use wurfl WURFL) ) + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + emake -C contrib/systemd SBINDIR=/usr/sbin + + if use tools ; then + for contrib in ${CONTRIBS[@]} ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + done + fi +} + +src_install() { + dosbin haproxy + dosym /usr/sbin/haproxy /usr/bin/haproxy + + newconfd "${FILESDIR}/${PN}.confd" $PN + newinitd "${FILESDIR}/${PN}.initd-r5" $PN + + doman doc/haproxy.1 + + dosbin haproxy-systemd-wrapper + dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + einstalldocs + + # The errorfiles are used by upstream defaults. + insinto /etc/haproxy/errors/ + doins examples/errorfiles/* + + if use doc; then + dodoc ROADMAP doc/*.txt + #if use lua; then + # TODO: doc/lua-api/ + #fi + fi + + if use tools ; then + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + dodoc examples/seamless_reload.txt + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${EROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/haproxy-1.7.8.ebuild b/net-proxy/haproxy/haproxy-1.7.8.ebuild new file mode 100644 index 000000000000..43c58bdf5bc1 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.7.8.ebuild @@ -0,0 +1,159 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +[[ ${PV} == *9999 ]] && SCM="git-r3" +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +if [[ ${PV} != *9999 ]]; then + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~ppc ~x86" +else + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/" + EGIT_BRANCH=master +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl" +REQUIRED_USE="pcre-jit? ( pcre ) + device-atlas? ( pcre ) + ?? ( slz zlib )" + +DEPEND=" + pcre? ( + dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( + !libressl? ( dev-libs/openssl:0=[zlib?] ) + libressl? ( dev-libs/libressl:0= ) + ) + slz? ( dev-libs/libslz:= ) + zlib? ( sys-libs/zlib ) + lua? ( dev-lang/lua:5.3 ) + device-atlas? ( dev-libs/device-atlas-api-c )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch ) +CONTRIBS=( halog iprange ) +# ip6range is present in 1.6, but broken. +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) + +haproxy_use() { + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>" + + usex "${1}" "USE_${2}=1" "USE_${2}=" +} + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy + + if use net_ns; then + CONFIG_CHECK="~NET_NS" + linux-info_pkg_setup + fi +} + +src_compile() { + local -a args=( + TARGET=linux2628 + USE_GETADDRINFO=1 + USE_TFO=1 + ) + + args+=( $(haproxy_use crypt LIBCRYPT) ) + args+=( $(haproxy_use net_ns NS) ) + args+=( $(haproxy_use pcre PCRE) ) + args+=( $(haproxy_use pcre-jit PCRE_JIT) ) + args+=( $(haproxy_use ssl OPENSSL) ) + args+=( $(haproxy_use slz SLZ) ) + args+=( $(haproxy_use zlib ZLIB) ) + args+=( $(haproxy_use lua LUA) ) + args+=( $(haproxy_use 51degrees 51DEGREES) ) + args+=( $(haproxy_use device-atlas DEVICEATLAS) ) + args+=( $(haproxy_use wurfl WURFL) ) + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + emake -C contrib/systemd SBINDIR=/usr/sbin + + if use tools ; then + for contrib in ${CONTRIBS[@]} ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + done + fi +} + +src_install() { + dosbin haproxy + dosym /usr/sbin/haproxy /usr/bin/haproxy + + newconfd "${FILESDIR}/${PN}.confd" $PN + newinitd "${FILESDIR}/${PN}.initd-r5" $PN + + doman doc/haproxy.1 + + dosbin haproxy-systemd-wrapper + dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + einstalldocs + + # The errorfiles are used by upstream defaults. + insinto /etc/haproxy/errors/ + doins examples/errorfiles/* + + if use doc; then + dodoc ROADMAP doc/*.txt + #if use lua; then + # TODO: doc/lua-api/ + #fi + fi + + if use tools ; then + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + dodoc examples/seamless_reload.txt + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${EROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/haproxy-1.7.9.ebuild b/net-proxy/haproxy/haproxy-1.7.9.ebuild new file mode 100644 index 000000000000..43c58bdf5bc1 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.7.9.ebuild @@ -0,0 +1,159 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +[[ ${PV} == *9999 ]] && SCM="git-r3" +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +if [[ ${PV} != *9999 ]]; then + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~ppc ~x86" +else + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/" + EGIT_BRANCH=master +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl" +REQUIRED_USE="pcre-jit? ( pcre ) + device-atlas? ( pcre ) + ?? ( slz zlib )" + +DEPEND=" + pcre? ( + dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( + !libressl? ( dev-libs/openssl:0=[zlib?] ) + libressl? ( dev-libs/libressl:0= ) + ) + slz? ( dev-libs/libslz:= ) + zlib? ( sys-libs/zlib ) + lua? ( dev-lang/lua:5.3 ) + device-atlas? ( dev-libs/device-atlas-api-c )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch ) +CONTRIBS=( halog iprange ) +# ip6range is present in 1.6, but broken. +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) + +haproxy_use() { + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>" + + usex "${1}" "USE_${2}=1" "USE_${2}=" +} + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy + + if use net_ns; then + CONFIG_CHECK="~NET_NS" + linux-info_pkg_setup + fi +} + +src_compile() { + local -a args=( + TARGET=linux2628 + USE_GETADDRINFO=1 + USE_TFO=1 + ) + + args+=( $(haproxy_use crypt LIBCRYPT) ) + args+=( $(haproxy_use net_ns NS) ) + args+=( $(haproxy_use pcre PCRE) ) + args+=( $(haproxy_use pcre-jit PCRE_JIT) ) + args+=( $(haproxy_use ssl OPENSSL) ) + args+=( $(haproxy_use slz SLZ) ) + args+=( $(haproxy_use zlib ZLIB) ) + args+=( $(haproxy_use lua LUA) ) + args+=( $(haproxy_use 51degrees 51DEGREES) ) + args+=( $(haproxy_use device-atlas DEVICEATLAS) ) + args+=( $(haproxy_use wurfl WURFL) ) + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + emake -C contrib/systemd SBINDIR=/usr/sbin + + if use tools ; then + for contrib in ${CONTRIBS[@]} ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + done + fi +} + +src_install() { + dosbin haproxy + dosym /usr/sbin/haproxy /usr/bin/haproxy + + newconfd "${FILESDIR}/${PN}.confd" $PN + newinitd "${FILESDIR}/${PN}.initd-r5" $PN + + doman doc/haproxy.1 + + dosbin haproxy-systemd-wrapper + dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + einstalldocs + + # The errorfiles are used by upstream defaults. + insinto /etc/haproxy/errors/ + doins examples/errorfiles/* + + if use doc; then + dodoc ROADMAP doc/*.txt + #if use lua; then + # TODO: doc/lua-api/ + #fi + fi + + if use tools ; then + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + dodoc examples/seamless_reload.txt + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${EROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/haproxy-1.7.9999-r1.ebuild b/net-proxy/haproxy/haproxy-1.7.9999-r1.ebuild new file mode 100644 index 000000000000..43c58bdf5bc1 --- /dev/null +++ b/net-proxy/haproxy/haproxy-1.7.9999-r1.ebuild @@ -0,0 +1,159 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +[[ ${PV} == *9999 ]] && SCM="git-r3" +inherit user versionator toolchain-funcs flag-o-matic systemd linux-info $SCM + +MY_P="${PN}-${PV/_beta/-dev}" + +DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments" +HOMEPAGE="http://haproxy.1wt.eu" +if [[ ${PV} != *9999 ]]; then + SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~ppc ~x86" +else + EGIT_REPO_URI="http://git.haproxy.org/git/haproxy-$(get_version_component_range 1-2).git/" + EGIT_BRANCH=master +fi + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="+crypt doc examples libressl slz net_ns +pcre pcre-jit ssl tools vim-syntax +zlib lua device-atlas 51degrees wurfl" +REQUIRED_USE="pcre-jit? ( pcre ) + device-atlas? ( pcre ) + ?? ( slz zlib )" + +DEPEND=" + pcre? ( + dev-libs/libpcre + pcre-jit? ( dev-libs/libpcre[jit] ) + ) + ssl? ( + !libressl? ( dev-libs/openssl:0=[zlib?] ) + libressl? ( dev-libs/libressl:0= ) + ) + slz? ( dev-libs/libslz:= ) + zlib? ( sys-libs/zlib ) + lua? ( dev-lang/lua:5.3 ) + device-atlas? ( dev-libs/device-atlas-api-c )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS README ) +version_is_at_least 1.7.0 $PV && PATCHES=( "${FILESDIR}"/haproxy-1.7-contrib.patch ) +CONTRIBS=( halog iprange ) +# ip6range is present in 1.6, but broken. +version_is_at_least 1.7.0 $PV && CONTRIBS+=( ip6range spoa_example tcploop ) + +haproxy_use() { + (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>" + + usex "${1}" "USE_${2}=1" "USE_${2}=" +} + +pkg_setup() { + enewgroup haproxy + enewuser haproxy -1 -1 -1 haproxy + + if use net_ns; then + CONFIG_CHECK="~NET_NS" + linux-info_pkg_setup + fi +} + +src_compile() { + local -a args=( + TARGET=linux2628 + USE_GETADDRINFO=1 + USE_TFO=1 + ) + + args+=( $(haproxy_use crypt LIBCRYPT) ) + args+=( $(haproxy_use net_ns NS) ) + args+=( $(haproxy_use pcre PCRE) ) + args+=( $(haproxy_use pcre-jit PCRE_JIT) ) + args+=( $(haproxy_use ssl OPENSSL) ) + args+=( $(haproxy_use slz SLZ) ) + args+=( $(haproxy_use zlib ZLIB) ) + args+=( $(haproxy_use lua LUA) ) + args+=( $(haproxy_use 51degrees 51DEGREES) ) + args+=( $(haproxy_use device-atlas DEVICEATLAS) ) + args+=( $(haproxy_use wurfl WURFL) ) + + # For now, until the strict-aliasing breakage will be fixed + append-cflags -fno-strict-aliasing + + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + emake -C contrib/systemd SBINDIR=/usr/sbin + + if use tools ; then + for contrib in ${CONTRIBS[@]} ; do + emake -C contrib/${contrib} \ + CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args[@]} + done + fi +} + +src_install() { + dosbin haproxy + dosym /usr/sbin/haproxy /usr/bin/haproxy + + newconfd "${FILESDIR}/${PN}.confd" $PN + newinitd "${FILESDIR}/${PN}.initd-r5" $PN + + doman doc/haproxy.1 + + dosbin haproxy-systemd-wrapper + dosym /usr/sbin/haproxy-systemd-wrapper /usr/bin/haproxy-systemd-wrapper + systemd_dounit contrib/systemd/haproxy.service + + einstalldocs + + # The errorfiles are used by upstream defaults. + insinto /etc/haproxy/errors/ + doins examples/errorfiles/* + + if use doc; then + dodoc ROADMAP doc/*.txt + #if use lua; then + # TODO: doc/lua-api/ + #fi + fi + + if use tools ; then + has halog "${CONTRIBS[@]}" && dobin contrib/halog/halog + has "iprange" "${CONTRIBS[@]}" && newbin contrib/iprange/iprange haproxy_iprange + has "ip6range" "${CONTRIBS[@]}" && newbin contrib/ip6range/ip6range haproxy_ip6range + has "spoa_example" "${CONTRIBS[@]}" && newbin contrib/spoa_example/spoa haproxy_spoa_example + has "spoa_example" "${CONTRIBS[@]}" && newdoc contrib/spoa_example/README README.spoa_example + has "tcploop" "${CONTRIBS[@]}" && newbin contrib/tcploop/tcploop haproxy_tcploop + fi + + if use examples ; then + docinto examples + dodoc examples/*.cfg + dodoc examples/seamless_reload.txt + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins examples/haproxy.vim + fi +} + +pkg_postinst() { + if [[ ! -f "${EROOT}/etc/haproxy/haproxy.cfg" ]] ; then + ewarn "You need to create /etc/haproxy/haproxy.cfg before you start the haproxy service." + ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created." + ewarn "Make use of them with the \"user\" and \"group\" directives." + + if [[ -d "${EROOT}/usr/share/doc/${PF}" ]]; then + einfo "Please consult the installed documentation for learning the configuration file's syntax." + einfo "The documentation and sample configuration files are installed here:" + einfo " ${EROOT}usr/share/doc/${PF}" + fi + fi +} diff --git a/net-proxy/haproxy/metadata.xml b/net-proxy/haproxy/metadata.xml new file mode 100644 index 000000000000..ddb31ac2bb8b --- /dev/null +++ b/net-proxy/haproxy/metadata.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>idl0r@gentoo.org</email> + <name>Christian Ruppert</name> + </maintainer> + <longdescription> +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. Its mode of operation makes its integration into existing architectures very easy and riskless, while still offering the possibility not to expose fragile web servers to the Net. + +It can: + - route HTTP requests depending on statically assigned cookies + - spread the load among several servers while assuring server persistence through the use of HTTP cookies + - switch to backup servers in the event a main one fails + - accept connections to special ports dedicated to service monitoring + - stop accepting connections without breaking existing ones + - add/modify/delete HTTP headers both ways + - block requests matching a particular pattern +Its event-driven architecture allows it to easily handle thousands of simultaneous connections on hundreds of instances without risking the system's stability. + </longdescription> + <use> + <flag name="net_ns">Enable network namespace support (CONFIG_NET_NS)</flag> + <flag name="pcre-jit">Use JIT support for PCRE</flag> + <flag name="slz">Use <pkg>dev-libs/libslz</pkg> compression library</flag> + <flag name="tools">Install additional tools (halog, iprange)</flag> + <flag name="device-atlas">Use <pkg>dev-libs/device-atlas-api-c</pkg> library</flag> + <flag name="51degrees">Device Detection using 51 Degrees</flag> + <flag name="wurfl">Device Detection using WURFL</flag> + </use> +</pkgmetadata> |