sys-fs/btrfs-progs: older asciidoc fails to build docbookxml.
[gentoo.git] / sys-fs / btrfs-progs / btrfs-progs-4.5.3.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 inherit bash-completion-r1
8
9 libbtrfs_soname=0
10
11 if [[ ${PV} != 9999 ]]; then
12         MY_PV=v${PV}
13         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
14         SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
15         S="${WORKDIR}"/${PN}-${MY_PV}
16 else
17         WANT_LIBTOOL=none
18         inherit autotools git-r3
19         EGIT_REPO_URI="git://repo.or.cz/btrfs-progs-unstable/devel.git"
20         EGIT_BRANCH="devel"
21 fi
22
23 DESCRIPTION="Btrfs filesystem utilities"
24 HOMEPAGE="https://btrfs.wiki.kernel.org"
25
26 LICENSE="GPL-2"
27 SLOT="0/${libbtrfs_soname}"
28 IUSE="+convert static static-libs"
29
30 RESTRICT=test # tries to mount repared filesystems
31
32 RDEPEND="
33         dev-libs/lzo:2=
34         sys-apps/util-linux:0=[static-libs(+)?]
35         sys-libs/zlib:0=
36         convert? (
37                 sys-fs/e2fsprogs:0=
38                 sys-libs/e2fsprogs-libs:0=
39         )
40 "
41 DEPEND="${RDEPEND}
42         convert? ( sys-apps/acl )
43         >=app-text/asciidoc-8.6.0
44         app-text/docbook-xml-dtd:4.5
45         app-text/xmlto
46         static? (
47                 dev-libs/lzo:2[static-libs(+)]
48                 sys-apps/util-linux:0[static-libs(+)]
49                 sys-libs/zlib:0[static-libs(+)]
50                 convert? (
51                         sys-fs/e2fsprogs:0[static-libs(+)]
52                         sys-libs/e2fsprogs-libs:0[static-libs(+)]
53                 )
54         )
55 "
56
57 if [[ ${PV} == 9999 ]]; then
58         DEPEND+=" sys-devel/gnuconfig"
59 fi
60
61 src_prepare() {
62         default
63         if [[ ${PV} == 9999 ]]; then
64                 eautoreconf
65                 mkdir config || die
66                 local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
67                 [[ -e ${automakedir} ]] || die "Could not locate automake directory"
68                 ln -s "${automakedir}"/install-sh config/install-sh || die
69                 ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
70                 ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
71         fi
72 }
73
74 src_configure() {
75         local myeconfargs=(
76                 --bindir="${EPREFIX}"/sbin
77                 $(use_enable convert)
78                 $(use_enable elibc_glibc backtrace)
79         )
80         econf "${myeconfargs[@]}"
81 }
82
83 src_compile() {
84         emake V=1 all $(usev static)
85 }
86
87 src_install() {
88         local makeargs=(
89                 $(usex static-libs '' 'libs_static=')
90                 $(usex static install-static '')
91         )
92         emake V=1 DESTDIR="${D}" install "${makeargs[@]}"
93         newbashcomp btrfs-completion btrfs
94 }