btrfs-progs-9999.ebuild 2.1 KB

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