summaryrefslogtreecommitdiff
blob: 9b4ffa7b73ded6c97825a757a1e082493b9910fe (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

DESCRIPTION="A library for creating and verifying Usenet cancel locks"
HOMEPAGE="https://micha.freeshell.org/libcanlock/"
SRC_URI="https://micha.freeshell.org/lib${PN}/src/lib${P}.tar.bz2"
S="${WORKDIR}/lib${P}"

LICENSE="BSD MIT"
SLOT="0/3"
KEYWORDS="amd64 arm ppc x86 ~amd64-linux ~x86-linux"
IUSE="+legacy"

BDEPEND="sys-devel/flex
	virtual/yacc"

DOCS=( ChangeLog{,_V{0..2}} README doc/sec_review.txt )

src_prepare() {
	default

	# shatest fails to build with slibtool
	sed 's/shatest$(EXEEXT) //g' -i test/Makefile.in || die
}

src_configure() {
	local econf_args=(
		--enable-pc-files
		$(use_enable legacy legacy-api)
	)

	econf "${econf_args[@]}"
}

src_install() {
	default
	find "${ED}" -name '*.la' -delete || die

	# keep old header location for compability with canlock v2
	use legacy && dosym ./libcanlock-3/canlock.h /usr/include/canlock.h

	# required for net-nntp/tin
	dosym ./libcanlock-3.pc /usr/$(get_libdir)/pkgconfig/libcanlock3.pc
}