/[gentoo-x86]/app-admin/ulogd/ulogd-1.24-r2.ebuild
Gentoo

Contents of /app-admin/ulogd/ulogd-1.24-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Thu May 31 03:00:39 2012 UTC (2 years, 6 months ago) by zmedico
Branch: MAIN
Changes since 1.5: +3 -3 lines
inherit user for enewgroup and enewuser

(Portage version: 2.2.0_alpha108_p8/cvs/Linux i686)

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/ulogd/ulogd-1.24-r2.ebuild,v 1.5 2011/07/02 10:27:29 flameeyes Exp $
4
5 EAPI="1"
6
7 inherit eutils flag-o-matic autotools user
8
9 DESCRIPTION="A userspace logging daemon for netfilter/iptables related logging"
10 HOMEPAGE="http://netfilter.org/projects/ulogd/index.html"
11 SRC_URI="http://ftp.netfilter.org/pub/ulogd/${P}.tar.bz2
12 mirror://gentoo/${PN}-glsa-200805.patch.bz2"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~ia64 ~ppc -sparc ~x86"
17 IUSE="mysql postgres sqlite"
18
19 DEPEND="net-firewall/iptables
20 mysql? ( virtual/mysql )
21 postgres? ( dev-db/postgresql-base )
22 sqlite? ( dev-db/sqlite:3 )"
23 RDEPEND="${DEPEND}
24 net-libs/libpcap"
25
26 pkg_setup() {
27 enewgroup ulogd
28 enewuser ulogd -1 -1 /var/log/ulogd ulogd
29 }
30
31 src_unpack() {
32 unpack ${A} || die "unpack failed"
33 cd "${S}" || die "dir ${S} not found"
34
35 # enables logfiles over 2G (#74924)
36 append-lfs-flags
37
38 epatch "${DISTDIR}/${PN}-glsa-200805.patch.bz2"
39
40 # add syslog example to ulogd.conf,
41 # make logrotate config match default paths in ulogd.conf
42 epatch "${FILESDIR}/${P}-syslog-and-logrotate.patch"
43
44 # switch plugin makefiles to use $(CC) instead of $(LD) for linking
45 # (prevents build from choking on stuff like "LDFLAGS=-Wl,O1")
46 for p in pgsql sqlite3 extensions mysql pcap ; do
47 f=$p/Makefile.in
48 sed -i -e 's/$(LD)/$(CC) -nostartfiles/' $f || die "failed to update $f"
49 done
50
51 eautoconf
52 }
53
54 src_compile() {
55 econf \
56 $(use_with mysql) \
57 $(use_with postgres pgsql) \
58 $(use_with sqlite sqlite3) \
59 || die "configure failed"
60
61 # Configure uses incorrect syntax for ld
62 use mysql && sed -i -e "s:-Wl,::g;s:-rdynamic::g" Rules.make
63
64 # not parallel make safe: bug #128976
65 emake -j1 || die "make failed"
66 }
67
68 src_install() {
69 # the Makefile seems to be "broken" -
70 # it relies on the existance of /usr, /etc ..
71 dodir /usr/sbin
72
73 make DESTDIR="${D}" install || die "install failed"
74
75 # make sure ulogd.conf is readable by ulogd user
76 fowners root:ulogd /etc/ulogd.conf
77 fperms 640 /etc/ulogd.conf
78
79 newinitd "${FILESDIR}"/ulogd-0.98 ulogd
80 local UsedServices="use"
81 use mysql && UsedServices+=" mysql"
82 use postgres && UsedServices+=" postgresql"
83 if [[ ${UsedServices} = "use" ]]; then
84 UsedServices=""
85 fi
86 sed -i -e "s:use mysql:${UsedServices}:g" "${D}/etc/init.d/ulogd" || die "sed failed"
87
88 # install logrotate config
89 insinto /etc/logrotate.d
90 newins ulogd.logrotate ulogd || die "logrotate config failed"
91
92 dodoc README AUTHORS Changes
93 cd doc/
94 dodoc ulogd.txt ulogd.a4.ps
95
96 use mysql && dodoc mysql.table mysql.table.ipaddr-as-string
97 use postgres && dodoc pgsql.table
98 use sqlite && dodoc sqlite3.table
99
100 dohtml ulogd.html
101 }
102
103 pkg_postinst() {
104 chown root:ulogd /etc/ulogd.conf
105 chmod 640 /etc/ulogd.conf
106 }

  ViewVC Help
Powered by ViewVC 1.1.20