/[gentoo-x86]/net-proxy/haproxy/haproxy-1.5.8.ebuild
Gentoo

Contents of /net-proxy/haproxy/haproxy-1.5.8.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Oct 31 19:05:25 2014 UTC (6 years ago) by idl0r
Branch: MAIN
Version bump

(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key B427ABC8)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-proxy/haproxy/haproxy-1.5.6.ebuild,v 1.2 2014/10/30 21:37:30 idl0r Exp $
4
5 EAPI="5"
6
7 inherit user versionator toolchain-funcs flag-o-matic systemd
8
9 MY_P="${PN}-${PV/_beta/-dev}"
10
11 DESCRIPTION="A TCP/HTTP reverse proxy for high availability environments"
12 HOMEPAGE="http://haproxy.1wt.eu"
13 SRC_URI="http://haproxy.1wt.eu/download/$(get_version_component_range 1-2)/src/${MY_P}.tar.gz"
14
15 LICENSE="GPL-2 LGPL-2.1"
16 SLOT="0"
17 KEYWORDS="~amd64 ~ppc ~x86"
18 IUSE="+crypt examples +pcre pcre-jit ssl tools vim-syntax +zlib"
19
20 DEPEND="pcre? ( dev-libs/libpcre
21 pcre-jit? ( dev-libs/libpcre[jit] )
22 )
23 ssl? ( dev-libs/openssl[zlib?] )
24 zlib? ( sys-libs/zlib )"
25 RDEPEND="${DEPEND}"
26
27 S="${WORKDIR}/${MY_P}"
28
29 pkg_setup() {
30 enewgroup haproxy
31 enewuser haproxy -1 -1 -1 haproxy
32 }
33
34 src_prepare() {
35 sed -e 's:@SBINDIR@:'/usr/bin':' contrib/systemd/haproxy.service.in \
36 > contrib/systemd/haproxy.service || die
37
38 sed -ie 's:/usr/sbin/haproxy:/usr/bin/haproxy:' src/haproxy-systemd-wrapper.c || die
39 }
40
41 src_compile() {
42 local args="TARGET=linux2628 USE_GETADDRINFO=1"
43
44 if use pcre ; then
45 args="${args} USE_PCRE=1"
46 if use pcre-jit; then
47 args="${args} USE_PCRE_JIT=1"
48 else
49 args="${args} USE_PCRE_JIT="
50 fi
51 else
52 args="${args} USE_PCRE= USE_PCRE_JIT="
53 fi
54
55 # if use kernel_linux; then
56 # args="${args} USE_LINUX_SPLICE=1 USE_LINUX_TPROXY=1"
57 # else
58 # args="${args} USE_LINUX_SPLICE= USE_LINUX_TPROXY="
59 # fi
60
61 if use crypt ; then
62 args="${args} USE_LIBCRYPT=1"
63 else
64 args="${args} USE_LIBCRYPT="
65 fi
66
67 if use ssl ; then
68 args="${args} USE_OPENSSL=1"
69 else
70 args="${args} USE_OPENSSL="
71 fi
72
73 if use zlib ; then
74 args="${args} USE_ZLIB=1"
75 else
76 args="${args} USE_ZLIB="
77 fi
78
79 # For now, until the strict-aliasing breakage will be fixed
80 append-cflags -fno-strict-aliasing
81
82 emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args}
83
84 if use tools ; then
85 for contrib in halog iprange ; do
86 emake -C contrib/${contrib} \
87 CFLAGS="${CFLAGS}" OPTIMIZE="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=$(tc-getCC) ${args}
88 done
89 fi
90 }
91
92 src_install() {
93 dobin haproxy
94
95 newinitd "${FILESDIR}/haproxy.initd-r2" haproxy
96
97 # Don't install useless files
98 # rm examples/build.cfg doc/*gpl.txt
99
100 dodoc CHANGELOG ROADMAP doc/{configuration,haproxy-en}.txt
101 doman doc/haproxy.1
102
103 dobin haproxy-systemd-wrapper
104 systemd_dounit contrib/systemd/haproxy.service
105
106 if use tools ; then
107 for contrib in halog iprange ; do
108 dobin contrib/${contrib}/${contrib}
109 done
110 fi
111
112 if use examples ; then
113 docinto examples
114 dodoc examples/*.cfg
115 fi
116
117 if use vim-syntax ; then
118 insinto /usr/share/vim/vimfiles/syntax
119 doins examples/haproxy.vim
120 fi
121 }
122
123 pkg_postinst() {
124 if [[ ! -f "${ROOT}/etc/haproxy.cfg" ]] ; then
125 ewarn "You need to create /etc/haproxy.cfg before you start the haproxy service."
126 ewarn "It's best practice to not run haproxy as root, user and group haproxy was therefore created."
127 ewarn "Make use of them with the \"user\" and \"group\" directives."
128
129 if [[ -d "${ROOT}/usr/share/doc/${PF}" ]]; then
130 einfo "Please consult the installed documentation for learning the configuration file's syntax."
131 einfo "The documentation and sample configuration files are installed here:"
132 einfo " ${ROOT}usr/share/doc/${PF}"
133 fi
134 fi
135 }

  ViewVC Help
Powered by ViewVC 1.1.20