From bca36acda37295bd739d308840a42542813418ff Mon Sep 17 00:00:00 2001 From: Peter Volkov Date: Sun, 3 Apr 2011 17:55:17 +0000 Subject: Use proper if-logic in autofs.initd, bug #361787, thank Piotr Mitas for report Dustin Polke for fix (Portage version: 2.1.9.45/cvs/Linux x86_64) --- net-fs/autofs/ChangeLog | 9 +++- net-fs/autofs/autofs-5.0.5-r1.ebuild | 102 ----------------------------------- net-fs/autofs/autofs-5.0.5-r2.ebuild | 102 +++++++++++++++++++++++++++++++++++ net-fs/autofs/files/autofs5.initd | 20 +++---- 4 files changed, 121 insertions(+), 112 deletions(-) delete mode 100644 net-fs/autofs/autofs-5.0.5-r1.ebuild create mode 100644 net-fs/autofs/autofs-5.0.5-r2.ebuild (limited to 'net-fs') diff --git a/net-fs/autofs/ChangeLog b/net-fs/autofs/ChangeLog index 6c9c78c3771b..5e74c8bed438 100644 --- a/net-fs/autofs/ChangeLog +++ b/net-fs/autofs/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-fs/autofs # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/ChangeLog,v 1.100 2011/04/03 11:16:05 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/ChangeLog,v 1.101 2011/04/03 17:55:17 pva Exp $ + +*autofs-5.0.5-r2 (03 Apr 2011) + + 03 Apr 2011; Peter Volkov files/autofs5.initd, + -autofs-5.0.5-r1.ebuild, +autofs-5.0.5-r2.ebuild: + Use proper if-logic in autofs.initd, bug #361787, thank Piotr Mitas for + report Dustin Polke for fix 03 Apr 2011; Peter Volkov -autofs-3.1.7-r5.ebuild, -autofs-3.1.7-r6.ebuild, -autofs-5.0.4.ebuild, -autofs-5.0.4-r2.ebuild, diff --git a/net-fs/autofs/autofs-5.0.5-r1.ebuild b/net-fs/autofs/autofs-5.0.5-r1.ebuild deleted file mode 100644 index 0e3836576bac..000000000000 --- a/net-fs/autofs/autofs-5.0.5-r1.ebuild +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/autofs-5.0.5-r1.ebuild,v 1.1 2011/04/03 09:49:15 pva Exp $ - -EAPI="4" -inherit eutils multilib autotools linux-info - -DESCRIPTION="Kernel based automounter" -HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html" -PATCH_VER="3" -SRC_URI="mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.bz2 - mirror://gentoo/${P}-patches-${PATCH_VER}.tar.lzma" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" -IUSE="hesiod ldap sasl" - -# USE="sasl" adds SASL support to the LDAP module which will not be build. If -# SASL support should be available, please add "ldap" to the USE flags. -REQUIRED_USE="sasl? ( ldap )" - -# currently, sasl code assumes the presence of kerberosV -RDEPEND="hesiod? ( net-dns/hesiod ) - ldap? ( >=net-nds/openldap-2.0 - sasl? ( dev-libs/cyrus-sasl - dev-libs/libxml2 - virtual/krb5 ) )" -DEPEND="${RDEPEND}" - -src_prepare() { - # Upstream's patchset - EPATCH_SUFFIX="patch" \ - epatch "${WORKDIR}"/patches - - # Fix for bug #210762 - # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/4203 - epatch "${FILESDIR}"/${PN}-5.0.3-heimdal.patch - - # Accumulated fixes for bugs - # #154797: Respect CC and CFLAGS - # #253412: Respect LDFLAGS - # #247969: Link order for --as-needed - epatch "${FILESDIR}"/${P}-respect-user-flags-and-fix-asneeded-v1.patch - - # do not include , rather , - # as the former is a lame header for the latter (bug #157968) - sed 's@nfs/nfs.h@linux/nfs.h@' -i include/rpc_subs.h || die - - # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5591 - epatch "${FILESDIR}"/${P}-fix-building-without-sasl.patch - - # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5371 - epatch "${FILESDIR}"/${P}-fix-install-deadlink.patch - - # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/6039 - # Disable LDAP specific code if USE="-ldap", let's see what upstream says... - epatch "${FILESDIR}"/${P}-fix-building-without-ldap.patch - - eautoreconf -} - -src_configure() { - # work around bug #355975 (mount modifies timestamp of /etc/mtab) - # with >=sys-apps/util-linux-2.19, - addpredict "/etc/mtab" - - # --with-confdir is for bug #361481 - econf \ - --with-confdir=/etc/conf.d \ - $(use_with ldap openldap) \ - $(use_with sasl) \ - $(use_with hesiod) \ - --enable-ignore-busy -} - -src_install() { - emake DESTDIR="${D}" install - - dodoc README* CHANGELOG CREDITS COPYRIGHT INSTALL - - # kernel patches - docinto patches - dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch - - newinitd "${FILESDIR}"/autofs5.initd autofs -} - -pkg_postinst() { - if kernel_is -lt 2 6 30; then - elog "This version of ${PN} requires a kernel with autofs4 supporting" - elog "protocol version 5.00. Patches for kernels older than 2.6.30 have" - elog "been installed into" - elog "${EROOT}usr/share/doc/${P}/patches." - elog "For further instructions how to patch the kernel, please refer to" - elog "${EROOT}usr/share/doc/${P}/INSTALL." - elog - fi - elog "If you plan on using autofs for automounting remote NFS mounts," - elog "please check that both portmap (or rpcbind) and rpc.statd/lockd" - elog "are running." -} diff --git a/net-fs/autofs/autofs-5.0.5-r2.ebuild b/net-fs/autofs/autofs-5.0.5-r2.ebuild new file mode 100644 index 000000000000..4c00474db3e2 --- /dev/null +++ b/net-fs/autofs/autofs-5.0.5-r2.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/autofs-5.0.5-r2.ebuild,v 1.1 2011/04/03 17:55:17 pva Exp $ + +EAPI="4" +inherit eutils multilib autotools linux-info + +DESCRIPTION="Kernel based automounter" +HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html" +PATCH_VER="3" +SRC_URI="mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.bz2 + mirror://gentoo/${P}-patches-${PATCH_VER}.tar.lzma" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="hesiod ldap sasl" + +# USE="sasl" adds SASL support to the LDAP module which will not be build. If +# SASL support should be available, please add "ldap" to the USE flags. +REQUIRED_USE="sasl? ( ldap )" + +# currently, sasl code assumes the presence of kerberosV +RDEPEND="hesiod? ( net-dns/hesiod ) + ldap? ( >=net-nds/openldap-2.0 + sasl? ( dev-libs/cyrus-sasl + dev-libs/libxml2 + virtual/krb5 ) )" +DEPEND="${RDEPEND}" + +src_prepare() { + # Upstream's patchset + EPATCH_SUFFIX="patch" \ + epatch "${WORKDIR}"/patches + + # Fix for bug #210762 + # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/4203 + epatch "${FILESDIR}"/${PN}-5.0.3-heimdal.patch + + # Accumulated fixes for bugs + # #154797: Respect CC and CFLAGS + # #253412: Respect LDFLAGS + # #247969: Link order for --as-needed + epatch "${FILESDIR}"/${P}-respect-user-flags-and-fix-asneeded-v1.patch + + # do not include , rather , + # as the former is a lame header for the latter (bug #157968) + sed 's@nfs/nfs.h@linux/nfs.h@' -i include/rpc_subs.h || die + + # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5591 + epatch "${FILESDIR}"/${P}-fix-building-without-sasl.patch + + # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5371 + epatch "${FILESDIR}"/${P}-fix-install-deadlink.patch + + # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/6039 + # Disable LDAP specific code if USE="-ldap", let's see what upstream says... + epatch "${FILESDIR}"/${P}-fix-building-without-ldap.patch + + eautoreconf +} + +src_configure() { + # work around bug #355975 (mount modifies timestamp of /etc/mtab) + # with >=sys-apps/util-linux-2.19, + addpredict "/etc/mtab" + + # --with-confdir is for bug #361481 + econf \ + --with-confdir=/etc/conf.d \ + $(use_with ldap openldap) \ + $(use_with sasl) \ + $(use_with hesiod) \ + --enable-ignore-busy +} + +src_install() { + emake DESTDIR="${D}" install + + dodoc README* CHANGELOG CREDITS COPYRIGHT INSTALL + + # kernel patches + docinto patches + dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch + + newinitd "${FILESDIR}"/autofs5.initd autofs +} + +pkg_postinst() { + if kernel_is -lt 2 6 30; then + elog "This version of ${PN} requires a kernel with autofs4 supporting" + elog "protocol version 5.00. Patches for kernels older than 2.6.30 have" + elog "been installed into" + elog "${EROOT}usr/share/doc/${P}/patches." + elog "For further instructions how to patch the kernel, please refer to" + elog "${EROOT}usr/share/doc/${P}/INSTALL." + elog + fi + elog "If you plan on using autofs for automounting remote NFS mounts," + elog "please check that both portmap (or rpcbind) and rpc.statd/lockd" + elog "are running." +} diff --git a/net-fs/autofs/files/autofs5.initd b/net-fs/autofs/files/autofs5.initd index 27e15cf654db..73857bc5d8b9 100644 --- a/net-fs/autofs/files/autofs5.initd +++ b/net-fs/autofs/files/autofs5.initd @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/files/autofs5.initd,v 1.1 2011/04/03 09:49:15 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/files/autofs5.initd,v 1.2 2011/04/03 17:55:17 pva Exp $ DAEMON=/usr/sbin/automount PIDFILE=/var/run/autofs.pid @@ -29,18 +29,20 @@ start() { sleep 1 if [ -e "/proc/misc" ]; then MINOR=$(awk "/${DEVICE}/ {print \$1}" /proc/misc) - [ -n "${MINOR}" -a ! -c "/dev/${DEVICE}" ] && \ + if [ -n "${MINOR}" -a ! -c "/dev/${DEVICE}" ]; then mknod -m 0600 "/dev/${DEVICE}" c 10 ${MINOR} - if [ $? -ne 0 ]; then - eend 1 "Could not create '/dev/${DEVICE}'" - return 1 + if [ $? -ne 0 ]; then + eend 1 "Could not create '/dev/${DEVICE}'" + return 1 + fi fi fi - [ -x /sbin/restorecon -a -c "/dev/${DEVICE}" ] && \ + if [ -x /sbin/restorecon -a -c "/dev/${DEVICE}" ]; then /sbin/restorecon "/dev/${DEVICE}" - if [ $? -ne 0 ]; then - eend 1 "Failed to execute '/sbin/restorecon \"/dev/${DEVICE}\"'" - return 1 + if [ $? -ne 0 ]; then + eend 1 "Failed to execute '/sbin/restorecon \"/dev/${DEVICE}\"'" + return 1 + fi fi else [ -c "/dev/${DEVICE}" ] && rm -rf "/dev/${DEVICE}" -- cgit v1.2.3-65-gdbad