sys-fs/ntfs3g: x86 stable wrt bug #717640
[gentoo.git] / sys-fs / multipath-tools / multipath-tools-0.8.3.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit linux-info systemd toolchain-funcs udev vcs-snapshot toolchain-funcs
7
8 DESCRIPTION="Device mapper target autoconfig"
9 HOMEPAGE="http://christophe.varoqui.free.fr/"
10 SRC_URI="https://git.opensvc.com/?p=multipath-tools/.git;a=snapshot;h=${PV};sf=tgz -> ${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86"
15 IUSE="systemd rbd"
16
17 RDEPEND="
18         dev-libs/json-c:=
19         dev-libs/libaio
20         dev-libs/userspace-rcu:=
21         >=sys-fs/lvm2-2.02.45
22         >=virtual/udev-171
23         sys-libs/readline:0=
24         rbd? ( sys-cluster/ceph )
25         systemd? ( sys-apps/systemd )
26 "
27 DEPEND="${RDEPEND}"
28 BDEPEND="
29         virtual/pkgconfig
30 "
31
32 CONFIG_CHECK="~DM_MULTIPATH"
33
34 RESTRICT="test"
35
36 PATCHES=(
37         "${FILESDIR}"/${PN}-0.7.5-respect-flags.patch
38         "${FILESDIR}"/${PN}-0.8.3-no-gziped-docs.patch
39 )
40
41 get_systemd_pv() {
42         use systemd && \
43                 $(tc-getPKG_CONFIG) --modversion systemd
44 }
45
46 src_prepare() {
47         default
48
49         # The upstream lacks any way to configure the build at present
50         # and ceph is a huge dependency, so we're using sed to make it
51         # optional until the upstream has a proper configure system
52         if ! use rbd ; then
53                 sed \
54                         -e "s/libcheckrbd.so/# libcheckrbd.so/" \
55                         -e "s/-lrados//" \
56                         -i libmultipath/checkers/Makefile \
57                         || die
58         fi
59 }
60
61 src_compile() {
62         # LIBDM_API_FLUSH involves grepping files in /usr/include,
63         # so force the test to go the way we want #411337.
64         emake \
65                 CC="$(tc-getCC)" \
66                 LIBDM_API_FLUSH=1 SYSTEMD="$(get_systemd_pv)"
67 }
68
69 src_install() {
70         dodir /sbin /usr/share/man/man{5,8}
71         emake \
72                 DESTDIR="${D}" \
73                 SYSTEMD=$(get_systemd_pv) \
74                 unitdir="$(systemd_get_systemunitdir)" \
75                 libudevdir='${prefix}'/"$(get_udevdir)" \
76                 install
77
78         newinitd "${FILESDIR}"/rc-multipathd multipathd
79         newinitd "${FILESDIR}"/multipath.rc multipath
80
81         einstalldocs
82 }
83
84 pkg_postinst() {
85         if [[ -z ${REPLACING_VERSIONS} ]]; then
86                 elog "If you need multipath on your system, you must"
87                 elog "add 'multipath' into your boot runlevel!"
88         fi
89 }