zfs-0.6.0_rc13-r2.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. AT_M4DIR="config"
  5. AUTOTOOLS_AUTORECONF="1"
  6. AUTOTOOLS_IN_SOURCE_BUILD="1"
  7. if [ ${PV} == "9999" ] ; then
  8. inherit git-2 linux-mod
  9. EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
  10. else
  11. inherit eutils versionator
  12. MY_PV=$(replace_version_separator 3 '-')
  13. SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz"
  14. S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
  15. KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
  16. fi
  17. inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev
  18. DESCRIPTION="Userland utilities for ZFS Linux kernel module"
  19. HOMEPAGE="http://zfsonlinux.org/"
  20. LICENSE="BSD-2 CDDL MIT"
  21. SLOT="0"
  22. IUSE="custom-cflags kernel-builtin +rootfs test-suite static-libs"
  23. RESTRICT="test"
  24. COMMON_DEPEND="
  25. sys-apps/util-linux[static-libs?]
  26. sys-libs/zlib[static-libs(+)?]
  27. virtual/awk
  28. "
  29. DEPEND="${COMMON_DEPEND}
  30. virtual/pkgconfig
  31. "
  32. RDEPEND="${COMMON_DEPEND}
  33. !=sys-apps/grep-2.13*
  34. !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
  35. !sys-fs/zfs-fuse
  36. !prefix? ( virtual/udev )
  37. test-suite? (
  38. sys-apps/util-linux
  39. sys-devel/bc
  40. sys-block/parted
  41. sys-fs/lsscsi
  42. sys-fs/mdadm
  43. sys-process/procps
  44. virtual/modutils
  45. )
  46. rootfs? (
  47. app-arch/cpio
  48. app-misc/pax-utils
  49. )
  50. "
  51. pkg_setup() {
  52. :
  53. }
  54. src_prepare() {
  55. # Update paths
  56. sed -e "s|/sbin/lsmod|/bin/lsmod|" \
  57. -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
  58. -e "s|/sbin/parted|/usr/sbin/parted|" \
  59. -i scripts/common.sh.in
  60. autotools-utils_src_prepare
  61. }
  62. src_configure() {
  63. use custom-cflags || strip-flags
  64. local myeconfargs=(
  65. --bindir="${EPREFIX}/bin"
  66. --sbindir="${EPREFIX}/sbin"
  67. --with-config=user
  68. --with-linux="${KV_DIR}"
  69. --with-linux-obj="${KV_OUT_DIR}"
  70. --with-udevdir="$(get_udevdir)"
  71. )
  72. autotools-utils_src_configure
  73. }
  74. src_install() {
  75. autotools-utils_src_install
  76. gen_usr_ldscript -a uutil nvpair zpool zfs
  77. rm -rf "${ED}usr/share/dracut"
  78. use test-suite || rm -rf "${ED}usr/libexec"
  79. newbashcomp "${FILESDIR}/bash-completion" zfs
  80. }
  81. pkg_postinst() {
  82. if ! use kernel-builtin && [ ${PV} = "9999" ]
  83. then
  84. einfo "Adding ${P} to the module database to ensure that the"
  85. einfo "kernel modules and userland utilities stay in sync."
  86. update_moduledb
  87. fi
  88. [ -e "${EROOT}etc/runlevels/boot/zfs" ] \
  89. || ewarn 'You should add zfs to the boot runlevel.'
  90. if [ -e "${EROOT}etc/runlevels/shutdown/zfs-shutdown" ]
  91. then
  92. einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
  93. rm "${EROOT}etc/runlevels/shutdown/zfs-shutdown"
  94. fi
  95. }
  96. pkg_postrm() {
  97. if ! use kernel-builtin && [ ${PV} = "9999" ]
  98. then
  99. remove_moduledb
  100. fi
  101. }