From 9a6bcdea180101bce21e5aa5f83d6ff2527245a3 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Sun, 18 Aug 2013 12:57:55 +0200 Subject: [PATCH] Added net-fs/autofs/autofs-5.0.6-r6.ebuild together with appropriate files --- net-fs/autofs/Manifest | 12 ++ net-fs/autofs/autofs-5.0.6-r6.ebuild | 115 +++++++++++++ .../autofs/files/autofs-5.0.3-heimdal.patch | 35 ++++ ...f-HAVE_SASL-in-modules-lookup_ldap.c.patch | 28 ++++ ...tofs-5.0.5-fix-building-without-ldap.patch | 76 +++++++++ .../autofs-5.0.5-fix-install-deadlink.patch | 12 ++ ...spect-user-flags-and-fix-asneeded-r2.patch | 154 ++++++++++++++++++ .../files/autofs-5.0.6-revert-ldap.patch | 18 ++ net-fs/autofs/files/autofs5-auto.master | 24 +++ net-fs/autofs/files/autofs5.initd | 70 ++++++++ net-fs/autofs/files/autofs5.rc1 | 42 +++++ 11 files changed, 586 insertions(+) create mode 100644 net-fs/autofs/Manifest create mode 100644 net-fs/autofs/autofs-5.0.6-r6.ebuild create mode 100644 net-fs/autofs/files/autofs-5.0.3-heimdal.patch create mode 100644 net-fs/autofs/files/autofs-5.0.5-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch create mode 100644 net-fs/autofs/files/autofs-5.0.5-fix-building-without-ldap.patch create mode 100644 net-fs/autofs/files/autofs-5.0.5-fix-install-deadlink.patch create mode 100644 net-fs/autofs/files/autofs-5.0.6-respect-user-flags-and-fix-asneeded-r2.patch create mode 100644 net-fs/autofs/files/autofs-5.0.6-revert-ldap.patch create mode 100644 net-fs/autofs/files/autofs5-auto.master create mode 100644 net-fs/autofs/files/autofs5.initd create mode 100644 net-fs/autofs/files/autofs5.rc1 diff --git a/net-fs/autofs/Manifest b/net-fs/autofs/Manifest new file mode 100644 index 0000000..7e542fb --- /dev/null +++ b/net-fs/autofs/Manifest @@ -0,0 +1,12 @@ +AUX autofs-5.0.3-heimdal.patch 1380 SHA256 ca62546abf6b6ae2ed95f53d439d25770f20e70651fdaf5a0edf9d69920b108a SHA512 f8f0528988085691899c3f4c1b3f13c6b189b4fe7fa160e713a819f25cb1c860ed896e096c4226e9e6449526037b263e832d27a5e5ce9b13bc5416ee28cb7317 WHIRLPOOL b6060d5074eb3a523724d85bcf1fef24f8af70372f6806be18a0e4fecff6f6e26638192490935ccf99bb90f140b9dedfc195fb42cc582512acdf4a2616dfb8d3 +AUX autofs-5.0.5-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch 756 SHA256 0917780bf6f9be61d523535e42bcdcc460810d6f06b5b505230801f7a549efb4 SHA512 d367ccdde8aa459080195122c12b5c22692b3577c4fa9ae17f09012d570d68f0b03a222d5dacba83465a26aebfb486646e11f6dcb21d11e91824073049f5f170 WHIRLPOOL 6913b58176690dcfc5b4ce50ae1f89698c67282087d58c048809eb4707f9461c6ef2a3b17970de7b0479164bf36aa5af206425e8137abc350b2860d8fe82dbcd +AUX autofs-5.0.5-fix-building-without-ldap.patch 1225 SHA256 dd1f1e3fece874a9180b7d94fc2d1a2aed626223ccc3a87da410410309603279 SHA512 d5a70eb297bab2b7dd2b751b13327b14ec99771575414dd90e35206c658e71c4b5f215def8241dea8cf36e411fe6f986fdf5cd86dd6a613ced3b507acca1d41f WHIRLPOOL ac7a50f097446925634e3889eb86aa36f578114d17464b459d715cc970f697403c5b0abc1897e3ef6e2f3d232670c40978569df98c926c892183a7fda1f39fd0 +AUX autofs-5.0.5-fix-install-deadlink.patch 544 SHA256 48393e00ddb51c5b0588ea45711abb16bf256c487c584062bc3de59b30bae053 SHA512 03f4f8fa6721e5ddd16560b9d7385a3734c7614f2903bd142869b2f2b099317ae2f73f6aa59f6e62b166f00d90baba3345d5fd5c3af3344b2348984d09ba3020 WHIRLPOOL c8c202220584c8cedcf0d90f066cad3311f60c90e5b36a8a52847f1b0723babb8b97a95264cd64fb1fd2164e64f3f314df1ef357c822cb0028cd9ff498d7d13f +AUX autofs-5.0.6-respect-user-flags-and-fix-asneeded-r2.patch 4102 SHA256 7ea48494b1df75500333148f5e763028f883fda23639c0d32cb5b9bdee3f109b SHA512 6948861073c039aaf42b0ed3d4aec598f13a7a177aaa2563f270d8c50422629f88031617939ec4b23501be32894255cb2100df51d3c753f692efa64d0c1f50bd WHIRLPOOL aed6e1750f5b23d1eadee7113035c3df53aa8d1801452410efe025be860518addefedfb2d861012d8b111ed8fcc20230957a46bc9ac10d32eeeec28b16f9322f +AUX autofs-5.0.6-revert-ldap.patch 512 SHA256 67e4f23d0c1ef771f861ec295a2780d9c09b37d26718c21e3f20d3b4936738e9 SHA512 e929bbe145c19ac5180094205a9095387e90126e8360ede99ab972cca864c40c1caf779503454784804e925e0efc0b4c459accb734f63482c758989bb17d7313 WHIRLPOOL 70c541931415e7d35955196c683bef2bf08c16b920f7398a679eaa8abeda5364cd3f0afec674e02e126447ca5c29d8c2934eb33d3f09aeb48fa0ae7a798cc56f +AUX autofs5-auto.master 756 SHA256 8651b42b338ffdb8be24ed88893ca90f95d0221f2684274957de154fd89df5cb SHA512 3c6e6dab6beb595f4bfa3af7be3c1f5343a80ea81bc9fb26e073e96ea1b75bf2fd304c4e54dad9ec1c233e01c62310bbdbc7f97a2370e82bc31138855819d3b2 WHIRLPOOL 2c5a885f76d6e2adfc6c3b5a739c7bf820ba48adfca28cd7a2a50b81ec150011b93f283b8bb5058a427bfd5c701b1da8cbd31fc9a15b121d310d3048dacfba72 +AUX autofs5.initd 1665 SHA256 50cf0d305f1605a7511b9033d9e7a710d0e18e16bf37924c0b6d5a2a4d0910a9 SHA512 363e9b9152fffdb8e391a534d032d6896822c312c05f2aaefbd9cce4a079747981ff5988a5c5ed33e857ddb8f2112b55734caee0360af7a394739f9ef5f79773 WHIRLPOOL fd9ffa3ba7924785d6fa87bc7e1cea186ab724845f54199773335079f0865adc7691b77f4bf30aa5da89e3bed80ad3e4b7a4f05f712504b1360d86164a6ed9a5 +AUX autofs5.rc1 920 SHA256 94c956da80446f391df3a8f89794754c0e42ea9d1fca47f2abe57eecadbc3ffa SHA512 79383746424d45b8aafc433f23ed9fc4427edf59bcdfee1a33dbd18b860ea84b6b9fa0b859bfa3a6c164349f2386b2f8702f1e1fdda3ac3a3bee527a2d449729 WHIRLPOOL d5c198ea21553033f3d2c0fd6e153f23a4da655e9f07e7a5c75045041d86078a5f1b8c80be0a21388a5b5b34e5aa14ddf4ffea6feeff999f1df84db7a2a7b524 +DIST autofs-5.0.6-patches-1.tar.lzma 25424 SHA256 7d92dd29b733a0e567d8a3a793a9559254e07abd23b1e2113d52a7e5cfb15e77 SHA512 ea0e31886f4907079cba4e4c159311721b60ec0ab5e6e4ab0c9b2f9b4f724996a813343c9cfcb745ac5533fc406938492846c83904dd0d691d507adccac4d1c7 WHIRLPOOL deb332ef12b2ea7e1b85b279c158d1990e76cd5aff99c164848cfe50aa0b100c4436ab8f7be2c8502504e5ceecf40b24a06e87b9d342e8466334fc6f09c07c27 +DIST autofs-5.0.6.tar.bz2 311857 SHA256 125b439a311939f247936ad697bc53b11a8e694aaff8ddf44a9fd7fa850e692c SHA512 cedfa6b6a6c81390a9302732ddfd880870e53f4995c8d87f9150669aa05b65c645763cf3bbda2ecd46a1dae1c3a80fe0601c0b4bb8dbb370c2af1392671e6355 WHIRLPOOL 61b0d36235805eee61b8cf445bc16d72c91ce9fa0d3bb0dfac94a54bb51a47548a16003d2888a92ef6afa449d4b81d9ddd086a69b63579c04088139286a1a410 +EBUILD autofs-5.0.6-r6.ebuild 3651 SHA256 80a764bd144fcc46ee33ae1cc00848e122c579db56680c41e85230ed8ca29815 SHA512 180457aebaa02438c427e27cc1480664b3eddb229b277b919181515c5f5aecba25352402d746581dea34eda1421135391454494a43d09b15f78728b2fa11bd89 WHIRLPOOL ce0eeb5cb0089dd616e09dde60da75472a3b15d36fe1783caf9940ae020664010f286220bc7ae77cebc34980ba9ebb635a06bd4d86c38881d18531fb21f8ad90 diff --git a/net-fs/autofs/autofs-5.0.6-r6.ebuild b/net-fs/autofs/autofs-5.0.6-r6.ebuild new file mode 100644 index 0000000..0349550 --- /dev/null +++ b/net-fs/autofs/autofs-5.0.6-r6.ebuild @@ -0,0 +1,115 @@ +# 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.6-r5.ebuild,v 1.1 2011/12/17 03:45: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="1" +[[ -n ${PATCH_VER} ]] && \ + PATCHSET_URI="mirror://gentoo/${P}-patches-${PATCH_VER}.tar.lzma" +SRC_URI="mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.bz2 + ${PATCHSET_URI}" + +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} + sys-devel/flex + virtual/yacc" + +src_prepare() { + # Upstream's patchset + if [[ -n ${PATCH_VER} ]]; then + EPATCH_SUFFIX="patch" \ + epatch "${WORKDIR}"/patches + fi + + # 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-r2.patch + + # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5371 + epatch "${FILESDIR}"/${PN}-5.0.5-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}"/${PN}-5.0.5-fix-building-without-ldap.patch + + # https://bugs.gentoo.org/show_bug.cgi?id=361899 + epatch "${FILESDIR}"/${PN}-5.0.5-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch + + # https://bugs.gentoo.org/show_bug.cgi?id=381315 + epatch "${FILESDIR}"/${P}-revert-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" + addpredict "/run/mount/utab" + + # --with-confdir is for bug #361481 + # --with-mapdir is for bug #385113 + # for systemd support (not enabled yet): + # --with-systemd + # --disable-move-mount: requires kernel >=2.6.39 + econf \ + --with-confdir=/etc/conf.d \ + --with-mapdir=/etc/autofs \ + $(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 + insinto etc/autofs + newins "${FILESDIR}"/autofs5-auto.master auto.master +} + +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/autofs-5.0.3-heimdal.patch b/net-fs/autofs/files/autofs-5.0.3-heimdal.patch new file mode 100644 index 0000000..707364d --- /dev/null +++ b/net-fs/autofs/files/autofs-5.0.3-heimdal.patch @@ -0,0 +1,35 @@ +--- autofs-5.0.3.orig/modules/cyrus-sasl.c 2008-04-28 16:17:03.000000000 +0200 ++++ autofs-5.0.3/modules/cyrus-sasl.c 2008-04-28 16:41:58.000000000 +0200 +@@ -66,6 +66,15 @@ + #endif + #endif + ++/** ++ * The type of a principal is different for MIT Krb5 and Heimdal. ++ * These macros are provided by Heimdal, and introduced here for MIT. ++ */ ++#ifndef krb5_realm_length ++#define krb5_realm_length(r) ((r).length) ++#define krb5_realm_data(r) ((r).data) ++#endif ++ + /* + * Once a krb5 credentials cache is setup, we need to set the KRB5CCNAME + * environment variable so that the library knows where to find it. +@@ -452,11 +461,11 @@ + + /* setup a principal for the ticket granting service */ + ret = krb5_build_principal_ext(ctxt->krb5ctxt, &tgs_princ, +- krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)->length, +- krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)->data, ++ krb5_realm_length(*krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)), ++ krb5_realm_data(*krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)), + strlen(KRB5_TGS_NAME), KRB5_TGS_NAME, +- krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)->length, +- krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)->data, ++ krb5_realm_length(*krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)), ++ krb5_realm_data(*krb5_princ_realm(ctxt->krb5ctxt, krb5_client_princ)), + 0); + if (ret) { + error(logopt, + diff --git a/net-fs/autofs/files/autofs-5.0.5-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch b/net-fs/autofs/files/autofs-5.0.5-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch new file mode 100644 index 0000000..4d70d2a --- /dev/null +++ b/net-fs/autofs/files/autofs-5.0.5-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch @@ -0,0 +1,28 @@ +--- ./modules/lookup_ldap.c ++++ ./modules/lookup_ldap.c +@@ -591,10 +591,12 @@ static LDAP *do_connect(unsigned logopt, const char *uri, struct lookup_context + { + LDAP *ldap; + ++#ifdef HAVE_SASL + if (ctxt->extern_cert && ctxt->extern_key) { + set_env(logopt, ENV_LDAPTLS_CERT, ctxt->extern_cert); + set_env(logopt, ENV_LDAPTLS_KEY, ctxt->extern_key); + } ++#endif + + ldap = init_ldap_connection(logopt, uri, ctxt); + if (ldap) { +@@ -1372,10 +1374,12 @@ static void free_context(struct lookup_context *ctxt) + defaults_free_searchdns(ctxt->sdns); + if (ctxt->dclist) + free_dclist(ctxt->dclist); ++#ifdef HAVE_SASL + if (ctxt->extern_cert) + free(ctxt->extern_cert); + if (ctxt->extern_key) + free(ctxt->extern_key); ++#endif + free(ctxt); + + return; diff --git a/net-fs/autofs/files/autofs-5.0.5-fix-building-without-ldap.patch b/net-fs/autofs/files/autofs-5.0.5-fix-building-without-ldap.patch new file mode 100644 index 0000000..3429b6f --- /dev/null +++ b/net-fs/autofs/files/autofs-5.0.5-fix-building-without-ldap.patch @@ -0,0 +1,76 @@ +=== modified file 'Makefile.rules' +--- Makefile.rules 2011-04-30 18:13:36 +0000 ++++ Makefile.rules 2011-04-30 18:12:37 +0000 +@@ -42,6 +42,10 @@ + AUTOFS_LDFLAGS += $(DMALLOCLIB) + endif + ++ifdef SASL ++CFLAGS += $(XML_FLAGS) ++endif ++ + # Standard rules + + .SUFFIXES: .c .o .s .so + +=== modified file 'lib/defaults.c' +--- lib/defaults.c 2011-04-30 18:13:36 +0000 ++++ lib/defaults.c 2011-04-30 18:12:37 +0000 +@@ -19,7 +19,10 @@ + + #include "list.h" + #include "defaults.h" ++#include "config.h" ++#ifdef WITH_LDAP + #include "lookup_ldap.h" ++#endif + #include "log.h" + #include "automount.h" + +@@ -197,6 +200,7 @@ + return 1; + } + ++#ifdef WITH_LDAP + void defaults_free_uris(struct list_head *list) + { + struct list_head *next; +@@ -252,9 +256,11 @@ + + return 1; + } ++#endif + + struct list_head *defaults_get_uris(void) + { ++#ifdef WITH_LDAP + FILE *f; + char buf[MAX_LINE_LEN]; + char *res; +@@ -288,6 +294,9 @@ + + fclose(f); + return list; ++#else ++ return NULL; ++#endif + } + + /* +@@ -450,6 +459,7 @@ + return res; + } + ++#ifdef WITH_LDAP + struct ldap_schema *defaults_get_default_schema(void) + { + struct ldap_schema *schema; +@@ -645,6 +655,7 @@ + + return schema; + } ++#endif + + unsigned int defaults_get_mount_nfs_default_proto(void) + { + diff --git a/net-fs/autofs/files/autofs-5.0.5-fix-install-deadlink.patch b/net-fs/autofs/files/autofs-5.0.5-fix-install-deadlink.patch new file mode 100644 index 0000000..8ab10fc --- /dev/null +++ b/net-fs/autofs/files/autofs-5.0.5-fix-install-deadlink.patch @@ -0,0 +1,12 @@ +--- modules/Makefile.old 2010-06-19 20:43:45.373371321 +0200 ++++ modules/Makefile 2010-06-19 20:45:26.062417092 +0200 +@@ -63,7 +63,9 @@ install: all + -rm -f $(INSTALLROOT)$(autofslibdir)/mount_smbfs.so + ln -fs lookup_file.so $(INSTALLROOT)$(autofslibdir)/lookup_files.so + ln -fs lookup_yp.so $(INSTALLROOT)$(autofslibdir)/lookup_nis.so ++ifeq ($(SASL), 1) + ln -fs lookup_ldap.so $(INSTALLROOT)$(autofslibdir)/lookup_ldaps.so ++endif + ln -fs mount_nfs.so $(INSTALLROOT)$(autofslibdir)/mount_nfs4.so + ifeq ($(EXT2FS), 1) + ifeq ($(EXT3FS), 1) diff --git a/net-fs/autofs/files/autofs-5.0.6-respect-user-flags-and-fix-asneeded-r2.patch b/net-fs/autofs/files/autofs-5.0.6-respect-user-flags-and-fix-asneeded-r2.patch new file mode 100644 index 0000000..a61696b --- /dev/null +++ b/net-fs/autofs/files/autofs-5.0.6-respect-user-flags-and-fix-asneeded-r2.patch @@ -0,0 +1,154 @@ +--- a/Makefile.conf.in ++++ b/Makefile.conf.in +@@ -100,3 +100,6 @@ initdir = @initdir@ + + # Location of systemd unit files + systemddir = @systemddir@ ++ ++# Use the compiler determined by configure ++CC := @CC@ +--- a/Makefile.rules ++++ b/Makefile.rules +@@ -16,44 +16,30 @@ INSTALLROOT = $(DESTDIR) + AUTOFS_LIB = ../lib/autofs.a + + # Compilers, linkers and flags +-# The STRIP defined here *must not* remove any dynamic-loading symbols +- + ifdef DMALLOCLIB + DEBUG=1 + endif + + ifdef DEBUG + CFLAGS ?= -g -Wall -DDEBUG +-LDFLAGS = -g +-STRIP = : + else +-ifdef DONTSTRIP + CFLAGS ?= -O2 -g +-LDFLAGS = -g +-STRIP = : +-else +-CFLAGS ?= -O2 -Wall +-LDFLAGS = -s +-STRIP = strip --strip-debug +-endif + endif ++AUTOFS_LDFLAGS = -g + +-CC = gcc +-CXX = g++ + CXXFLAGS = $(CFLAGS) + LD = ld + SOLDFLAGS = -shared + + CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64 +-LDFLAGS += -lpthread + + ifdef TIRPCLIB + CFLAGS += -I/usr/include/tirpc +-LDFLAGS += $(TIRPCLIB) ++AUTOFS_LDFLAGS += $(TIRPCLIB) + endif + + ifdef DMALLOCLIB +-LDFLAGS += $(DMALLOCLIB) ++AUTOFS_LDFLAGS += $(DMALLOCLIB) + endif + + ifdef SASL +@@ -71,5 +57,4 @@ endif + $(CC) $(CFLAGS) -S $< + + .c.so: +- $(CC) $(SOLDFLAGS) $(CFLAGS) -o $*.so $< $(AUTOFS_LIB) $(DMALLOCLIB) $(LIBNSL) +- $(STRIP) $*.so ++ $(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) -o $*.so $< $(AUTOFS_LIB) $(DMALLOCLIB) $(LIBNSL) +--- a/configure.in ++++ b/configure.in +@@ -183,7 +183,7 @@ AC_ARG_WITH(hesiod, + : Search for Hesiod in normal directory path + else + : Search for Hesiod in specific directory +- LDFLAGS="$LDFLAGS -L${withval}/lib" ++ LDFLAGS="$LDFLAGS -Wl,--no-as-needed -L${withval}/lib" + LIBHESIOD="-L${withval}/lib" + HESIOD_FLAGS="-I${withval}/include" + fi +--- a/daemon/Makefile ++++ b/daemon/Makefile +@@ -2,8 +2,8 @@ + # Makefile for autofs + # + +--include ../Makefile.conf + include ../Makefile.rules ++-include ../Makefile.conf + + SRCS = automount.c indirect.c direct.c spawn.c module.c mount.c \ + lookup.c state.c flag.c +@@ -20,7 +20,7 @@ CFLAGS += -DAUTOFS_FIFO_DIR=\"$(autofsfi + CFLAGS += -DAUTOFS_FLAG_DIR=\"$(autofsflagdir)\" + CFLAGS += -DVERSION_STRING=\"$(version)\" + LDFLAGS += -rdynamic +-LIBS = -ldl ++LIBS = -ldl -lpthread + + ifeq ($(LDAP), 1) + CFLAGS += $(XML_FLAGS) +@@ -30,8 +30,7 @@ endif + all: automount + + automount: $(OBJS) $(AUTOFS_LIB) +- $(CC) $(LDFLAGS) $(DAEMON_LDFLAGS) -o automount $(OBJS) $(AUTOFS_LIB) $(LIBS) +- $(STRIP) automount ++ $(CC) $(AUTOFS_LDFLAGS) $(DAEMON_LDFLAGS) $(LDFLAGS) -o automount $(OBJS) $(AUTOFS_LIB) $(LIBS) + + clean: + rm -f *.o *.s *~ automount +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -41,14 +41,12 @@ mount_clnt.c: mount.h + + mount_clnt.o: mount_clnt.c + $(CC) $(CFLAGS) -o mount_clnt.o -c mount_clnt.c +- $(STRIP) mount_clnt.o + + mount_xdr.c: mount.h + $(RPCGEN) -c -o mount_xdr.c mount.x + + mount_xdr.o: mount_xdr.c + $(CC) $(CFLAGS) -Wno-unused-variable -o mount_xdr.o -c mount_xdr.c +- $(STRIP) mount_xdr.o + + master_tok.c: master_tok.l + $(LEX) -o$@ -Pmaster_ $? +--- a/modules/Makefile ++++ b/modules/Makefile +@@ -87,9 +87,8 @@ endif + # Ad hoc compilation rules for modules which need auxilliary libraries + # + lookup_hesiod.so: lookup_hesiod.c +- $(CC) $(SOLDFLAGS) $(CFLAGS) $(HESIOD_FLAGS) -o lookup_hesiod.so \ ++ $(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) $(HESIOD_FLAGS) -o lookup_hesiod.so \ + lookup_hesiod.c $(AUTOFS_LIB) $(LIBHESIOD) $(LIBRESOLV) +- $(STRIP) lookup_hesiod.so + + cyrus-sasl.o: cyrus-sasl.c + $(CC) $(CFLAGS) $(LDAP_FLAGS) -c $< +@@ -98,13 +97,10 @@ cyrus-sasl-extern.o: cyrus-sasl-extern.c + $(CC) $(CFLAGS) $(LDAP_FLAGS) -c $< + + lookup_ldap.so: lookup_ldap.c dclist.o base64.o $(SASL_OBJ) +- $(CC) $(SOLDFLAGS) $(CFLAGS) $(LDAP_FLAGS) -o lookup_ldap.so \ ++ $(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) $(LDAP_FLAGS) -o lookup_ldap.so \ + lookup_ldap.c dclist.o base64.o $(SASL_OBJ) \ + $(AUTOFS_LIB) $(LIBLDAP) $(LIBRESOLV) +- $(STRIP) lookup_ldap.so + + mount_nfs.so: mount_nfs.c replicated.o +- $(CC) $(SOLDFLAGS) $(CFLAGS) -o mount_nfs.so \ ++ $(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) -o mount_nfs.so \ + mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL) +- $(STRIP) mount_nfs.so +- diff --git a/net-fs/autofs/files/autofs-5.0.6-revert-ldap.patch b/net-fs/autofs/files/autofs-5.0.6-revert-ldap.patch new file mode 100644 index 0000000..49901dd --- /dev/null +++ b/net-fs/autofs/files/autofs-5.0.6-revert-ldap.patch @@ -0,0 +1,18 @@ +--- modules/lookup_ldap.c ++++ modules/lookup_ldap.c +@@ -1488,6 +1488,7 @@ int lookup_init(const char *mapfmt, int + } + } + ++#ifdef WITH_SASL + /* + * First, check to see if a preferred authentication method was + * specified by the user. parse_ldap_config will return error +@@ -1500,7 +1501,6 @@ int lookup_init(const char *mapfmt, int + return 1; + } + +-#ifdef WITH_SASL + /* Init the sasl callbacks */ + if (!autofs_sasl_client_init(LOGOPT_NONE)) { + error(LOGOPT_ANY, "failed to init sasl client"); diff --git a/net-fs/autofs/files/autofs5-auto.master b/net-fs/autofs/files/autofs5-auto.master new file mode 100644 index 0000000..4b10001 --- /dev/null +++ b/net-fs/autofs/files/autofs5-auto.master @@ -0,0 +1,24 @@ +# $Id: autofs5-auto.master,v 1.1 2011/05/23 08:29:05 pva Exp $ +# Sample auto.master file +# This is an automounter map and it has the following format +# key [ -mount-options-separated-by-comma ] location +# For details of the format look at autofs(5). +# +#/misc /etc/autofs/auto.misc +#/net /etc/autofs/auto.net +# +# NOTE: mounts done from a hosts map will be mounted with the +# "nosuid" and "nodev" options unless the "suid" and "dev" +# options are explicitly given. +# +#/net -hosts +# +# Include central master map if it can be found using +# nsswitch sources. +# +# Note that if there are entries for /net or /misc (as +# above) in the included master map any keys that are the +# same will not be seen as the first read key seen takes +# precedence. +# +#+auto.master diff --git a/net-fs/autofs/files/autofs5.initd b/net-fs/autofs/files/autofs5.initd new file mode 100644 index 0000000..bd3f14f --- /dev/null +++ b/net-fs/autofs/files/autofs5.initd @@ -0,0 +1,70 @@ +#!/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.3 2011/10/05 14:27:26 pva Exp $ + +DAEMON=/usr/sbin/automount +PIDFILE=/var/run/autofs.pid +DEVICE=autofs + +depend() { + need localmount + use ypbind nfs slapd portmap net +} + +extra_started_commands="reload" + +start() { + ebegin "Starting automounter" + + # Ensure autofs support is loaded + grep -q autofs /proc/filesystems || modprobe -q autofs4 + if [ $? -ne 0 ]; then + eend 1 "No autofs support available in kernel" + return 1 + fi + + # Check misc device + if [ -n "${USE_MISC_DEVICE}" -a "${USE_MISC_DEVICE}" = "yes" ]; then + sleep 1 + if [ -e "/proc/misc" ]; then + MINOR=$(awk "/${DEVICE}/ {print \$1}" /proc/misc) + 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 + fi + fi + fi + 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 + fi + fi + else + [ -c "/dev/${DEVICE}" ] && rm -rf "/dev/${DEVICE}" + fi + + start-stop-daemon --start --exec ${DAEMON} -- -p ${PIDFILE} ${OPTIONS} + + eend $? +} + +stop() { + ebegin "Stopping automounter" + start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} + eend $? +} + +reload() { + ebegin "Reloading automounter" + if [ ! -r "${PIDFILE}" ]; then + eend 1 "automount not running" + else + kill -HUP $(cat "${PIDFILE}") 2> /dev/null + eend $? + fi +} diff --git a/net-fs/autofs/files/autofs5.rc1 b/net-fs/autofs/files/autofs5.rc1 new file mode 100644 index 0000000..9e4252a --- /dev/null +++ b/net-fs/autofs/files/autofs5.rc1 @@ -0,0 +1,42 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/files/autofs5.rc1,v 1.1 2008/02/05 12:32:20 stefaan Exp $ + +DAEMON=/usr/sbin/automount +PIDFILE=/var/run/autofs.pid + +depend() { + need localmount + use ypbind nfs slapd portmap net +} + +opts="start stop restart status reload" + +start() { + ebegin "Starting automounter" + + # ensure autofs support is loaded + grep -q autofs /proc/filesystems || modprobe -q autofs4 || modprobe -q autofs + if [ $? -ne 0 ]; then + eend 1 "No autofs support available" + return 1 + fi + + start-stop-daemon --start --exec ${DAEMON} -- -p ${PIDFILE} ${daemonoptions} + + eend $? +} + +stop() { + ebegin "Stopping automounter" + start-stop-daemon --stop --quiet --signal TERM -p ${PIDFILE} + eend $? +} + +reload() { + ebegin "Reloading automounter" + kill -HUP $(cat ${PIDFILE}) + eend $? +} + -- 2.39.5