sys-fs/ntfs3g: x86 stable wrt bug #717640
[gentoo.git] / sys-fs / multipath-tools / multipath-tools-0.8.3-r1.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 BDEPEND="virtual/pkgconfig"
18
19 RDEPEND="
20         dev-libs/json-c:=
21         dev-libs/libaio
22         dev-libs/userspace-rcu:=
23         >=sys-fs/lvm2-2.02.45
24         >=virtual/libudev-232-r3
25         sys-libs/readline:0=
26         rbd? ( sys-cluster/ceph )
27         systemd? ( sys-apps/systemd )
28 "
29
30 DEPEND="${RDEPEND}"
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                 RUN=run \
74                 SYSTEMD=$(get_systemd_pv) \
75                 unitdir="$(systemd_get_systemunitdir)" \
76                 libudevdir='${prefix}'/"$(get_udevdir)" \
77                 pkgconfdir='${prefix}'/usr/'${LIB}'/pkgconfig \
78                 install
79
80         newinitd "${FILESDIR}"/multipathd-r1.rc multipathd
81         newinitd "${FILESDIR}"/multipath.rc multipath
82
83         einstalldocs
84 }
85
86 pkg_postinst() {
87         if [[ -z ${REPLACING_VERSIONS} ]]; then
88                 elog "If you need multipath on your system, you must"
89                 elog "add 'multipath' into your boot runlevel!"
90         fi
91 }