autofs-5.1.2.ebuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. AUTOTOOLS_AUTORECONF=true
  5. AUTOTOOLS_IN_SOURCE_BUILD=true
  6. inherit autotools-utils linux-info multilib systemd toolchain-funcs
  7. PATCH_VER=
  8. [[ -n ${PATCH_VER} ]] && \
  9. PATCHSET_URI="https://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
  10. DESCRIPTION="Kernel based automounter"
  11. HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
  12. SRC_URI="
  13. mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
  14. ${PATCHSET_URI}"
  15. LICENSE="GPL-2"
  16. SLOT="0"
  17. KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
  18. IUSE="-dmalloc hesiod ldap libtirpc mount-locking sasl"
  19. # USE="sasl" adds SASL support to the LDAP module which will not be build. If
  20. # SASL support should be available, please add "ldap" to the USE flags.
  21. REQUIRED_USE="sasl? ( ldap )"
  22. # currently, sasl code assumes the presence of kerberosV
  23. RDEPEND=">=sys-apps/util-linux-2.20
  24. dmalloc? ( dev-libs/dmalloc[threads] )
  25. hesiod? ( net-dns/hesiod )
  26. ldap? ( >=net-nds/openldap-2.0
  27. sasl? (
  28. dev-libs/cyrus-sasl
  29. dev-libs/libxml2
  30. virtual/krb5
  31. )
  32. )
  33. libtirpc? ( net-libs/libtirpc )"
  34. DEPEND="${RDEPEND}
  35. sys-devel/flex
  36. virtual/yacc"
  37. CONFIG_CHECK="~AUTOFS4_FS"
  38. PATCHES=(
  39. "${FILESDIR}"/${P}-libtirpc-as-need.patch
  40. )
  41. src_prepare() {
  42. # Upstream's patchset
  43. if [[ -n ${PATCH_VER} ]]; then
  44. EPATCH_SUFFIX="patch" \
  45. epatch "${WORKDIR}"/patches
  46. fi
  47. sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
  48. autotools-utils_src_prepare
  49. }
  50. src_configure() {
  51. # bug #483716
  52. tc-export AR
  53. # --with-confdir is for bug #361481
  54. # --with-mapdir is for bug #385113
  55. local myeconfargs=(
  56. --with-confdir=/etc/conf.d
  57. --with-mapdir=/etc/autofs
  58. $(use_with dmalloc)
  59. $(use_with ldap openldap)
  60. $(use_with libtirpc)
  61. $(use_with sasl)
  62. $(use_with hesiod)
  63. $(use_enable mount-locking)
  64. --disable-ext-env
  65. --enable-sloppy-mount # bug #453778
  66. --enable-force-shutdown
  67. --enable-ignore-busy
  68. --with-systemd="$(systemd_get_unitdir)" #bug #479492
  69. RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
  70. )
  71. autotools-utils_src_configure
  72. }
  73. src_compile() {
  74. autotools-utils_src_compile DONTSTRIP=1
  75. }
  76. src_install() {
  77. autotools-utils_src_install
  78. if kernel_is -lt 2 6 30; then
  79. # kernel patches
  80. docinto patches
  81. dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
  82. fi
  83. newinitd "${FILESDIR}"/autofs5.initd autofs
  84. insinto etc/autofs
  85. newins "${FILESDIR}"/autofs5-auto.master auto.master
  86. }
  87. pkg_postinst() {
  88. if kernel_is -lt 2 6 30; then
  89. elog "This version of ${PN} requires a kernel with autofs4 supporting"
  90. elog "protocol version 5.00. Patches for kernels older than 2.6.30 have"
  91. elog "been installed into"
  92. elog "${EROOT}usr/share/doc/${P}/patches."
  93. elog "For further instructions how to patch the kernel, please refer to"
  94. elog "${EROOT}usr/share/doc/${P}/INSTALL."
  95. elog
  96. fi
  97. elog "If you plan on using autofs for automounting remote NFS mounts,"
  98. elog "please check that both portmap (or rpcbind) and rpc.statd/lockd"
  99. elog "are running."
  100. }