0da70660b854335ed4fb2063a781a3aa35b6d18a
[gentoo.git] / dev-libs / libclsync / libclsync-0.4.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 MY_PN=${PN#lib}
7 MY_P="${MY_PN}-${PV}"
8
9 inherit autotools eutils ltprune
10
11 DESCRIPTION="Control and monitoring library for clsync"
12 HOMEPAGE="http://ut.mephi.ru/oss/clsync https://github.com/xaionaro/clsync"
13 SRC_URI="https://github.com/xaionaro/${MY_PN}/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz"
14 LICENSE="GPL-3+"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="debug extra-debug extra-hardened hardened static-libs"
18 S="${WORKDIR}/${MY_P}"
19
20 REQUIRED_USE="
21         extra-debug? ( debug )
22         extra-hardened? ( hardened )
23 "
24
25 DEPEND="virtual/pkgconfig"
26 RDEPEND="=app-doc/clsync-docs-0.4*"
27
28 src_prepare() {
29         eapply_user
30         eautoreconf
31 }
32
33 src_configure() {
34         local harden_level=0
35         use hardened && harden_level=1
36         use extra-hardened && harden_level=2
37
38         local debug_level=0
39         use debug && debug_level=1
40         use extra-debug && debug_level=2
41
42         econf \
43                 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
44                 --enable-socket-library \
45                 --disable-clsync \
46                 --enable-debug=${debug_level} \
47                 --enable-paranoid=${harden_level} \
48                 --without-bsm \
49                 --without-kqueue \
50                 --disable-capabilities \
51                 --disable-cluster \
52                 --enable-socket \
53                 --disable-highload-locks \
54                 --disable-unshare \
55                 --disable-seccomp \
56                 --without-libcgroup \
57                 --without-gio \
58                 --with-inotify=native \
59                 --without-mhash
60 }
61
62 src_install() {
63         emake DESTDIR="${D}" install
64         prune_libtool_files
65         use static-libs || find "${ED}" -name "*.a" -delete || die "failed to remove static libs"
66
67         # docs go into clsync-docs
68         rm -rf "${ED}/usr/share/doc" || die
69 }
70
71 pkg_postinst() {
72         einfo "clsync instances you are going to use _must_ be compiled"
73         einfo "with control-socket support"
74 }