summaryrefslogtreecommitdiff
blob: 46a1d57b1d16418032fafa7b00816b24125bf726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI="6"

inherit autotools user

MY_PN="nxlog"

DESCRIPTION="Universal log collector and forwarder supporting different platforms"
HOMEPAGE="http://nxlog.org"
SRC_URI="http://nxlog.org/system/files/products/files/1/${P}.tar.gz"

LICENSE="NXLOG-1"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="perl static-libs"

DEPEND=""
RDEPEND="${DEPEND}"

pkg_setup() {
	enewgroup nxlog
	enewuser nxlog -1 -1 /var/lib/${MY_PN} "adm,nxlog"
}

# TODO: fix me ?
# src_prepare() {
# 	sed -e 's/.* -ggdb3 .*/echo/g' -i configure.in || die 'failed to remove ggdb3 flag'
# 	mv configure.in configure.ac
# 	find . -name Makefile.in -exec sed -e 's@/configure.in@/configure.ac@g' -i {} \;
# 	eautoreconf
# 	eapply_user
# }

src_configure() {
	local conf_opts=(
		--libexecdir=/usr/$(get_libdir)
		--libdir=/usr/$(get_libdir)
		--localstatedir=/var
		--with-pidfile=/run/nxlog/nxlog.pid
		$(use_enable perl xm_perl)
		$(use_enable static-libs static)
	)
	econf "${conf_opts[@]}"
}

src_install() {
	default

	use static-libs || find ${D} -type f -name "*.la" -delete

	insinto /etc/nxlog
	doins packaging/debian/nxlog.conf

	keepdir /var/log/nxlog
	fowners nxlog:nxlog /var/log/nxlog

	keepdir /var/spool/nxlog
	fowners nxlog:nxlog /var/spool/nxlog

	newinitd "${FILESDIR}/${MY_PN}.initd" ${MY_PN}
}

pkg_postinst() {
	einfo "See the nxlog reference manual for configuration options."
	einfo "    http://nxlog.org/nxlog-docs/en/nxlog-reference-manual.html"
}