summaryrefslogtreecommitdiff
blob: 934d146215edb2e9af3c55061d453e024ee37b1f (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
70
71
72
73
74
75
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI="6"

inherit autotools

DESCRIPTION="Fast samples-based log normalization library"
HOMEPAGE="http://www.liblognorm.com"

if [[ ${PV} == "9999" ]]; then
	EGIT_REPO_URI="
		git://github.com/rsyslog/${PN}.git
		https://github.com/rsyslog/${PN}.git
	"

	inherit git-r3
else
	SRC_URI="http://www.liblognorm.com/files/download/${P}.tar.gz"
	KEYWORDS="amd64 arm hppa x86 ~amd64-linux"
fi

LICENSE="LGPL-2.1 Apache-2.0"
SLOT="0/5.0.0"
IUSE="debug doc static-libs test"

RDEPEND="
	>=dev-libs/libestr-0.1.3
	>=dev-libs/libfastjson-0.99.2:=
"

DEPEND="
	${RDEPEND}
	>=sys-devel/autoconf-archive-2015.02.04
	virtual/pkgconfig
	doc? ( >=dev-python/sphinx-1.2.2 )
"

DOCS=( ChangeLog )

src_prepare() {
	default

	eautoreconf
}

src_configure() {
	# regexp disabled due to https://github.com/rsyslog/liblognorm/issues/143
	local myeconfargs=(
		--enable-compile-warnings=yes
		--disable-Werror
		$(use_enable doc docs)
		$(use_enable test testbench)
		$(use_enable debug)
		$(use_enable static-libs static)
		--disable-regexp
	)

	econf "${myeconfargs[@]}"
}

src_test() {
	# When adding new tests via patches we have to make them executable
	einfo "Adjusting permissions of test scripts ..."
	find "${S}"/tests -type f -name '*.sh' \! -perm -111 -exec chmod a+x '{}' \; || \
		die "Failed to adjust test scripts permission"

	emake --jobs 1 check
}

src_install() {
	default

	find "${ED}"usr/lib* -name '*.la' -delete || die
}