/[gentoo-x86]/app-admin/rsyslog/rsyslog-5.8.7.ebuild
Gentoo

Contents of /app-admin/rsyslog/rsyslog-5.8.7.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue May 22 12:28:49 2012 UTC (2 years, 6 months ago) by ultrabug
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
version bump fix #408745 and #410241

(Portage version: 2.1.10.62/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/rsyslog-5.8.7.ebuild,v 1.2 2012/05/03 18:02:22 jdhore Exp $
4
5 EAPI=4
6
7 inherit autotools-utils systemd
8
9 DESCRIPTION="An enhanced multi-threaded syslogd with database support and more."
10 HOMEPAGE="http://www.rsyslog.com/"
11 SRC_URI="http://www.rsyslog.com/files/download/${PN}/${P}.tar.gz
12 zeromq? ( https://github.com/aggregateknowledge/rsyslog-zeromq/tarball/44b551abc29dd5b541884bd51b45b413855a93d8 -> ${PN}-zeromq.tar.gz )"
13
14 LICENSE="GPL-3 LGPL-3"
15 KEYWORDS="~amd64 ~arm ~hppa ~sparc ~x86"
16 SLOT="0"
17 IUSE="dbi debug doc extras kerberos mysql oracle postgres relp snmp ssl static-libs zeromq zlib"
18
19 RDEPEND="dbi? ( dev-db/libdbi )
20 extras? ( net-libs/libnet )
21 kerberos? ( virtual/krb5 )
22 mysql? ( virtual/mysql )
23 postgres? ( dev-db/postgresql-base )
24 oracle? ( dev-db/oracle-instantclient-basic )
25 relp? ( >=dev-libs/librelp-0.1.3 )
26 snmp? ( net-analyzer/net-snmp )
27 ssl? ( net-libs/gnutls )
28 zeromq? ( net-libs/zeromq )
29 zlib? ( sys-libs/zlib )"
30 DEPEND="${RDEPEND}
31 virtual/pkgconfig"
32
33 BRANCH="5-stable"
34
35 # need access to certain device nodes
36 RESTRICT="test"
37
38 # Maitainer note : open a bug to upstream
39 # showing that building in a separate dir fails
40 AUTOTOOLS_IN_SOURCE_BUILD=1
41
42 DOCS=(AUTHORS ChangeLog doc/rsyslog-example.conf)
43
44 src_prepare() {
45 # Maintainer notes:
46 # ZeroMQ support, for now it is done by hand until upstream process bug.
47 # Bugzilla : http://bugzilla.adiscon.com/show_bug.cgi?id=277
48 if use zeromq; then
49 local ZEROPATH=${WORKDIR}/aggregateknowledge-rsyslog-zeromq-44b551a
50 epatch ${ZEROPATH}/rsyslog-zeromq.patch
51 cp -r ${ZEROPATH}/{i,o}mzeromq "${S}/plugins"
52 fi
53
54 # Don't force '-g' CFLAG
55 sed -i 's/CFLAGS="\(.*\) -g"/CFLAGS="\1"/g' configure.ac || die
56 eautoreconf
57 }
58
59 src_configure() {
60 # Maintainer notes:
61 # * rfc3195 needs a library and development of that library
62 # is suspended, so we disable it
63 # * About the java GUI:
64 # The maintainer says there is no real installation support
65 # for the java GUI, so we disable it for now.
66 local myeconfargs=(
67 --disable-gui
68 --disable-rfc3195
69 --enable-largefile
70 --enable-unlimited-select
71 --enable-imdiag
72 --enable-imfile
73 --enable-impstats
74 --enable-imtemplate
75 --enable-imptcp
76 --enable-mail
77 --enable-omprog
78 --enable-omstdout
79 --enable-omtemplate
80 --enable-omdbalerting
81 --enable-omuxsock
82 --enable-pmlastmsg
83 --enable-pmrfc3164sd
84 --enable-pmcisconames
85 --enable-pmaixforwardedfrom
86 --enable-pmsnare
87 $(use_enable extras omudpspoof)
88 $(use_enable zlib)
89 $(use_enable mysql)
90 $(use_enable dbi libdbi)
91 $(use_enable postgres pgsql)
92 $(use_enable oracle oracle)
93 $(use_enable ssl gnutls)
94 $(use_enable kerberos gssapi-krb5)
95 $(use_enable relp)
96 $(use_enable snmp)
97 $(use_enable snmp mmsnmptrapd)
98 $(use_enable debug)
99 $(use_enable debug rtinst)
100 $(use_enable debug diagtools)
101 $(use_enable debug memcheck)
102 $(use_enable debug valgrind)
103 )
104
105 use zeromq && myeconfargs=(
106 ${myeconfargs[@]-}
107 $(use_enable zeromq imzeromq)
108 $(use_enable zeromq omzeromq)
109 )
110
111 systemd_to_myeconfargs
112 autotools-utils_src_configure
113 }
114
115 src_install() {
116 use doc && HTML_DOCS=(doc/)
117 autotools-utils_src_install
118
119 insinto /etc
120 newins "${FILESDIR}/${BRANCH}/${PN}-gentoo.conf" ${PN}.conf
121 newconfd "${FILESDIR}/${BRANCH}/${PN}.confd" ${PN}
122 newinitd "${FILESDIR}/${BRANCH}/${PN}.initd" ${PN}
123 keepdir /var/spool/${PN}
124 keepdir /etc/ssl/${PN}
125 keepdir /etc/${PN}.d
126
127 use static-libs || find "${D}" -name '*.la' -delete || die
128
129 if use mysql; then
130 insinto /usr/share/doc/${PF}/scripts/mysql
131 doins plugins/ommysql/{createDB.sql,contrib/delete_mysql}
132 fi
133
134 if use postgres; then
135 insinto /usr/share/doc/${PF}/scripts/pgsql
136 doins plugins/ompgsql/createDB.sql
137 fi
138
139 insinto /etc/logrotate.d/
140 newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
141 }
142
143 pkg_postinst() {
144 if use mysql || use postgres; then
145 echo
146 elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
147 elog " /usr/share/doc/${PF}/scripts"
148 fi
149
150 if use ssl; then
151 echo
152 elog "To create a default CA and certificates for your server and clients, run:"
153 elog " emerge --config =${PF}"
154 elog "on your logging server. You can run it several times,"
155 elog "once for each logging client. The client certificates will be signed"
156 elog "using the CA certificate generated during the first run."
157 fi
158 }
159
160 pkg_config() {
161 if ! use ssl ; then
162 einfo "There is nothing to configure for rsyslog unless you"
163 einfo "used USE=ssl to build it."
164 return 0
165 fi
166
167 # Make sure the certificates directory exists
168 CERTDIR="${ROOT}/etc/ssl/${PN}"
169 if [ ! -d "${CERTDIR}" ]; then
170 mkdir "${CERTDIR}" || die
171 fi
172 einfo "Your certificates will be stored in ${CERTDIR}"
173
174 # Create a default CA if needed
175 if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
176 einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
177 certtool --generate-privkey \
178 --outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
179 chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
180
181 cat > "${T}/${PF}.$$" <<_EOF
182 cn = Portage automated CA
183 ca
184 cert_signing_key
185 expiration_days = 3650
186 _EOF
187
188 certtool --generate-self-signed \
189 --load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
190 --outfile "${CERTDIR}/${PN}_ca.cert.pem" \
191 --template "${T}/${PF}.$$" &>/dev/null
192 chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
193
194 # Create the server certificate
195 echo
196 einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
197 read -r CN
198
199 einfo "Creating private key and certificate for server ${CN}..."
200 certtool --generate-privkey \
201 --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
202 chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
203
204 cat > "${T}/${PF}.$$" <<_EOF
205 cn = ${CN}
206 tls_www_server
207 dns_name = ${CN}
208 expiration_days = 3650
209 _EOF
210
211 certtool --generate-certificate \
212 --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
213 --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
214 --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
215 --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
216 --template "${T}/${PF}.$$" &>/dev/null
217 chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
218
219 else
220 einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
221 fi
222
223 # Create a client certificate
224 echo
225 einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
226 read -r CN
227
228 einfo "Creating private key and certificate for client ${CN}..."
229 certtool --generate-privkey \
230 --outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
231 chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
232
233 cat > "${T}/${PF}.$$" <<_EOF
234 cn = ${CN}
235 tls_www_client
236 dns_name = ${CN}
237 expiration_days = 3650
238 _EOF
239
240 certtool --generate-certificate \
241 --outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
242 --load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
243 --load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
244 --load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
245 --template "${T}/${PF}.$$" &>/dev/null
246 chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
247
248 rm -f "${T}/${PF}.$$"
249
250 echo
251 einfo "Here is the documentation on how to encrypt your log traffic:"
252 einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
253 }

  ViewVC Help
Powered by ViewVC 1.1.20