autofs-5.0.7-r4.ebuild 3.7 KB

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