Merge remote-tracking branch 'remotes/github/pr/120'.
[gentoo.git] / sys-fs / btrfs-progs / btrfs-progs-4.0.1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit bash-completion-r1 eutils multilib toolchain-funcs
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://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
20                 https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
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"
29
30 RESTRICT=test # tries to mount repared filesystems
31
32 RDEPEND="
33         dev-libs/lzo:2=
34         sys-libs/zlib:0=
35         convert? (
36                 sys-fs/e2fsprogs:0=
37                 sys-libs/e2fsprogs-libs:0=
38         )
39 "
40 DEPEND="${RDEPEND}
41         convert? ( sys-apps/acl )
42         app-text/asciidoc
43         app-text/docbook-xml-dtd:4.5
44         app-text/xmlto
45 "
46
47 if [[ ${PV} == 9999 ]]; then
48         DEPEND+=" sys-devel/gnuconfig"
49 fi
50
51 src_prepare() {
52         epatch_user
53         if [[ ${PV} == 9999 ]]; then
54                 eautoreconf
55                 mkdir config || die
56                 local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
57                 [[ -e ${automakedir} ]] || die "Could not locate automake directory"
58                 ln -s "${automakedir}"/install-sh config/install-sh || die
59                 ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
60                 ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
61         fi
62 }
63
64 src_configure() {
65         local myeconfargs=(
66                 --bindir="${EPREFIX}"/sbin
67                 $(use_enable convert)
68                 $(use_enable elibc_glibc backtrace)
69         )
70         econf "${myeconfargs[@]}"
71 }
72
73 src_compile() {
74         emake V=1
75 }
76
77 src_install() {
78         default
79         newbashcomp btrfs-completion btrfs
80 }