summaryrefslogtreecommitdiff
path: root/net-fs
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-fs
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-fs')
-rw-r--r--net-fs/autofs/Manifest7
-rw-r--r--net-fs/autofs/autofs-5.0.10.ebuild115
-rw-r--r--net-fs/autofs/autofs-5.0.7-r4.ebuild133
-rw-r--r--net-fs/autofs/autofs-5.0.7-r5.ebuild134
-rw-r--r--net-fs/autofs/autofs-5.0.8-r1.ebuild116
-rw-r--r--net-fs/autofs/autofs-5.0.8-r2.ebuild120
-rw-r--r--net-fs/autofs/autofs-5.0.9-r1.ebuild119
-rw-r--r--net-fs/autofs/autofs-5.0.9.ebuild115
-rw-r--r--net-fs/autofs/autofs-5.1.0-r1.ebuild120
-rw-r--r--net-fs/autofs/autofs-5.1.0.ebuild119
-rw-r--r--net-fs/autofs/autofs-5.1.1.ebuild115
-rw-r--r--net-fs/autofs/files/autofs-5.0.3-heimdal.patch35
-rw-r--r--net-fs/autofs/files/autofs-5.0.5-fix-install-deadlink.patch12
-rw-r--r--net-fs/autofs/files/autofs-5.0.6-revert-ldap.patch18
-rw-r--r--net-fs/autofs/files/autofs-5.0.7-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch45
-rw-r--r--net-fs/autofs/files/autofs-5.0.7-libtirpc-link.patch10
-rw-r--r--net-fs/autofs/files/autofs-5.0.7-parallel-make.patch48
-rw-r--r--net-fs/autofs/files/autofs-5.0.7-respect-user-flags-and-fix-asneeded-r3.patch144
-rw-r--r--net-fs/autofs/files/autofs-5.0.7-sasl-def.patch43
-rw-r--r--net-fs/autofs/files/autofs-5.0.7-sloppy-mount.patch99
-rw-r--r--net-fs/autofs/files/autofs-5.0.8-ldap-wo-sasl.patch27
-rw-r--r--net-fs/autofs/files/autofs-5.1.0-fix-missing-stdarg.patch43
-rw-r--r--net-fs/autofs/files/autofs5-auto.master24
-rw-r--r--net-fs/autofs/files/autofs5.initd70
-rw-r--r--net-fs/autofs/metadata.xml22
-rw-r--r--net-fs/cifs-utils/Manifest4
-rw-r--r--net-fs/cifs-utils/cifs-utils-5.9-r1.ebuild85
-rw-r--r--net-fs/cifs-utils/cifs-utils-6.1-r1.ebuild110
-rw-r--r--net-fs/cifs-utils/cifs-utils-6.3.ebuild105
-rw-r--r--net-fs/cifs-utils/cifs-utils-6.4.ebuild105
-rw-r--r--net-fs/cifs-utils/files/cifs-utils-5.5-initialize_rc_var_properly.patch38
-rw-r--r--net-fs/cifs-utils/files/cifs-utils-5.9-set-parsed_info-got_user-when-a-cred-file.patch31
-rw-r--r--net-fs/cifs-utils/files/cifs-utils-6.1-hardcoded-path.patch44
-rw-r--r--net-fs/cifs-utils/metadata.xml16
-rw-r--r--net-fs/curlftpfs/Manifest1
-rw-r--r--net-fs/curlftpfs/curlftpfs-0.9.2-r3.ebuild43
-rw-r--r--net-fs/curlftpfs/files/curlftpfs-0.9.2-64bit_filesize.patch11
-rw-r--r--net-fs/curlftpfs/files/curlftpfs-0.9.2-darwin.patch17
-rw-r--r--net-fs/curlftpfs/files/curlftpfs-0.9.2-fix-escaping.patch420
-rw-r--r--net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch60
-rw-r--r--net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch24
-rw-r--r--net-fs/curlftpfs/metadata.xml12
-rw-r--r--net-fs/cvmfs/Manifest2
-rw-r--r--net-fs/cvmfs/cvmfs-2.1.19.ebuild103
-rw-r--r--net-fs/cvmfs/cvmfs-2.1.20.0_p05.ebuild115
-rw-r--r--net-fs/cvmfs/cvmfs-9999.ebuild110
-rw-r--r--net-fs/cvmfs/files/cvmfs-2.1.20.0_p05-cares-underlink.patch106
-rw-r--r--net-fs/cvmfs/files/cvmfs-2.1.20.0_p05-geoip-missing-cmake.patch151
-rw-r--r--net-fs/cvmfs/metadata.xml22
-rw-r--r--net-fs/davfs2/Manifest2
-rw-r--r--net-fs/davfs2/davfs2-1.4.5-r1.ebuild73
-rw-r--r--net-fs/davfs2/davfs2-1.4.7.ebuild63
-rw-r--r--net-fs/davfs2/files/davfs2-1.4.5-glibc212.patch60
-rw-r--r--net-fs/davfs2/files/davfs2-1.4.7-destdir.patch18
-rw-r--r--net-fs/davfs2/metadata.xml5
-rw-r--r--net-fs/libnfs/Manifest5
-rw-r--r--net-fs/libnfs/files/libnfs-1.5.0-headers.patch42
-rw-r--r--net-fs/libnfs/files/libnfs-1.8.0-makefile.patch38
-rw-r--r--net-fs/libnfs/files/libnfs-1.9.5-headers.patch86
-rw-r--r--net-fs/libnfs/files/libnfs-1.9.5-implicit-internal.patch27
-rw-r--r--net-fs/libnfs/libnfs-1.3.0.ebuild49
-rw-r--r--net-fs/libnfs/libnfs-1.5.0.ebuild45
-rw-r--r--net-fs/libnfs/libnfs-1.8.0.ebuild47
-rw-r--r--net-fs/libnfs/libnfs-1.9.5.ebuild47
-rw-r--r--net-fs/libnfs/libnfs-1.9.7.ebuild42
-rw-r--r--net-fs/libnfs/libnfs-9999.ebuild42
-rw-r--r--net-fs/libnfs/metadata.xml8
-rw-r--r--net-fs/metadata.xml34
-rw-r--r--net-fs/ncpfs/Manifest1
-rw-r--r--net-fs/ncpfs/files/ipx.confd28
-rw-r--r--net-fs/ncpfs/files/ipx.init42
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.5-php.patch16
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-align-fix.patch12
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-drop-kernel-check.patch31
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-drop-mtab-support.patch269
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-gcc4.patch36
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-getuid-fix.patch124
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-ldflags-support.patch153
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-makefile-fix-soname-link.patch15
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-missing-includes.patch22
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-multiple-vulns.patch557
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-no-suid-root.patch16
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-pam_ncp_auth-fix.patch12
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-pie-fix.patch31
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-remove-libncp_atomic-header.patch15
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-remove-packed-attrib.patch297
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-servername-array-fix.patch15
-rw-r--r--net-fs/ncpfs/files/ncpfs-2.2.6-zend_function_entry.patch11
-rw-r--r--net-fs/ncpfs/metadata.xml6
-rw-r--r--net-fs/ncpfs/ncpfs-2.2.6-r3.ebuild90
-rw-r--r--net-fs/netatalk/Manifest2
-rw-r--r--net-fs/netatalk/files/netatalk-3.1.6-gentoo.patch127
-rw-r--r--net-fs/netatalk/files/netatalk-3.1.7-gentoo.patch132
-rw-r--r--net-fs/netatalk/metadata.xml36
-rw-r--r--net-fs/netatalk/netatalk-3.1.6.ebuild179
-rw-r--r--net-fs/netatalk/netatalk-3.1.7.ebuild179
-rw-r--r--net-fs/nfs-utils/Manifest3
-rw-r--r--net-fs/nfs-utils/files/exports1
-rw-r--r--net-fs/nfs-utils/files/nfs-utils-1.1.4-mtab-sym.patch39
-rw-r--r--net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch48
-rw-r--r--net-fs/nfs-utils/files/nfs-utils-1.3.0-gcc-4.9.patch62
-rw-r--r--net-fs/nfs-utils/files/nfs-utils-1.3.2-background-statd.patch30
-rw-r--r--net-fs/nfs-utils/files/nfs-utils.conf3
-rw-r--r--net-fs/nfs-utils/files/nfs.confd38
-rwxr-xr-xnet-fs/nfs-utils/files/nfs.initd163
-rw-r--r--net-fs/nfs-utils/files/nfsclient.confd18
-rw-r--r--net-fs/nfs-utils/files/nfsclient.initd34
-rw-r--r--net-fs/nfs-utils/files/nfsd.service-r115
-rw-r--r--net-fs/nfs-utils/files/nfsmount.confd7
-rwxr-xr-xnet-fs/nfs-utils/files/nfsmount.initd48
-rw-r--r--net-fs/nfs-utils/files/nfsmount.initd-1.3.127
-rw-r--r--net-fs/nfs-utils/files/proc-fs-nfsd.mount8
-rw-r--r--net-fs/nfs-utils/files/rpc-gssd.service12
-rw-r--r--net-fs/nfs-utils/files/rpc-idmapd.service11
-rw-r--r--net-fs/nfs-utils/files/rpc-mountd.service-r110
-rw-r--r--net-fs/nfs-utils/files/rpc-statd.service-r212
-rw-r--r--net-fs/nfs-utils/files/rpc-svcgssd.service13
-rwxr-xr-xnet-fs/nfs-utils/files/rpc.gssd.initd24
-rwxr-xr-xnet-fs/nfs-utils/files/rpc.idmapd.initd26
-rw-r--r--net-fs/nfs-utils/files/rpc.pipefs.initd33
-rwxr-xr-xnet-fs/nfs-utils/files/rpc.statd.initd33
-rwxr-xr-xnet-fs/nfs-utils/files/rpc.svcgssd.initd24
-rw-r--r--net-fs/nfs-utils/files/var-lib-nfs-rpc_pipefs.mount7
-rw-r--r--net-fs/nfs-utils/metadata.xml17
-rw-r--r--net-fs/nfs-utils/nfs-utils-1.2.9-r3.ebuild153
-rw-r--r--net-fs/nfs-utils/nfs-utils-1.3.1-r4.ebuild172
-rw-r--r--net-fs/nfs-utils/nfs-utils-1.3.1-r5.ebuild172
-rw-r--r--net-fs/nfs-utils/nfs-utils-1.3.2-r6.ebuild177
-rw-r--r--net-fs/nfs4-acl-tools/Manifest1
-rw-r--r--net-fs/nfs4-acl-tools/metadata.xml5
-rw-r--r--net-fs/nfs4-acl-tools/nfs4-acl-tools-0.3.3.ebuild17
-rw-r--r--net-fs/nfstest/Manifest1
-rw-r--r--net-fs/nfstest/metadata.xml7
-rw-r--r--net-fs/nfstest/nfstest-1.0.2.ebuild26
-rw-r--r--net-fs/openafs-kernel/Manifest9
-rw-r--r--net-fs/openafs-kernel/metadata.xml20
-rw-r--r--net-fs/openafs-kernel/openafs-kernel-1.6.11.1.ebuild117
-rw-r--r--net-fs/openafs-kernel/openafs-kernel-1.6.11.ebuild117
-rw-r--r--net-fs/openafs-kernel/openafs-kernel-1.6.12.ebuild124
-rw-r--r--net-fs/openafs-legacy/metadata.xml5
-rw-r--r--net-fs/openafs-legacy/openafs-legacy-0.1.ebuild71
-rw-r--r--net-fs/openafs/Manifest9
-rw-r--r--net-fs/openafs/metadata.xml24
-rw-r--r--net-fs/openafs/openafs-1.6.11.1.ebuild176
-rw-r--r--net-fs/openafs/openafs-1.6.11.ebuild175
-rw-r--r--net-fs/openafs/openafs-1.6.12.ebuild175
-rw-r--r--net-fs/samba/Manifest8
-rw-r--r--net-fs/samba/files/3.5/lmhosts2
-rw-r--r--net-fs/samba/files/3.5/nsswitch.conf-winbind17
-rw-r--r--net-fs/samba/files/3.5/nsswitch.conf-wins17
-rw-r--r--net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch30
-rw-r--r--net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch58
-rw-r--r--net-fs/samba/files/3.5/samba.confd28
-rw-r--r--net-fs/samba/files/3.5/samba.initd59
-rw-r--r--net-fs/samba/files/3.5/samba.pam8
-rw-r--r--net-fs/samba/files/3.5/smb.conf.default271
-rw-r--r--net-fs/samba/files/3.5/smb.conf.default.patch86
-rw-r--r--net-fs/samba/files/3.5/smbusers7
-rw-r--r--net-fs/samba/files/3.5/swat.xinetd17
-rw-r--r--net-fs/samba/files/3.5/system-auth-winbind.pam18
-rw-r--r--net-fs/samba/files/3.6/lmhosts2
-rw-r--r--net-fs/samba/files/3.6/samba.confd28
-rw-r--r--net-fs/samba/files/3.6/samba.initd60
-rw-r--r--net-fs/samba/files/3.6/samba.pam8
-rw-r--r--net-fs/samba/files/3.6/smb.conf.default.patch68
-rw-r--r--net-fs/samba/files/3.6/smbusers7
-rw-r--r--net-fs/samba/files/3.6/swat.xinetd17
-rw-r--r--net-fs/samba/files/3.6/system-auth-winbind.pam18
-rw-r--r--net-fs/samba/files/4.0/com_err.patch35
-rw-r--r--net-fs/samba/files/4.0/samba4.confd38
-rw-r--r--net-fs/samba/files/4.0/samba4.initd-r156
-rw-r--r--net-fs/samba/files/4.1/com_err.patch35
-rw-r--r--net-fs/samba/files/4.1/samba4.confd38
-rw-r--r--net-fs/samba/files/4.1/samba4.initd-r156
-rw-r--r--net-fs/samba/files/4.2/samba4.confd38
-rw-r--r--net-fs/samba/files/4.2/samba4.initd-r156
-rw-r--r--net-fs/samba/files/named.conf.dlz.patch15
-rw-r--r--net-fs/samba/files/nmbd.service12
-rw-r--r--net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk6
-rw-r--r--net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch57
-rw-r--r--net-fs/samba/files/samba-4.1.14-libsystemd.patch51
-rw-r--r--net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch15
-rw-r--r--net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch22
-rw-r--r--net-fs/samba/files/samba.conf1
-rw-r--r--net-fs/samba/files/samba.service10
-rw-r--r--net-fs/samba/files/smbd.service12
-rw-r--r--net-fs/samba/files/smbd.socket9
-rw-r--r--net-fs/samba/files/smbd_at.service7
-rw-r--r--net-fs/samba/files/winbindd.service12
-rw-r--r--net-fs/samba/metadata.xml30
-rw-r--r--net-fs/samba/samba-3.5.21.ebuild453
-rw-r--r--net-fs/samba/samba-3.5.22.ebuild453
-rw-r--r--net-fs/samba/samba-3.6.25.ebuild483
-rw-r--r--net-fs/samba/samba-4.0.26.ebuild181
-rw-r--r--net-fs/samba/samba-4.1.18.ebuild176
-rw-r--r--net-fs/samba/samba-4.1.19.ebuild176
-rw-r--r--net-fs/samba/samba-4.2.3.ebuild182
-rw-r--r--net-fs/smbnetfs/Manifest2
-rw-r--r--net-fs/smbnetfs/metadata.xml34
-rw-r--r--net-fs/smbnetfs/smbnetfs-0.5.3b.ebuild40
-rw-r--r--net-fs/smbnetfs/smbnetfs-0.6.0-r1.ebuild41
-rw-r--r--net-fs/smbnetfs/smbnetfs-0.6.0.ebuild41
-rw-r--r--net-fs/smbtad/Manifest1
-rwxr-xr-xnet-fs/smbtad/files/smbtad.rc26
-rw-r--r--net-fs/smbtad/metadata.xml12
-rw-r--r--net-fs/smbtad/smbtad-1.2.6.ebuild51
-rw-r--r--net-fs/smbtatools/Manifest1
-rw-r--r--net-fs/smbtatools/metadata.xml12
-rw-r--r--net-fs/smbtatools/smbtatools-1.2.6.ebuild42
-rw-r--r--net-fs/tahoe-lafs/Manifest1
-rw-r--r--net-fs/tahoe-lafs/files/tahoe-lafs-1.10.0-ifconfig.patch20
-rw-r--r--net-fs/tahoe-lafs/files/tahoe-lafs-1.10.0-setup.patch17
-rw-r--r--net-fs/tahoe-lafs/metadata.xml23
-rw-r--r--net-fs/tahoe-lafs/tahoe-lafs-1.10.0-r2.ebuild59
-rw-r--r--net-fs/wdfs/Manifest1
-rw-r--r--net-fs/wdfs/files/wdfs-1.4.2-fix-Waddress.patch40
-rw-r--r--net-fs/wdfs/metadata.xml13
-rw-r--r--net-fs/wdfs/wdfs-1.4.2-r1.ebuild25
-rw-r--r--net-fs/wdfs/wdfs-1.4.2.ebuild21
219 files changed, 13366 insertions, 0 deletions
diff --git a/net-fs/autofs/Manifest b/net-fs/autofs/Manifest
new file mode 100644
index 00000000000..84ddb5e6494
--- /dev/null
+++ b/net-fs/autofs/Manifest
@@ -0,0 +1,7 @@
+DIST autofs-5.0.10.tar.xz 258480 SHA256 98150c09639112a125a6d0ddc6aa1920ae4e6c41736e65d8a004c3171fcca70b SHA512 899d3b7040d1162312f9d595df0fd6c40489e4aefb7086893b51993446da78f10707d7e8caf8440ff24000d54794faca869aaf8564e5622caf8bb046af6fcf3b WHIRLPOOL 32c964a58f5125dfbfe589345e1fdf3da357fdadead790e3adbc840f0fc1b7093a0191224ac8d07ac792184914f6630ba08d572ffdcca0423e2a41bb2892ceaf
+DIST autofs-5.0.7-patches-3.tar.lzma 37967 SHA256 16de3486573a94d476f70f2c422656d6fddd79b3581ce05faeb5dd55748ba1cb SHA512 8cbb683a82d2cdc5e3c97921ba3a5bc5af5ab9fb45e4802de021a6161eaeaebb192790a351d281d48b68ed0f8ea6e3a0c0514a4f4a1c546191d8acca9e856ca7 WHIRLPOOL a42f6d609ee4160dfb2d84d94516667f41b8dbe9bf6bdef923f424f82ec00f6115f211dc2985170c45be53bdc45ea47026cc3750c61c7e14aa02ce3384bb9908
+DIST autofs-5.0.7.tar.bz2 319117 SHA256 08c4304d8076dc80c14df559bc5fd821b67ef3457b245f61068bd053d8f94ccc SHA512 672c53e0a5477097779088d8654edaad4cb01ab68ade2ee175d963c7d4895d1bdeeeabc87057ecca2f4f3a0f08014298dae40e5e8e862c20c0b1477d72431f84 WHIRLPOOL 220cbd618ee4f34c82eaad823312284cc787aa28a0a8b9638a4b495cf38a3a6f9da194e74722febe04ee2b5ac4e1e9eccccde1f562d0d554f1e8a5ff4b5faec8
+DIST autofs-5.0.8.tar.bz2 328559 SHA256 2e0e42c654b7762b1235ec0131317224c57fdc6757ec00c820b2aa86338c9f7d SHA512 72b01b4a45e70b651ab6f4cd63039bc3d7f389a21fde354a4ba1e0e172b5480abd9b12134b8a9c74284712c2d4ff0d46ad2b47ca1692b510b0d1be5d56bf3335 WHIRLPOOL 4d9cd57819930070d6741d174f61d7c99d00ff6af364e1f9ced3f4dc8eacdf3af4c1d843127e2d8d4e57238389542976379d8c009562fa51e3fdecf7f3db29d0
+DIST autofs-5.0.9.tar.xz 256680 SHA256 81ab99ee1656a10ecaffe7933c26e8fc720f0b639ed47ab52adc66cdd868fd5c SHA512 36ecc38fa5108766069d5bbfcc22b186481d2e8aaa1b101406b389787280ae5e87ee21aab697f7ed0c9c9705278e8cd8b0143aee5fc2affd1becd85535dd9d73 WHIRLPOOL 915486d725e0a3b0d939b28dfd030d79c4fd71b7ff12c3f09bbbe558f00a8560141b9483263a5a04e84cc84eb0f92c90b1bb18df747aa5746046470b0f18bc00
+DIST autofs-5.1.0.tar.xz 288288 SHA256 f4b343797e6df03627a9fd41bda6fd85acb84aa3fdd15694eec03ec90a52bc27 SHA512 a455df8d93bc29aa87c3f928edea5bb3f91ab9c7bd7bbca8eb1370fdcc4c32b3a30d7f2c0d79800f65ac08716634f118c81ede7e816ef567048e4361aafac476 WHIRLPOOL ed265b1a9e697c08e802f0a17c0de482e5f1f292aecf8ab42cd7cf7177a605b0337ff6ab81b72950fc38687d31c47f9c01ff68cd0a8f10952a59b69a590e19ca
+DIST autofs-5.1.1.tar.xz 290300 SHA256 e08ff0ef9ff365d87b6c33dca136d20e4e07675197a324f2816894cb437021c3 SHA512 37c0f10ee06bbfc76059ff9ae54d9b462f1c2bc39e8779e96dd5bfc2b07055606c0710f1c3de95e6f099edd2c5bb5a6f8a341be989d7554bf80011bfbe90c905 WHIRLPOOL 063e7bcabb3e93a17e8e7da75e6b42af59769e794e3b31240762a4617cc2ac626b4b4985a38455bdca56753fb897fed1a3173c633f1f9a594e79f891dc41f523
diff --git a/net-fs/autofs/autofs-5.0.10.ebuild b/net-fs/autofs/autofs-5.0.10.ebuild
new file mode 100644
index 00000000000..ea11c95900c
--- /dev/null
+++ b/net-fs/autofs/autofs-5.0.10.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+SRC_URI="
+ mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
+ ${PATCHSET_URI}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-force-shutdown
+ --enable-ignore-busy
+ --with-systemd="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile DONTSTRIP=1
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.0.7-r4.ebuild b/net-fs/autofs/autofs-5.0.7-r4.ebuild
new file mode 100644
index 00000000000..b4e18b00eba
--- /dev/null
+++ b/net-fs/autofs/autofs-5.0.7-r4.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=3
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+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="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+PATCHES=(
+ # Fix for bug #210762
+ # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/4203
+ "${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
+ "${FILESDIR}"/${PN}-5.0.7-respect-user-flags-and-fix-asneeded-r3.patch
+
+ # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5371
+ "${FILESDIR}"/${PN}-5.0.5-fix-install-deadlink.patch
+
+ "${FILESDIR}"/${P}-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch #361899, #468606
+ "${FILESDIR}"/${PN}-5.0.6-revert-ldap.patch #381315
+ "${FILESDIR}"/${PN}-5.0.7-sasl-def.patch #469324
+ "${FILESDIR}"/${PN}-5.0.7-libtirpc-link.patch #464120
+ "${FILESDIR}"/${PN}-5.0.7-parallel-make.patch
+ )
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-forced-shutdown
+ --enable-ignore-busy
+ --with-systemd
+ systemddir="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.0.7-r5.ebuild b/net-fs/autofs/autofs-5.0.7-r5.ebuild
new file mode 100644
index 00000000000..db45af8b27a
--- /dev/null
+++ b/net-fs/autofs/autofs-5.0.7-r5.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=3
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+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="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+PATCHES=(
+ # Fix for bug #210762
+ # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/4203
+ "${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
+ "${FILESDIR}"/${PN}-5.0.7-respect-user-flags-and-fix-asneeded-r3.patch
+
+ # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5371
+ "${FILESDIR}"/${PN}-5.0.5-fix-install-deadlink.patch
+
+ "${FILESDIR}"/${P}-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch #361899, #468606
+ "${FILESDIR}"/${PN}-5.0.6-revert-ldap.patch #381315
+ "${FILESDIR}"/${PN}-5.0.7-sasl-def.patch #469324
+ "${FILESDIR}"/${PN}-5.0.7-libtirpc-link.patch #464120
+ "${FILESDIR}"/${PN}-5.0.7-parallel-make.patch
+ "${FILESDIR}"/${PN}-5.0.7-sloppy-mount.patch #545258
+ )
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-forced-shutdown
+ --enable-ignore-busy
+ --with-systemd
+ systemddir="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.0.8-r1.ebuild b/net-fs/autofs/autofs-5.0.8-r1.ebuild
new file mode 100644
index 00000000000..d10115b590b
--- /dev/null
+++ b/net-fs/autofs/autofs-5.0.8-r1.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+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="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+ epatch "${FILESDIR}"/${P}-ldap-wo-sasl.patch
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-force-shutdown
+ --enable-ignore-busy
+ --with-systemd
+ systemddir="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile DONTSTRIP=1
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.0.8-r2.ebuild b/net-fs/autofs/autofs-5.0.8-r2.ebuild
new file mode 100644
index 00000000000..c4503e7d73d
--- /dev/null
+++ b/net-fs/autofs/autofs-5.0.8-r2.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+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="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.0.7-sloppy-mount.patch #545258
+)
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+ epatch "${FILESDIR}"/${P}-ldap-wo-sasl.patch
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-force-shutdown
+ --enable-ignore-busy
+ --with-systemd
+ systemddir="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile DONTSTRIP=1
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.0.9-r1.ebuild b/net-fs/autofs/autofs-5.0.9-r1.ebuild
new file mode 100644
index 00000000000..674d2069012
--- /dev/null
+++ b/net-fs/autofs/autofs-5.0.9-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+SRC_URI="
+ mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
+ ${PATCHSET_URI}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.0.7-sloppy-mount.patch #545258
+)
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-force-shutdown
+ --enable-ignore-busy
+ --with-systemd="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile DONTSTRIP=1
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.0.9.ebuild b/net-fs/autofs/autofs-5.0.9.ebuild
new file mode 100644
index 00000000000..673f4bd06f8
--- /dev/null
+++ b/net-fs/autofs/autofs-5.0.9.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+SRC_URI="
+ mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
+ ${PATCHSET_URI}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-force-shutdown
+ --enable-ignore-busy
+ --with-systemd="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile DONTSTRIP=1
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.1.0-r1.ebuild b/net-fs/autofs/autofs-5.1.0-r1.ebuild
new file mode 100644
index 00000000000..5295885cc94
--- /dev/null
+++ b/net-fs/autofs/autofs-5.1.0-r1.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+SRC_URI="
+ mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
+ ${PATCHSET_URI}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-missing-stdarg.patch"
+ "${FILESDIR}"/${PN}-5.0.7-sloppy-mount.patch #545258
+)
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-force-shutdown
+ --enable-ignore-busy
+ --with-systemd="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile DONTSTRIP=1
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.1.0.ebuild b/net-fs/autofs/autofs-5.1.0.ebuild
new file mode 100644
index 00000000000..df24123bb88
--- /dev/null
+++ b/net-fs/autofs/autofs-5.1.0.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+SRC_URI="
+ mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
+ ${PATCHSET_URI}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-missing-stdarg.patch"
+)
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-force-shutdown
+ --enable-ignore-busy
+ --with-systemd="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile DONTSTRIP=1
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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/autofs-5.1.1.ebuild b/net-fs/autofs/autofs-5.1.1.ebuild
new file mode 100644
index 00000000000..ea11c95900c
--- /dev/null
+++ b/net-fs/autofs/autofs-5.1.1.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=true
+
+inherit autotools-utils linux-info multilib systemd toolchain-funcs
+
+PATCH_VER=
+[[ -n ${PATCH_VER} ]] && \
+ PATCHSET_URI="http://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
+
+DESCRIPTION="Kernel based automounter"
+HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
+SRC_URI="
+ mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
+ ${PATCHSET_URI}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="-dmalloc hesiod ldap libtirpc mount-locking 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=">=sys-apps/util-linux-2.20
+ dmalloc? ( dev-libs/dmalloc[threads] )
+ hesiod? ( net-dns/hesiod )
+ ldap? ( >=net-nds/openldap-2.0
+ sasl? (
+ dev-libs/cyrus-sasl
+ dev-libs/libxml2
+ virtual/krb5
+ )
+ )
+ libtirpc? ( net-libs/libtirpc )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ virtual/yacc"
+
+CONFIG_CHECK="~AUTOFS4_FS"
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${PATCH_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patches
+ fi
+
+ sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # bug #483716
+ tc-export AR
+ # --with-confdir is for bug #361481
+ # --with-mapdir is for bug #385113
+ local myeconfargs=(
+ --with-confdir=/etc/conf.d
+ --with-mapdir=/etc/autofs
+ $(use_with dmalloc)
+ $(use_with ldap openldap)
+ $(use_with libtirpc)
+ $(use_with sasl)
+ $(use_with hesiod)
+ $(use_enable mount-locking)
+ --disable-ext-env
+ --enable-sloppy-mount # bug #453778
+ --enable-force-shutdown
+ --enable-ignore-busy
+ --with-systemd="$(systemd_get_unitdir)" #bug #479492
+ RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile DONTSTRIP=1
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if kernel_is -lt 2 6 30; then
+ # kernel patches
+ docinto patches
+ dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
+ fi
+ 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 00000000000..707364df2f9
--- /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-fix-install-deadlink.patch b/net-fs/autofs/files/autofs-5.0.5-fix-install-deadlink.patch
new file mode 100644
index 00000000000..8ab10fcf747
--- /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-revert-ldap.patch b/net-fs/autofs/files/autofs-5.0.6-revert-ldap.patch
new file mode 100644
index 00000000000..49901ddfc69
--- /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/autofs-5.0.7-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch b/net-fs/autofs/files/autofs-5.0.7-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch
new file mode 100644
index 00000000000..366b1eaaba3
--- /dev/null
+++ b/net-fs/autofs/files/autofs-5.0.7-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch
@@ -0,0 +1,45 @@
+--- ./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;
+ modules/lookup_ldap.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
+index dbec753..ce1e2e5 100644
+--- a/modules/lookup_ldap.c
++++ b/modules/lookup_ldap.c
+@@ -28,7 +28,9 @@
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ #include <lber.h>
++#ifdef HAVE_SASL
+ #include <libxml/tree.h>
++#endif
+
+ #define MODULE_LOOKUP
+ #include "automount.h"
diff --git a/net-fs/autofs/files/autofs-5.0.7-libtirpc-link.patch b/net-fs/autofs/files/autofs-5.0.7-libtirpc-link.patch
new file mode 100644
index 00000000000..92143f1d306
--- /dev/null
+++ b/net-fs/autofs/files/autofs-5.0.7-libtirpc-link.patch
@@ -0,0 +1,10 @@
+diff --git a/modules/Makefile b/modules/Makefile
+index 4ecbd6a..6a17540 100644
+--- a/modules/Makefile
++++ b/modules/Makefile
+@@ -114,4 +114,4 @@ lookup_ldap.so: lookup_ldap.c dclist.o base64.o $(SASL_OBJ)
+
+ mount_nfs.so: mount_nfs.c replicated.o
+ $(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) -o mount_nfs.so \
+- mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL)
++ mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL) $(TIRPCLIB)
diff --git a/net-fs/autofs/files/autofs-5.0.7-parallel-make.patch b/net-fs/autofs/files/autofs-5.0.7-parallel-make.patch
new file mode 100644
index 00000000000..f510f8fa201
--- /dev/null
+++ b/net-fs/autofs/files/autofs-5.0.7-parallel-make.patch
@@ -0,0 +1,48 @@
+From ed85b855e1bcdb814b3dca7f6c768b86e6353fe7 Mon Sep 17 00:00:00 2001
+From: "Lan Yixun (dlan)" <dennis.yxun@gmail.com>
+Date: Thu, 25 Jul 2013 10:04:23 +0800
+Subject: [PATCH] fix occasional build error when enable parallel compiling
+
+the problem here we pass "-jX" ( X> 1) to "make", and "rpc_subs.c"
+occasionally fail to compile due to it can't find "mount.h",
+the root cause it that "mount.h" haven't generated by that time,
+add this patch should fix this problem.
+to make rpc_subs.o explicitly depend on "mount.h".
+
+---
+error message:
+
+x86_64-pc-linux-gnu-gcc -O2 -pipe -march=core2 -D_REENTRANT
+-D_FILE_OFFSET_BITS=64 -I/usr/include/tirp c -D_REENTRANT
+-D_FILE_OFFSET_BITS=64 -I/usr/include/tirpc -I../include -fPIC
+-D_GNU_SOURCE -DAUTOFS_MA P_DIR=\"/etc/autofs\"
+-DAUTOFS_CONF_DIR=\"/etc/conf.d\" -c rpc_subs.c
+rpc_subs.c:46:19: fatal error: mount.h: No such file or directory
+ #include "mount.h"
+ ^
+compilation terminated.
+make[1]: *** [rpc_subs.o] Error 1
+make[1]: *** Waiting for unfinished
+jobs....
+
+Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
+---
+ lib/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 5418009..314779b 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -70,6 +70,8 @@ nss_tok.o: nss_tok.c nss_parse.tab.h
+
+ nss_parse.tab.o: nss_parse.tab.c nss_parse.tab.h
+
++rpc_subs.o: mount.h
++
+ install: all
+
+ clean:
+--
+1.8.3.2
+
diff --git a/net-fs/autofs/files/autofs-5.0.7-respect-user-flags-and-fix-asneeded-r3.patch b/net-fs/autofs/files/autofs-5.0.7-respect-user-flags-and-fix-asneeded-r3.patch
new file mode 100644
index 00000000000..c12d4bbe2b1
--- /dev/null
+++ b/net-fs/autofs/files/autofs-5.0.7-respect-user-flags-and-fix-asneeded-r3.patch
@@ -0,0 +1,144 @@
+--- 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
+@@ -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.7-sasl-def.patch b/net-fs/autofs/files/autofs-5.0.7-sasl-def.patch
new file mode 100644
index 00000000000..a12d3798bdf
--- /dev/null
+++ b/net-fs/autofs/files/autofs-5.0.7-sasl-def.patch
@@ -0,0 +1,43 @@
+diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
+index ce1e2e5..35a2106 100644
+--- a/modules/lookup_ldap.c
++++ b/modules/lookup_ldap.c
+@@ -28,9 +28,6 @@
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ #include <lber.h>
+-#ifdef HAVE_SASL
+-#include <libxml/tree.h>
+-#endif
+
+ #define MODULE_LOOKUP
+ #include "automount.h"
+@@ -38,6 +35,10 @@
+ #include "lookup_ldap.h"
+ #include "base64.h"
+
++#ifdef WITH_SASL
++#include <libxml/tree.h>
++#endif
++
+ #define MAPFMT_DEFAULT "sun"
+
+ #define MODPREFIX "lookup(ldap): "
+@@ -587,7 +588,7 @@ static LDAP *do_connect(unsigned logopt, const char *uri, struct lookup_context
+ {
+ LDAP *ldap;
+
+-#ifdef HAVE_SASL
++#ifdef WITH_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);
+@@ -1389,7 +1390,7 @@ static void free_context(struct lookup_context *ctxt)
+ defaults_free_searchdns(ctxt->sdns);
+ if (ctxt->dclist)
+ free_dclist(ctxt->dclist);
+-#ifdef HAVE_SASL
++#ifdef WITH_SASL
+ if (ctxt->extern_cert)
+ free(ctxt->extern_cert);
+ if (ctxt->extern_key)
diff --git a/net-fs/autofs/files/autofs-5.0.7-sloppy-mount.patch b/net-fs/autofs/files/autofs-5.0.7-sloppy-mount.patch
new file mode 100644
index 00000000000..86e02bce555
--- /dev/null
+++ b/net-fs/autofs/files/autofs-5.0.7-sloppy-mount.patch
@@ -0,0 +1,99 @@
+From: Ian Kent <ikent@redhat.com>
+
+Historically autofs added an option to mounts, called the sloppy
+option, meant to allow mount(8) to ignore invalid mount options.
+This was done so that mount map entries for sites that needed to
+use different mount options for some machines would still work.
+It was needed for nfs mounts in particular.
+
+Recent changes to mount(8) cause the sloppy option to be passed on
+for all mounts when it is given.
+
+Previously mount(8) only passed on the option to nfs mounts so now,
+for other than nfs mounts, the mount will fail if the file system
+doesn't understand the sloppy option.
+
+Since the option was not passed on to other than nfs mounts before
+it seems sensible for autofs to not add it for other than nfs mounts
+now.
+
+Signed-off-by: Ian Kent <ikent@redhat.com>
+---
+ modules/mount_bind.c | 9 ++++-----
+ modules/mount_changer.c | 6 +++---
+ modules/mount_ext2.c | 6 +++---
+ modules/mount_generic.c | 4 ++--
+ 4 files changed, 12 insertions(+), 13 deletions(-)
+
+--- a/modules/mount_bind.c
++++ b/modules/mount_bind.c
+@@ -158,13 +158,12 @@ int mount_mount(struct autofs_point *ap,
+ if (!status)
+ existed = 0;
+
+- debug(ap->logopt,
+- MODPREFIX
+- "calling mount --bind " SLOPPY " -o %s %s %s",
++ debug(ap->logopt, MODPREFIX
++ "calling mount --bind -o %s %s %s",
+ options, what, fullpath);
+
+- err = spawn_bind_mount(ap->logopt,
+- SLOPPYOPT "-o", options, what, fullpath, NULL);
++ err = spawn_bind_mount(ap->logopt, "-o",
++ options, what, fullpath, NULL);
+
+ if (err) {
+ if (ap->type != LKP_INDIRECT)
+--- a/modules/mount_changer.c
++++ b/modules/mount_changer.c
+@@ -103,12 +103,12 @@ int mount_mount(struct autofs_point *ap,
+ }
+
+ if (options && options[0]) {
+- debug(ap->logopt,
+- MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
++ debug(ap->logopt, MODPREFIX
++ "calling mount -t %s -o %s %s %s",
+ fstype, options, what, fullpath);
+
+ err = spawn_mount(ap->logopt, "-t", fstype,
+- SLOPPYOPT "-o", options, what, fullpath, NULL);
++ "-o", options, what, fullpath, NULL);
+ } else {
+ debug(ap->logopt,
+ MODPREFIX "calling mount -t %s %s %s",
+--- a/modules/mount_ext2.c
++++ b/modules/mount_ext2.c
+@@ -116,11 +116,11 @@ int mount_mount(struct autofs_point *ap,
+ }
+
+ if (options) {
+- debug(ap->logopt,
+- MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
++ debug(ap->logopt, MODPREFIX
++ "calling mount -t %s -o %s %s %s",
+ fstype, options, what, fullpath);
+ err = spawn_mount(ap->logopt, "-t", fstype,
+- SLOPPYOPT "-o", options, what, fullpath, NULL);
++ "-o", options, what, fullpath, NULL);
+ } else {
+ debug(ap->logopt,
+ MODPREFIX "calling mount -t %s %s %s",
+--- a/modules/mount_generic.c
++++ b/modules/mount_generic.c
+@@ -97,11 +97,11 @@ int mount_mount(struct autofs_point *ap,
+
+ if (options && options[0]) {
+ debug(ap->logopt,
+- MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
++ MODPREFIX "calling mount -t %s -o %s %s %s",
+ fstype, options, loc, fullpath);
+
+ err = spawn_mount(ap->logopt, "-t", fstype,
+- SLOPPYOPT "-o", options, loc, fullpath, NULL);
++ "-o", options, loc, fullpath, NULL);
+ } else {
+ debug(ap->logopt, MODPREFIX "calling mount -t %s %s %s",
+ fstype, loc, fullpath);
+
diff --git a/net-fs/autofs/files/autofs-5.0.8-ldap-wo-sasl.patch b/net-fs/autofs/files/autofs-5.0.8-ldap-wo-sasl.patch
new file mode 100644
index 00000000000..a64ed7e8157
--- /dev/null
+++ b/net-fs/autofs/files/autofs-5.0.8-ldap-wo-sasl.patch
@@ -0,0 +1,27 @@
+diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
+index 2ab1e8c..04b1da7 100644
+--- a/modules/lookup_ldap.c
++++ b/modules/lookup_ldap.c
+@@ -846,20 +846,20 @@ int get_property(unsigned logopt, xmlNodePtr node, const char *prop, char **valu
+ return 0;
+ }
+
+-#ifdef WITH_SASL
+ /*
+ * For plain text, login and digest-md5 authentication types, we need
+ * user and password credentials.
+ */
+ int authtype_requires_creds(const char *authtype)
+ {
++#ifdef WITH_SASL
+ if (!strncmp(authtype, "PLAIN", strlen("PLAIN")) ||
+ !strncmp(authtype, "DIGEST-MD5", strlen("DIGEST-MD5")) ||
+ !strncmp(authtype, "LOGIN", strlen("LOGIN")))
+ return 1;
++#endif
+ return 0;
+ }
+-#endif
+
+ /*
+ * Returns:
diff --git a/net-fs/autofs/files/autofs-5.1.0-fix-missing-stdarg.patch b/net-fs/autofs/files/autofs-5.1.0-fix-missing-stdarg.patch
new file mode 100644
index 00000000000..411a6d088dc
--- /dev/null
+++ b/net-fs/autofs/files/autofs-5.1.0-fix-missing-stdarg.patch
@@ -0,0 +1,43 @@
+From b9653c08896fcb08c441177e5918458f09111351 Mon Sep 17 00:00:00 2001
+From: "Yixun Lan (dlan)" <dennis.yxun@gmail.com>
+Date: Sat, 14 Jun 2014 23:16:36 +0800
+Subject: [PATCH] fix undefined va_{start,end} error
+
+https://bugs.gentoo.org/show_bug.cgi?id=513196
+
+---
+
+x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -rdynamic -pie -o automount auto
+mount.o indirect.o direct.o spawn.o module.o mount.o lookup.o state.o flag.o ../
+lib/autofs.a -lpthread -lnsl -ldl
+../lib/autofs.a(defaults.o): In function `message':
+/var/tmp/portage/net-fs/autofs-5.1.0/work/autofs-5.1.0/lib/defaults.c:179: undef
+ined reference to `va_start'
+/var/tmp/portage/net-fs/autofs-5.1.0/work/autofs-5.1.0/lib/defaults.c:186: undefined reference to `va_end'
+collect2: error: ld returned 1 exit status
+Makefile:33: recipe for target 'automount' failed
+make[1]: *** [automount] Error 1
+make[1]: Leaving directory '/var/tmp/portage/net-fs/autofs-5.1.0/work/autofs-5.1.0/daemon'
+Makefile:14: recipe for target 'daemon' failed
+make: *** [daemon] Error 2
+
+Signed-off-by: Yixun Lan (dlan) <dennis.yxun@gmail.com>
+---
+ lib/defaults.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/defaults.c b/lib/defaults.c
+index 2b03ea2..5728e67 100644
+--- a/lib/defaults.c
++++ b/lib/defaults.c
+@@ -16,6 +16,7 @@
+
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <stdarg.h>
+ #include <ctype.h>
+ #include <string.h>
+ #include <sys/utsname.h>
+--
+1.8.5.2
+
diff --git a/net-fs/autofs/files/autofs5-auto.master b/net-fs/autofs/files/autofs5-auto.master
new file mode 100644
index 00000000000..8656474647e
--- /dev/null
+++ b/net-fs/autofs/files/autofs5-auto.master
@@ -0,0 +1,24 @@
+# $Id$
+# 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 00000000000..8152f46c082
--- /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
+# $Id$
+
+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 -s HUP $(cat "${PIDFILE}") 2> /dev/null
+ eend $?
+ fi
+}
diff --git a/net-fs/autofs/metadata.xml b/net-fs/autofs/metadata.xml
new file mode 100644
index 00000000000..c212ce4e2fe
--- /dev/null
+++ b/net-fs/autofs/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-fs</herd>
+ <maintainer>
+ <email>dlan@gentoo.org</email>
+ <name>Yixun Lan</name>
+ </maintainer>
+ <use>
+ <flag name="dmalloc">Enable debugging with the dmalloc library</flag>
+ <flag name="hesiod">Install hesiod module</flag>
+ <flag name="ldap">Install LDAP module</flag>
+ <flag name="libtirpc">Use TiRPC library instead of SunRPC</flag>
+ <flag name="mount-locking">
+ Enable locking to prevent corruption of /etc/mtab in the presence of
+ concurrent auto-mounting. If enabled, recursive auto-mounting (eg. using
+ autofs to bind or loop mount a filesystem which is itself auto-mounted)
+ is not possible.
+ </flag>
+ <flag name="sasl">Enable SASL support in the LDAP module</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-fs/cifs-utils/Manifest b/net-fs/cifs-utils/Manifest
new file mode 100644
index 00000000000..fa5ff8e4536
--- /dev/null
+++ b/net-fs/cifs-utils/Manifest
@@ -0,0 +1,4 @@
+DIST cifs-utils-5.9.tar.bz2 388403 SHA256 ee0d4ae25c54f47362ef4c97cda142224360a2c4a5a8fbf71d87003bf3eaaef2 SHA512 c4d789c6dce2c0927ccc9359147c12151ea9a688bc376c1df21deec66a98669dc4fb6dd8e26d549475d0bbe1e5449ce08fb86e45c765eee7013ec2040c23600e WHIRLPOOL ef4c9b23b2e12a53d936acd19ce10fbe347279ee3c2914a2cbe26d101898bad22606c622ca005af68e0c44605c4137b3633691171387e269caf06542919cec90
+DIST cifs-utils-6.1.tar.bz2 390958 SHA256 381f1e9caccdafdcdb0efa32a4cceb77c1a96b0b58702394e4b86dac4825f3b5 SHA512 6427b74edbf56b865dee38a610c74ac5483cdc13096082cfc1e9d225a048c9b5ee0c7afb30e625a615a0e8e9f3767e33765220e27148e2c2a29d12d4129b01fd WHIRLPOOL a800a02a0729996035a331b460cb28ae5463ddecaf205d88173dc08efd7a2bee577995ebba97b36977858c8435ac3b7ec9c7ce5d193f8b30d0602f9546fed5b1
+DIST cifs-utils-6.3.tar.bz2 392465 SHA256 fff73b2a2547628acba05d324cf096e50f13fa8712f01bf0eb0dbabfe268375b SHA512 d1a16d56852d0b7570c795e04b6cee89a678e18401ec4a48bf734e5c941518c70d2cf82e795ce857c9aad07d9dfee68e96524e5d6e1392283cfee0a8b38e185e WHIRLPOOL e983ce227234cbc3141aac96d41a576b3bfb8a7cd0ea85191287d489b595e22e20bc9115a92b803da49931bcb7ac567cd3133b5729105ce99f6ea39c504535a8
+DIST cifs-utils-6.4.tar.bz2 392809 SHA256 38fc63926af435dae4ebcf4406275580a692d9fb9ee3e32170317cf2ba68e6e3 SHA512 05860ceed1e83b4f4da689d2fc1c1b48fddc0ca53ba52fc6cf26a277d6a884f5780060725c5df1401a665ac35ec5a170262ee62f61095e4a8d76348888182614 WHIRLPOOL 335262eb329860318750fcd081dc2c082f36c75a32e5e596a45b51e73b08be7ee66133c2e4e2bc3089631d3909018abd9c2f36f79d82cd9ea7f6fe2530900f72
diff --git a/net-fs/cifs-utils/cifs-utils-5.9-r1.ebuild b/net-fs/cifs-utils/cifs-utils-5.9-r1.ebuild
new file mode 100644
index 00000000000..008bc47371e
--- /dev/null
+++ b/net-fs/cifs-utils/cifs-utils-5.9-r1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils confutils linux-info
+
+DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
+HOMEPAGE="http://wiki.samba.org/index.php/LinuxCIFS_utils"
+SRC_URI="ftp://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~arm-linux ~x86-linux"
+IUSE="ads +caps caps-ng creds"
+
+DEPEND="!net-fs/mount-cifs
+ !<net-fs/samba-3.6_rc1
+ ads? ( sys-libs/talloc virtual/krb5 sys-apps/keyutils )
+ caps? ( sys-libs/libcap )
+ caps-ng? ( sys-libs/libcap-ng )
+ creds? ( sys-apps/keyutils )"
+RDEPEND="${DEPEND}"
+
+REQUIRED_USE="^^ ( caps caps-ng )"
+
+DOCS="doc/linux-cifs-client-guide.odt"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ confutils_use_conflict caps caps-ng
+ if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
+ ewarn "You must enable CIFS support in your kernel config, "
+ ewarn "to be able to mount samba shares. You can find it at"
+ ewarn
+ ewarn " File systems"
+ ewarn " Network File Systems"
+ ewarn " CIFS support"
+ ewarn
+ ewarn "and recompile your kernel ..."
+ fi
+}
+
+src_prepare() {
+ # bug #459040
+ epatch "${FILESDIR}"/${P}-set-parsed_info-got_user-when-a-cred-file.patch
+}
+
+src_configure() {
+ ROOTSBINDIR="${EPREFIX}"/sbin \
+ econf \
+ $(use_enable ads cifsupcall) \
+ $(use_with caps libcap) \
+ $(use_with caps-ng libcap-ng) \
+ $(use_enable creds cifscreds) \
+ --with-libcap-ng=$(use caps-ng && echo 'yes' || echo 'no') \
+ --disable-cifsidmap \
+ --disable-cifsacl
+}
+
+src_install() {
+ default
+
+ # remove empty directories
+ find "${ED}" -type d -print0 | xargs --null rmdir \
+ --ignore-fail-on-non-empty &>/dev/null
+}
+
+pkg_postinst() {
+ # Inform about set-user-ID bit of mount.cifs
+ ewarn "setuid use flag was dropped due to multiple security implications"
+ ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
+ ewarn "You are free to set setuid flags by yourself"
+
+ # Inform about upcall usage
+ if use ads ; then
+ ewarn "Using mount.cifs in combination with keyutils"
+ ewarn "in order to mount DFS shares, you need to add"
+ ewarn "the following line to /etc/request-key.conf:"
+ ewarn " create dns_resolver * * /usr/sbin/cifs.upcall %k"
+ ewarn "Otherwise, your DFS shares will not work properly."
+ fi
+}
diff --git a/net-fs/cifs-utils/cifs-utils-6.1-r1.ebuild b/net-fs/cifs-utils/cifs-utils-6.1-r1.ebuild
new file mode 100644
index 00000000000..c51ede49d29
--- /dev/null
+++ b/net-fs/cifs-utils/cifs-utils-6.1-r1.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-info multilib
+
+DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
+HOMEPAGE="http://wiki.samba.org/index.php/LinuxCIFS_utils"
+SRC_URI="ftp://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~arm-linux ~x86-linux"
+IUSE="+acl +ads +caps +caps-ng creds"
+
+DEPEND="!net-fs/mount-cifs
+ !<net-fs/samba-3.6_rc1
+ ads? (
+ sys-apps/keyutils
+ sys-libs/talloc
+ virtual/krb5
+ )
+ caps? ( !caps-ng? ( sys-libs/libcap ) )
+ caps? ( caps-ng? ( sys-libs/libcap-ng ) )
+ creds? ( sys-apps/keyutils )"
+PDEPEND="${DEPEND}
+ acl? ( || (
+ =net-fs/samba-3.6*[winbind]
+ >=net-fs/samba-4.0.0_alpha1
+ ) )
+"
+
+REQUIRED_USE="acl? ( ads )"
+
+DOCS="doc/linux-cifs-client-guide.odt"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
+ ewarn "You must enable CIFS support in your kernel config, "
+ ewarn "to be able to mount samba shares. You can find it at"
+ ewarn
+ ewarn " File systems"
+ ewarn " Network File Systems"
+ ewarn " CIFS support"
+ ewarn
+ ewarn "and recompile your kernel ..."
+ fi
+}
+
+src_prepare() {
+ # Do not rely on hardcoded path to systemd-ask-password, bug #478538
+ epatch "${FILESDIR}/${P}-hardcoded-path.patch"
+}
+
+src_configure() {
+ ROOTSBINDIR="${EPREFIX}"/sbin \
+ econf \
+ $(use_enable acl cifsacl cifsidmap) \
+ $(use_enable ads cifsupcall) \
+ $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
+ $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
+ $(use_enable creds cifscreds)
+}
+
+src_install() {
+ default
+
+ # remove empty directories
+ find "${ED}" -type d -print0 | xargs --null rmdir \
+ --ignore-fail-on-non-empty &>/dev/null
+
+ if use acl ; then
+ dodir /etc/cifs-utils
+ dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
+ /etc/cifs-utils/idmap-plugin
+ dodir /etc/request-key.d
+ echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
+ > "${ED}/etc/request-key.d/cifs.idmap.conf"
+ fi
+
+ if use ads ; then
+ dodir /etc/request-key.d
+ echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
+ > "${ED}/etc/request-key.d/cifs.upcall.conf"
+ fi
+}
+
+pkg_postinst() {
+ # Inform about set-user-ID bit of mount.cifs
+ ewarn "setuid use flag was dropped due to multiple security implications"
+ ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
+ ewarn "You are free to set setuid flags by yourself"
+
+ # Inform about upcall usage
+ if use acl ; then
+ einfo "The cifs.idmap utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
+ einfo "This enables you to get and set CIFS acls."
+ fi
+
+ if use ads ; then
+ einfo "The cifs.upcall utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
+ einfo "This enables you to mount DFS shares."
+ fi
+}
diff --git a/net-fs/cifs-utils/cifs-utils-6.3.ebuild b/net-fs/cifs-utils/cifs-utils-6.3.ebuild
new file mode 100644
index 00000000000..4b81eb6deba
--- /dev/null
+++ b/net-fs/cifs-utils/cifs-utils-6.3.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-info multilib
+
+DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
+HOMEPAGE="http://wiki.samba.org/index.php/LinuxCIFS_utils"
+SRC_URI="ftp://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
+IUSE="+acl +ads +caps +caps-ng creds"
+
+DEPEND="!net-fs/mount-cifs
+ !<net-fs/samba-3.6_rc1
+ ads? (
+ sys-apps/keyutils
+ sys-libs/talloc
+ virtual/krb5
+ )
+ caps? ( !caps-ng? ( sys-libs/libcap ) )
+ caps? ( caps-ng? ( sys-libs/libcap-ng ) )
+ creds? ( sys-apps/keyutils )"
+PDEPEND="${DEPEND}
+ acl? ( || (
+ =net-fs/samba-3.6*[winbind]
+ >=net-fs/samba-4.0.0_alpha1
+ ) )
+"
+
+REQUIRED_USE="acl? ( ads )"
+
+DOCS="doc/linux-cifs-client-guide.odt"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
+ ewarn "You must enable CIFS support in your kernel config, "
+ ewarn "to be able to mount samba shares. You can find it at"
+ ewarn
+ ewarn " File systems"
+ ewarn " Network File Systems"
+ ewarn " CIFS support"
+ ewarn
+ ewarn "and recompile your kernel ..."
+ fi
+}
+
+src_configure() {
+ ROOTSBINDIR="${EPREFIX}"/sbin \
+ econf \
+ $(use_enable acl cifsacl cifsidmap) \
+ $(use_enable ads cifsupcall) \
+ $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
+ $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
+ $(use_enable creds cifscreds)
+}
+
+src_install() {
+ default
+
+ # remove empty directories
+ find "${ED}" -type d -print0 | xargs --null rmdir \
+ --ignore-fail-on-non-empty &>/dev/null
+
+ if use acl ; then
+ dodir /etc/cifs-utils
+ dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
+ /etc/cifs-utils/idmap-plugin
+ dodir /etc/request-key.d
+ echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
+ > "${ED}/etc/request-key.d/cifs.idmap.conf"
+ fi
+
+ if use ads ; then
+ dodir /etc/request-key.d
+ echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
+ > "${ED}/etc/request-key.d/cifs.upcall.conf"
+ fi
+}
+
+pkg_postinst() {
+ # Inform about set-user-ID bit of mount.cifs
+ ewarn "setuid use flag was dropped due to multiple security implications"
+ ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
+ ewarn "You are free to set setuid flags by yourself"
+
+ # Inform about upcall usage
+ if use acl ; then
+ einfo "The cifs.idmap utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
+ einfo "This enables you to get and set CIFS acls."
+ fi
+
+ if use ads ; then
+ einfo "The cifs.upcall utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
+ einfo "This enables you to mount DFS shares."
+ fi
+}
diff --git a/net-fs/cifs-utils/cifs-utils-6.4.ebuild b/net-fs/cifs-utils/cifs-utils-6.4.ebuild
new file mode 100644
index 00000000000..fba0a5e58d6
--- /dev/null
+++ b/net-fs/cifs-utils/cifs-utils-6.4.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-info multilib
+
+DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
+HOMEPAGE="http://wiki.samba.org/index.php/LinuxCIFS_utils"
+SRC_URI="ftp://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
+IUSE="+acl +ads +caps +caps-ng creds"
+
+DEPEND="!net-fs/mount-cifs
+ !<net-fs/samba-3.6_rc1
+ ads? (
+ sys-apps/keyutils
+ sys-libs/talloc
+ virtual/krb5
+ )
+ caps? ( !caps-ng? ( sys-libs/libcap ) )
+ caps? ( caps-ng? ( sys-libs/libcap-ng ) )
+ creds? ( sys-apps/keyutils )"
+PDEPEND="${DEPEND}
+ acl? ( || (
+ =net-fs/samba-3.6*[winbind]
+ >=net-fs/samba-4.0.0_alpha1
+ ) )
+"
+
+REQUIRED_USE="acl? ( ads )"
+
+DOCS="doc/linux-cifs-client-guide.odt"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
+ ewarn "You must enable CIFS support in your kernel config, "
+ ewarn "to be able to mount samba shares. You can find it at"
+ ewarn
+ ewarn " File systems"
+ ewarn " Network File Systems"
+ ewarn " CIFS support"
+ ewarn
+ ewarn "and recompile your kernel ..."
+ fi
+}
+
+src_configure() {
+ ROOTSBINDIR="${EPREFIX}"/sbin \
+ econf \
+ $(use_enable acl cifsacl cifsidmap) \
+ $(use_enable ads cifsupcall) \
+ $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
+ $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
+ $(use_enable creds cifscreds)
+}
+
+src_install() {
+ default
+
+ # remove empty directories
+ find "${ED}" -type d -print0 | xargs --null rmdir \
+ --ignore-fail-on-non-empty &>/dev/null
+
+ if use acl ; then
+ dodir /etc/cifs-utils
+ dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
+ /etc/cifs-utils/idmap-plugin
+ dodir /etc/request-key.d
+ echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
+ > "${ED}/etc/request-key.d/cifs.idmap.conf"
+ fi
+
+ if use ads ; then
+ dodir /etc/request-key.d
+ echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
+ > "${ED}/etc/request-key.d/cifs.upcall.conf"
+ fi
+}
+
+pkg_postinst() {
+ # Inform about set-user-ID bit of mount.cifs
+ ewarn "setuid use flag was dropped due to multiple security implications"
+ ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
+ ewarn "You are free to set setuid flags by yourself"
+
+ # Inform about upcall usage
+ if use acl ; then
+ einfo "The cifs.idmap utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
+ einfo "This enables you to get and set CIFS acls."
+ fi
+
+ if use ads ; then
+ einfo "The cifs.upcall utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
+ einfo "This enables you to mount DFS shares."
+ fi
+}
diff --git a/net-fs/cifs-utils/files/cifs-utils-5.5-initialize_rc_var_properly.patch b/net-fs/cifs-utils/files/cifs-utils-5.5-initialize_rc_var_properly.patch
new file mode 100644
index 00000000000..2faa853e0a5
--- /dev/null
+++ b/net-fs/cifs-utils/files/cifs-utils-5.5-initialize_rc_var_properly.patch
@@ -0,0 +1,38 @@
+From 0eb3daa4b17ee64b464594f1a5d413ecb364957c Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@samba.org>
+Date: Thu, 14 Jun 2012 10:59:18 -0400
+Subject: [PATCH 1/1] mount.cifs: set rc to 0 in libcap toggle_dac_capability
+
+Thus spake Jochen:
+
+The mount.cifs program from the cifs-utils package 5.5 did not work on
+my Linux system. It just exited without an error message and did not
+mount anything.
+
+[...]
+
+I think, when this variable rc is now used in this function, it has also
+to be properly initialized there.
+
+Reported-by: Jochen Roderburg <roderburg@uni-koeln.de>
+Signed-off-by: Jeff Layton <jlayton@samba.org>
+---
+ mount.cifs.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/mount.cifs.c b/mount.cifs.c
+index a1b0454..6f3f382 100644
+--- a/mount.cifs.c
++++ b/mount.cifs.c
+@@ -495,7 +495,7 @@ free_caps:
+ static int
+ toggle_dac_capability(int writable, int enable)
+ {
+- int rc;
++ int rc = 0;
+ cap_t caps;
+ cap_value_t capability = writable ? CAP_DAC_OVERRIDE : CAP_DAC_READ_SEARCH;
+
+--
+1.7.0.4
+
diff --git a/net-fs/cifs-utils/files/cifs-utils-5.9-set-parsed_info-got_user-when-a-cred-file.patch b/net-fs/cifs-utils/files/cifs-utils-5.9-set-parsed_info-got_user-when-a-cred-file.patch
new file mode 100644
index 00000000000..d06ae015d03
--- /dev/null
+++ b/net-fs/cifs-utils/files/cifs-utils-5.9-set-parsed_info-got_user-when-a-cred-file.patch
@@ -0,0 +1,31 @@
+From: Jeff Layton <jlayton@samba.org>
+Date: Sun, 13 Jan 2013 03:02:01 +0000 (-0500)
+Subject: mount.cifs: set parsed_info->got_user when a cred file supplies a username
+X-Git-Url: https://gitweb.samba.org/?p=cifs-utils.git;a=commitdiff_plain;h=1a01f7c4b90695211d12291d7a24bec05b1f2922
+
+mount.cifs: set parsed_info->got_user when a cred file supplies a username
+
+commit 85d18a1ed introduced a regression when using a credentials file.
+It set the username in the parsed mount info properly, but didn't set
+the "got_user" flag in it.
+
+Also, fix an incorrect strlcpy length specifier in open_cred_file.
+
+Reported-by: "Mantas M." <grawity@gmail.com>
+Signed-off-by: Jeff Layton <jlayton@samba.org>
+---
+
+diff --git a/mount.cifs.c b/mount.cifs.c
+index c7c3055..40b77e9 100644
+--- a/mount.cifs.c
++++ b/mount.cifs.c
+@@ -581,7 +581,8 @@ static int open_cred_file(char *file_name,
+ switch (parse_cred_line(line_buf + i, &temp_val)) {
+ case CRED_USER:
+ strlcpy(parsed_info->username, temp_val,
+- sizeof(parsed_info->domain));
++ sizeof(parsed_info->username));
++ parsed_info->got_user = 1;
+ break;
+ case CRED_PASS:
+ i = set_password(parsed_info, temp_val);
diff --git a/net-fs/cifs-utils/files/cifs-utils-6.1-hardcoded-path.patch b/net-fs/cifs-utils/files/cifs-utils-6.1-hardcoded-path.patch
new file mode 100644
index 00000000000..c2e2ea21d81
--- /dev/null
+++ b/net-fs/cifs-utils/files/cifs-utils-6.1-hardcoded-path.patch
@@ -0,0 +1,44 @@
+From 4e315f6a02a4edb259b33bcf0665eba259fee2f2 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 30 Jul 2013 10:00:26 +0200
+Subject: [PATCH] Do not rely on hardcoded path to systemd-ask-password.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Relying on hardcoded /bin/systemd-ask-password path breaks systemd that
+install systemd-ask-password in /usr/bin. Since both paths are supposed
+to be in ${PATH} and popen() passes the command to shell, just pass
+'systemd-ask-password' and let the shell find it.
+
+Fixes: https://bugzilla.samba.org/show_bug.cgi?id=10054
+Signed-off-by: Michał Górny <mgorny@gentoo.org>
+---
+ mount.cifs.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mount.cifs.c b/mount.cifs.c
+index e76beee..7206dcb 100644
+--- a/mount.cifs.c
++++ b/mount.cifs.c
+@@ -1626,7 +1626,7 @@ drop_child_privs(void)
+ }
+
+ /*
+- * If systemd is running and /bin/systemd-ask-password --
++ * If systemd is running and systemd-ask-password --
+ * is available, then use that else fallback on getpass(..)
+ *
+ * Returns: @input or NULL on error
+@@ -1649,7 +1649,7 @@ get_password(const char *prompt, char *input, int capacity)
+ FILE *ask_pass_fp = NULL;
+
+ cmd = ret = NULL;
+- if (asprintf(&cmd, "/bin/systemd-ask-password \"%s\"", prompt) >= 0) {
++ if (asprintf(&cmd, "systemd-ask-password \"%s\"", prompt) >= 0) {
+ ask_pass_fp = popen (cmd, "re");
+ free (cmd);
+ }
+--
+1.7.0.4
+
diff --git a/net-fs/cifs-utils/metadata.xml b/net-fs/cifs-utils/metadata.xml
new file mode 100644
index 00000000000..a31a339fc79
--- /dev/null
+++ b/net-fs/cifs-utils/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>samba</herd>
+ <maintainer>
+ <email>samba@gentoo.org</email>
+ <name>Samba Team</name>
+ </maintainer>
+ <longdescription>The in-kernel CIFS filesystem relies on a set of user-space tools. That package of tools is called cifs-utils. Although not really part of Samba proper, these tools were originally part of the Samba package. For several reasons, shipping these tools as part of Samba was problematic and it was deemed better to split them off into their own package</longdescription>
+ <use>
+ <flag name="ads">Enable Active Directory support and create cifs.idmap binary - idmap support</flag>
+ <flag name="caps">libcap support</flag>
+ <flag name="caps-ng">libcap-ng support</flag>
+ <flag name="creds">cifs credentials support</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-fs/curlftpfs/Manifest b/net-fs/curlftpfs/Manifest
new file mode 100644
index 00000000000..4efaa8a852f
--- /dev/null
+++ b/net-fs/curlftpfs/Manifest
@@ -0,0 +1 @@
+DIST curlftpfs-0.9.2.tar.gz 365503 SHA256 4eb44739c7078ba0edde177bdd266c4cfb7c621075f47f64c85a06b12b3c6958 SHA512 df07c418d175f766c89525017fc56e79726061eee0c3a6607ded0e1bf24f64f1475ba0e546157b65892194e3c4414c120822bf8fb175437e68366f82de216067 WHIRLPOOL c14686eeadafe2f26f9c79fd44ab0d66403e79ec724d5eae28a8b3838ac676755edc1d86583c4de73486fc0dc5d49eabb2b57f7cb477edaccfab33b2aa9f0931
diff --git a/net-fs/curlftpfs/curlftpfs-0.9.2-r3.ebuild b/net-fs/curlftpfs/curlftpfs-0.9.2-r3.ebuild
new file mode 100644
index 00000000000..43d4a8357bf
--- /dev/null
+++ b/net-fs/curlftpfs/curlftpfs-0.9.2-r3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools
+
+DESCRIPTION="File system for accessing ftp hosts based on FUSE"
+HOMEPAGE="http://curlftpfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm x86 ~amd64-linux ~x86-linux ~x86-macos"
+IUSE=""
+RESTRICT="test" # bug 258460
+
+RDEPEND=">=net-misc/curl-7.17.0
+ >=sys-fs/fuse-2.2
+ >=dev-libs/glib-2.0"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-64bit_filesize.patch
+ epatch "${FILESDIR}"/${PN}-0.9.2-darwin.patch
+ epatch "${FILESDIR}"/${PN}-0.9.2-memleak.patch
+ epatch "${FILESDIR}"/${PN}-0.9.2-memleak-nocache.patch
+ epatch "${FILESDIR}"/${PN}-0.9.2-fix-escaping.patch
+
+ # automake-1.13.1 obsoletes AM_* bit #469818
+ sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac || die
+
+ epatch_user
+
+ eautoreconf
+}
+
+src_install() {
+ default
+ dodoc README
+}
diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-64bit_filesize.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-64bit_filesize.patch
new file mode 100644
index 00000000000..38b6f33a2ba
--- /dev/null
+++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-64bit_filesize.patch
@@ -0,0 +1,11 @@
+--- ftpfs.c.old 2009-11-28 14:28:05.000000000 +0300
++++ ftpfs.c 2009-11-28 14:28:19.000000000 +0300
+@@ -503,7 +503,7 @@
+
+ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, fh->full_path);
+ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_UPLOAD, 1);
+- curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, -1);
++ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, (curl_off_t)-1);
+ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READFUNCTION, write_data_bg);
+ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READDATA, fh);
+ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_LOW_SPEED_LIMIT, 1);
diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-darwin.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-darwin.patch
new file mode 100644
index 00000000000..c26318209da
--- /dev/null
+++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-darwin.patch
@@ -0,0 +1,17 @@
+http://sourceforge.net/tracker/?func=detail&atid=816359&aid=2799820&group_id=160565
+
+diff -ur configure.ac configure.ac
+--- configure.ac 2008-04-23 15:37:42 +0400
++++ configure.ac 2009-06-02 09:46:05 +0400
+@@ -18,6 +18,11 @@
+ AC_MSG_ERROR(["We need libcurl with support for FTP protocol."])
+ fi
+
++case $host_os in
++ darwin*)
++ CFLAGS="$CFLAGS -D__off_t=off_t"
++ ;;
++esac
+ CFLAGS="$CFLAGS -Wall -W -Wno-sign-compare -D_REENTRANT $GLIB_CFLAGS $FUSE_CFLAGS $LIBCURL_CPPFLAGS"
+ LIBS="$GLIB_LIBS $FUSE_LIBS $LIBCURL"
+
diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-fix-escaping.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-fix-escaping.patch
new file mode 100644
index 00000000000..df15bddd562
--- /dev/null
+++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-fix-escaping.patch
@@ -0,0 +1,420 @@
+fix handling of special symbols in file operations.
+
+Path fixes at least following cases:
+ - attempt to enter directory named '#'
+ - attempt to open file named '#'
+ - attempt to dereference link named '#'
+ - attempt to chown file / dir named '#'
+
+The fix is basically following mechanical conversion:
+--- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, something);
++++ something_uri = path_to_uri(something);
++++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, something_uri);
+=== curl_easy_perform();
++++ free_uri(something_uri);
+
+What is not yet converted is ftp hostname.
+
+Reported-by: Jaakko Perttilä
+Gentoo-bug: http://bugs.gentoo.org/458110
+Based-on-patch: https://github.com/jomat/curlftpfs/commit/da20298fd0d0dcefc7d6d69ffecbc5544e783cfe
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+diff --git a/ftpfs.c b/ftpfs.c
+index ffd0b28..f21a267 100644
+--- a/ftpfs.c
++++ b/ftpfs.c
+@@ -257,6 +257,7 @@ static int ftpfs_getdir(const char* path, fuse_cache_dirh_t h,
+ int err = 0;
+ CURLcode curl_res;
+ char* dir_path = get_fulldir_path(path);
++ char* dir_path_uri = path_to_uri(dir_path);
+
+ DEBUG(1, "ftpfs_getdir: %s\n", dir_path);
+ struct buffer buf;
+@@ -264,7 +265,7 @@ static int ftpfs_getdir(const char* path, fuse_cache_dirh_t h,
+
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf);
+ curl_res = curl_easy_perform(ftpfs.connection);
+ pthread_mutex_unlock(&ftpfs.lock);
+@@ -278,6 +279,7 @@ static int ftpfs_getdir(const char* path, fuse_cache_dirh_t h,
+ NULL, NULL, NULL, 0, h, filler);
+ }
+
++ free_uri(dir_path_uri);
+ free(dir_path);
+ buf_free(&buf);
+ return op_return(err, "ftpfs_getdir");
+@@ -287,6 +289,7 @@ static int ftpfs_getattr(const char* path, struct stat* sbuf) {
+ int err;
+ CURLcode curl_res;
+ char* dir_path = get_dir_path(path);
++ char* dir_path_uri = path_to_uri(dir_path);
+
+ DEBUG(2, "ftpfs_getattr: %s dir_path=%s\n", path, dir_path);
+ struct buffer buf;
+@@ -294,7 +297,7 @@ static int ftpfs_getattr(const char* path, struct stat* sbuf) {
+
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf);
+ curl_res = curl_easy_perform(ftpfs.connection);
+ pthread_mutex_unlock(&ftpfs.lock);
+@@ -309,6 +312,7 @@ static int ftpfs_getattr(const char* path, struct stat* sbuf) {
+ err = parse_dir((char*)buf.p, dir_path + strlen(ftpfs.host) - 1,
+ name, sbuf, NULL, 0, NULL, NULL);
+
++ free_uri(dir_path_uri);
+ free(dir_path);
+ buf_free(&buf);
+ if (err) return op_return(-ENOENT, "ftpfs_getattr");
+@@ -329,6 +333,7 @@ static size_t ftpfs_read_chunk(const char* full_path, char* rbuf,
+ int running_handles = 0;
+ int err = 0;
+ struct ftpfs_file* fh = get_ftpfs_file(fi);
++ char* full_path_uri = path_to_uri(full_path); /* TODO: optimize bu pushing up conversion to context */
+
+ DEBUG(2, "ftpfs_read_chunk: %s %p %zu %lld %p %p\n",
+ full_path, rbuf, size, offset, fi, fh);
+@@ -355,7 +360,7 @@ static size_t ftpfs_read_chunk(const char* full_path, char* rbuf,
+
+ cancel_previous_multi();
+
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &fh->buf);
+ if (offset) {
+ char range[15];
+@@ -444,6 +449,7 @@ static size_t ftpfs_read_chunk(const char* full_path, char* rbuf,
+
+ pthread_mutex_unlock(&ftpfs.lock);
+
++ free_uri(full_path_uri);
+ if (err) return CURLFTPFS_BAD_READ;
+ return size;
+ }
+@@ -497,11 +503,12 @@ int write_thread_ctr = 0;
+ static void *ftpfs_write_thread(void *data) {
+ struct ftpfs_file *fh = data;
+ char range[15];
+-
++ char* full_path_uri = path_to_uri(fh->full_path); /* TODO: optimize bu pushing up conversion to context */
++
+ DEBUG(2, "enter streaming write thread #%d path=%s pos=%lld\n", ++write_thread_ctr, fh->full_path, fh->pos);
+
+
+- curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, fh->full_path);
++ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_UPLOAD, 1);
+ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, (curl_off_t)-1);
+ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READFUNCTION, write_data_bg);
+@@ -541,6 +548,8 @@ static void *ftpfs_write_thread(void *data) {
+
+ sem_post(&fh->data_written); /* ftpfs_write may return */
+
++ free_uri(full_path_uri);
++
+ return NULL;
+ }
+
+@@ -621,16 +630,19 @@ static void free_ftpfs_file(struct ftpfs_file *fh) {
+ }
+
+ static int buffer_file(struct ftpfs_file *fh) {
++ char* full_path_uri = path_to_uri(fh->full_path); /* TODO: optimize bu pushing up conversion to context */
+ // If we want to write to the file, we have to load it all at once,
+ // modify it in memory and then upload it as a whole as most FTP servers
+ // don't support resume for uploads.
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, fh->full_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &fh->buf);
+ CURLcode curl_res = curl_easy_perform(ftpfs.connection);
+ pthread_mutex_unlock(&ftpfs.lock);
+
++ free_uri(full_path_uri);
++
+ if (curl_res != 0) {
+ return -EACCES;
+ }
+@@ -643,10 +655,11 @@ static int create_empty_file(const char * path)
+ int err = 0;
+
+ char *full_path = get_full_path(path);
++ char* full_path_uri = path_to_uri(full_path);
+
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_INFILESIZE, 0);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_UPLOAD, 1);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_READDATA, NULL);
+@@ -656,7 +669,9 @@ static int create_empty_file(const char * path)
+
+ if (curl_res != 0) {
+ err = -EPERM;
+- }
++ }
++
++ free_uri(full_path_uri);
+ free(full_path);
+ return err;
+ }
+@@ -875,6 +890,7 @@ static int ftpfs_chmod(const char* path, mode_t mode) {
+
+ struct curl_slist* header = NULL;
+ char* full_path = get_dir_path(path);
++ char* full_path_uri = path_to_uri(full_path);
+ char* filename = get_file_name(path);
+ char* cmd = g_strdup_printf("SITE CHMOD %.3o %s", mode_c, filename);
+ struct buffer buf;
+@@ -885,7 +901,7 @@ static int ftpfs_chmod(const char* path, mode_t mode) {
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header);
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody);
+ CURLcode curl_res = curl_easy_perform(ftpfs.connection);
+@@ -896,12 +912,13 @@ static int ftpfs_chmod(const char* path, mode_t mode) {
+ if (curl_res != 0) {
+ err = -EPERM;
+ }
+-
++
+ buf_free(&buf);
+ curl_slist_free_all(header);
++ free_uri(full_path_uri);
+ free(full_path);
+ free(filename);
+- free(cmd);
++ free(cmd);
+ return op_return(err, "ftpfs_chmod");
+ }
+
+@@ -912,6 +929,7 @@ static int ftpfs_chown(const char* path, uid_t uid, gid_t gid) {
+
+ struct curl_slist* header = NULL;
+ char* full_path = get_dir_path(path);
++ char* full_path_uri = path_to_uri(full_path);
+ char* filename = get_file_name(path);
+ char* cmd = g_strdup_printf("SITE CHUID %i %s", uid, filename);
+ char* cmd2 = g_strdup_printf("SITE CHGID %i %s", gid, filename);
+@@ -924,7 +942,7 @@ static int ftpfs_chown(const char* path, uid_t uid, gid_t gid) {
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header);
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody);
+ CURLcode curl_res = curl_easy_perform(ftpfs.connection);
+@@ -938,6 +956,7 @@ static int ftpfs_chown(const char* path, uid_t uid, gid_t gid) {
+
+ buf_free(&buf);
+ curl_slist_free_all(header);
++ free_uri(full_path_uri);
+ free(full_path);
+ free(filename);
+ free(cmd);
+@@ -1001,6 +1020,7 @@ static int ftpfs_rmdir(const char* path) {
+ int err = 0;
+ struct curl_slist* header = NULL;
+ char* full_path = get_dir_path(path);
++ char* full_path_uri = path_to_uri(full_path);
+ char* filename = get_file_name(path);
+ char* cmd = g_strdup_printf("RMD %s", filename);
+ struct buffer buf;
+@@ -1014,7 +1034,7 @@ static int ftpfs_rmdir(const char* path) {
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header);
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody);
+ CURLcode curl_res = curl_easy_perform(ftpfs.connection);
+@@ -1028,6 +1048,7 @@ static int ftpfs_rmdir(const char* path) {
+
+ buf_free(&buf);
+ curl_slist_free_all(header);
++ free_uri(full_path_uri);
+ free(full_path);
+ free(filename);
+ free(cmd);
+@@ -1038,6 +1059,7 @@ static int ftpfs_mkdir(const char* path, mode_t mode) {
+ int err = 0;
+ struct curl_slist* header = NULL;
+ char* full_path = get_dir_path(path);
++ char* full_path_uri = path_to_uri(full_path);
+ char* filename = get_file_name(path);
+ char* cmd = g_strdup_printf("MKD %s", filename);
+ struct buffer buf;
+@@ -1048,7 +1070,7 @@ static int ftpfs_mkdir(const char* path, mode_t mode) {
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header);
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody);
+ CURLcode curl_res = curl_easy_perform(ftpfs.connection);
+@@ -1062,6 +1084,7 @@ static int ftpfs_mkdir(const char* path, mode_t mode) {
+
+ buf_free(&buf);
+ curl_slist_free_all(header);
++ free_uri(full_path_uri);
+ free(full_path);
+ free(filename);
+ free(cmd);
+@@ -1076,6 +1099,7 @@ static int ftpfs_unlink(const char* path) {
+ int err = 0;
+ struct curl_slist* header = NULL;
+ char* full_path = get_dir_path(path);
++ char* full_path_uri = path_to_uri(full_path);
+ char* filename = get_file_name(path);
+ char* cmd = g_strdup_printf("DELE %s", filename);
+ struct buffer buf;
+@@ -1086,7 +1110,7 @@ static int ftpfs_unlink(const char* path) {
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header);
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody);
+ CURLcode curl_res = curl_easy_perform(ftpfs.connection);
+@@ -1100,6 +1124,7 @@ static int ftpfs_unlink(const char* path) {
+
+ buf_free(&buf);
+ curl_slist_free_all(header);
++ free_uri(full_path_uri);
+ free(full_path);
+ free(filename);
+ free(cmd);
+@@ -1301,6 +1326,7 @@ static int ftpfs_readlink(const char *path, char *linkbuf, size_t size) {
+ int err;
+ CURLcode curl_res;
+ char* dir_path = get_dir_path(path);
++ char* dir_path_uri = path_to_uri(dir_path);
+
+ DEBUG(2, "dir_path: %s %s\n", path, dir_path);
+ struct buffer buf;
+@@ -1308,7 +1334,7 @@ static int ftpfs_readlink(const char *path, char *linkbuf, size_t size) {
+
+ pthread_mutex_lock(&ftpfs.lock);
+ cancel_previous_multi();
+- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path);
++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path_uri);
+ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf);
+ curl_res = curl_easy_perform(ftpfs.connection);
+ pthread_mutex_unlock(&ftpfs.lock);
+@@ -1323,6 +1349,7 @@ static int ftpfs_readlink(const char *path, char *linkbuf, size_t size) {
+ err = parse_dir((char*)buf.p, dir_path + strlen(ftpfs.host) - 1,
+ name, NULL, linkbuf, size, NULL, NULL);
+
++ free_uri(dir_path_uri);
+ free(dir_path);
+ buf_free(&buf);
+ if (err) return op_return(-ENOENT, "ftpfs_readlink");
+diff --git a/path_utils.c b/path_utils.c
+index db3d7e4..214b5e6 100644
+--- a/path_utils.c
++++ b/path_utils.c
+@@ -92,3 +92,72 @@ char* get_dir_path(const char* path) {
+
+ return ret;
+ }
++
++/*
++ * the chars not needed to be escaped:
++ * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
++ */
++static inline int is_unreserved_rfc3986(char c)
++{
++ int is_locase_alpha = (c >= 'a' && c <= 'z');
++ int is_upcase_alpha = (c >= 'a' && c <= 'z');
++ int is_digit = (c >= '0' && c <= '9');
++ int is_special = c == '-'
++ || c == '.'
++ || c == '_'
++ || c == '~';
++ int is_unreserved = is_locase_alpha
++ || is_upcase_alpha
++ || is_digit
++ || is_special;
++
++ return is_unreserved;
++}
++
++static inline int is_unreserved(char c)
++{
++ return is_unreserved_rfc3986(c) || c == '/';
++}
++
++char* path_to_uri(const char* path)
++{
++ static const char hex[] = "0123456789ABCDEF";
++ size_t path_len = strlen(path);
++ size_t host_len = strlen(ftpfs.host);
++ /* at worst: c -> %XX */
++ char * encoded_path = malloc (3 * path_len + 1);
++ const char * s = path;
++ char * d = encoded_path;
++
++ /*
++ * 'path' is always prefixed with 'ftpfs.host'
++ */
++ memcpy (d, ftpfs.host, host_len);
++ s += host_len;
++ d += host_len;
++
++ for (; *s; ++s)
++ {
++ char c = *s;
++ if (is_unreserved (c))
++ {
++ *d++ = c;
++ }
++ else
++ {
++ unsigned int hi = ((unsigned)c >> 4) & 0xF;
++ unsigned int lo = ((unsigned)c >> 0) & 0xF;
++ *d++ = '%';
++ *d++ = hex[hi];
++ *d++ = hex[lo];
++ }
++ }
++ *d = '\0';
++
++ return encoded_path;
++}
++
++void free_uri(char* path)
++{
++ free(path);
++}
+diff --git a/path_utils.h b/path_utils.h
+index 084ae4d..e3e9bca 100644
+--- a/path_utils.h
++++ b/path_utils.h
+@@ -6,4 +6,11 @@ char* get_full_path(const char* path);
+ char* get_fulldir_path(const char* path);
+ char* get_dir_path(const char* path);
+
++/*
++ * Transforms UNIX path to RFC3986 encoded path
++ * (CURLOPT_URL accepts only such paths)
++ */
++char* path_to_uri(const char* path);
++void free_uri(char* path);
++
+ #endif /* __CURLFTPFS_PATH_UTILS_H__ */
diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch
new file mode 100644
index 00000000000..344233c2b83
--- /dev/null
+++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch
@@ -0,0 +1,60 @@
+Picked-from: http://pkgs.fedoraproject.org/cgit/curlftpfs.git/tree/curlftpfs-0.9.2-memleak-cached%23591299.patch?h=f18
+
+@@ -, +, @@
+---
+ cache.c | 2 1 + 1 - 0 !
+ ftpfs-ls.c | 19 15 + 4 - 0 !
+ 2 files changed, 16 insertions(+), 5 deletions(-)
+--- b/cache.c
++++ b/cache.c
+@@ -25,7 +25,7 @@ struct cache {
+ time_t last_cleaned;
+ };
+
+-static struct cache cache;
++struct cache cache;
+
+ struct node {
+ struct stat stat;
+--- b/ftpfs-ls.c
++++ b/ftpfs-ls.c
+@@ -25,6 +25,13 @@
+ #include "charset_utils.h"
+ #include "ftpfs-ls.h"
+
++struct cache {
++ int on;
++ char incomplete[];
++};
++
++extern struct cache cache;
++
+ static int parse_dir_unix(const char *line,
+ struct stat *sbuf,
+ char *file,
+@@ -243,8 +250,10 @@ int parse_dir(const char* list, const ch
+ reallink = g_strdup(link);
+ }
+ int linksize = strlen(reallink);
+- cache_add_link(full_path, reallink, linksize+1);
+- DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink);
++ if (cache.on) {
++ cache_add_link(full_path, reallink, linksize+1);
++ DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink);
++ }
+ if (linkbuf && linklen) {
+ if (linksize > linklen) linksize = linklen - 1;
+ strncpy(linkbuf, reallink, linksize);
+@@ -257,8 +266,10 @@ int parse_dir(const char* list, const ch
+ DEBUG(1, "filler: %s\n", file);
+ filler(h, file, &stat_buf);
+ } else {
+- DEBUG(1, "cache_add_attr: %s\n", full_path);
+- cache_add_attr(full_path, &stat_buf);
++ if (cache.on) {
++ DEBUG(1, "cache_add_attr: %s\n", full_path);
++ cache_add_attr(full_path, &stat_buf);
++ }
+ }
+
+ DEBUG(2, "comparing %s %s\n", name, file);
diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch
new file mode 100644
index 00000000000..27163ac229e
--- /dev/null
+++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch
@@ -0,0 +1,24 @@
+Picked-from: https://github.com/jomat/curlftpfs/commit/b8ce5599a17a1f9e00c93cff3a81fe88f51e8bd3
+Upstream-bug: https://sourceforge.net/tracker/?func=detail&aid=2924678&group_id=160565&atid=816357
+
+commit b8ce5599a17a1f9e00c93cff3a81fe88f51e8bd3
+Author: jomat <jomat@copete.de>
+Date: Sun Oct 16 18:41:37 2011 +0000
+
+ added patch agains memory leak
+
+ see also https://sourceforge.net/tracker/?func=detail&aid=2924678&group_id=160565&atid=816357
+
+diff --git a/ftpfs.c b/ftpfs.c
+index 0346354..96146f7 100644
+--- a/ftpfs.c
++++ b/ftpfs.c
+@@ -615,6 +615,8 @@ static void free_ftpfs_file(struct ftpfs_file *fh) {
+ sem_destroy(&fh->data_need);
+ sem_destroy(&fh->data_written);
+ sem_destroy(&fh->ready);
++ if (fh->buf.size) { buf_free(&fh->buf); }
++ if (fh->stream_buf.size) { buf_free(&fh->stream_buf); }
+ free(fh);
+ }
+
diff --git a/net-fs/curlftpfs/metadata.xml b/net-fs/curlftpfs/metadata.xml
new file mode 100644
index 00000000000..d4820325dcc
--- /dev/null
+++ b/net-fs/curlftpfs/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
+ <herd>net-fs</herd>
+ <upstream>
+ <remote-id type="sourceforge">curlftpfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-fs/cvmfs/Manifest b/net-fs/cvmfs/Manifest
new file mode 100644
index 00000000000..14078f98a2c
--- /dev/null
+++ b/net-fs/cvmfs/Manifest
@@ -0,0 +1,2 @@
+DIST cvmfs-2.1.19.tar.gz 34454888 SHA256 9f86629eba17d8f21222f50e3f693038b6a99798b74913d12c7583199df677b1 SHA512 ea2b68a545b5b20eacbe5244283f71f977365dce7cf09e3b0ef045fe5044b2835e81a79deaed74afaec44cfd25df602ebffaf26d0fe1f5ce6032e71ba10ffdc7 WHIRLPOOL 14fa079be91dce64151c60ec2fda6c2a874957e3388da98e1d51ce1536e67b9b56d40a1c7f98862743120d7230b789f6c7e524983a58e58ef409f028613d2c64
+DIST cvmfs-2.1.20.0-fix05.tar.gz 36877322 SHA256 83d9358bebdd3987472ed602efb7b0d06b586216030e02bc100a363dc7bbfc20 SHA512 95dc6d5e433630aecd45e15d59f831b4b1ccd8a439f799ae078a61bd6fd8e4dc10ae72d760352913c1d4d9e50cd5bc71ddd82b40b8b9b59d371d62aa7e62abf6 WHIRLPOOL a9ab8500ddd31466df26c12fbcaf0403e748fc1d52c9b5eefa495bc1aaa1f1c67e5f679407d55143fe161f7de7be0d52284cb947a63ff0e0a3f63ade879bb21c
diff --git a/net-fs/cvmfs/cvmfs-2.1.19.ebuild b/net-fs/cvmfs/cvmfs-2.1.19.ebuild
new file mode 100644
index 00000000000..b44a4493a19
--- /dev/null
+++ b/net-fs/cvmfs/cvmfs-2.1.19.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+DESCRIPTION="HTTP read-only file system for distributing software"
+HOMEPAGE="http://cernvm.cern.ch/portal/filesystem"
+SRC_URI="https://ecsft.cern.ch/dist/${PN}/${P}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+IUSE="+client debug doc test server"
+
+CDEPEND="
+ dev-cpp/gtest
+ dev-db/sqlite:3=
+ dev-libs/openssl:0
+ net-libs/pacparser:0=
+ net-misc/curl:0=[adns]
+ sys-apps/attr
+ sys-libs/zlib:0=
+ client? (
+ dev-cpp/sparsehash
+ dev-libs/leveldb:0=
+ sys-fs/fuse:0= )
+ server? ( >=dev-cpp/tbb-4.2:0= )"
+
+RDEPEND="${CDEPEND}
+ client? ( net-fs/autofs )
+ server? ( www-servers/apache[ssl] )"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen[dot] )"
+
+src_prepare() {
+ sed -i -e 's/COPYING//' CMakeLists.txt || die
+ rm bootstrap.sh || die
+ sed -i \
+ -e "s:cvmfs-\${CernVM-FS_VERSION_STRING}:${PF}:" \
+ CMakeLists.txt || die
+ # hack for bundled vjson
+ # vjson not worth unbundling, already upstream obsolete
+ # upstream replaced by gason with a new api
+ if use server; then
+ sed -i \
+ -e 's/g++/$(CXX)/g' \
+ -e 's/-O2/$(CXXFLAGS)/g' \
+ -e 's/ar/$(AR)/' \
+ -e 's/ranlib/$(RANLIB)/' \
+ externals/vjson/src/Makefile || die
+ mkdir -p "${S}_build"/externals/build_vjson
+ cp externals/vjson/src/* "${S}_build"/externals/build_vjson/ || die
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DGOOGLETEST_BUILTIN=OFF
+ -DLEVELDB_BUILTIN=OFF
+ -DLIBCURL_BUILTIN=OFF
+ -DPACPARSER_BUILTIN=OFF
+ -DSPARSEHASH_BUILTIN=OFF
+ -DSQLITE3_BUILTIN=OFF
+ -DTBB_PRIVATE_LIB=OFF
+ -DZLIB_BUILTIN=OFF
+ $(cmake-utils_use debug BUILD_SERVER_DEBUG)
+ $(cmake-utils_use server BUILD_SERVER)
+ $(cmake-utils_use client BUILD_CVMFS)
+ $(cmake-utils_use client BUILD_LIBCVMFS)
+ $(cmake-utils_use client INSTALL_MOUNT_SCRIPTS)
+ $(cmake-utils_use test BUILD_UNITTESTS)
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ cd doc
+ doxygen cvmfs.doxy || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dohtml -r doc/html/*
+}
+
+pkg_config() {
+ if use client; then
+ einfo "Setting up CernVM-FS client"
+ cvmfs_config setup
+ einfo "Now edit ${EROOT%/}/etc/cvmfs/default.local and run"
+ einfo " ${EROOT%/}/usr/init.d/autofs restart"
+ fi
+}
diff --git a/net-fs/cvmfs/cvmfs-2.1.20.0_p05.ebuild b/net-fs/cvmfs/cvmfs-2.1.20.0_p05.ebuild
new file mode 100644
index 00000000000..a9e1e667560
--- /dev/null
+++ b/net-fs/cvmfs/cvmfs-2.1.20.0_p05.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+MYP=${PN}-${PV/_p/-fix}
+
+DESCRIPTION="HTTP read-only file system for distributing software"
+HOMEPAGE="http://cernvm.cern.ch/portal/filesystem"
+SRC_URI="https://github.com/cvmfs/${PN}/archive/${MYP}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+
+KEYWORDS="~amd64 ~x86"
+IUSE="+client debug doc test server"
+
+CDEPEND="
+ dev-cpp/gtest
+ dev-db/sqlite:3=
+ dev-libs/openssl:0
+ net-libs/pacparser:0=
+ net-misc/curl:0=[adns]
+ sys-apps/attr
+ sys-libs/zlib:0=
+ client? (
+ >=dev-cpp/sparsehash-1.12
+ dev-libs/leveldb:0=
+ sys-fs/fuse:0= )
+ server? (
+ >=dev-python/geoip-python-1.3.1
+ >=dev-cpp/tbb-4.2:0= )"
+
+RDEPEND="${CDEPEND}
+ client? ( net-fs/autofs )"
+# server? ( www-servers/apache[ssl] )"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen[dot] )"
+
+S="${WORKDIR}/${PN}-${MYP}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-geoip-missing-cmake.patch \
+ "${FILESDIR}"/${P}-cares-underlink.patch
+ # gentoo stuff
+ sed -i -e 's/COPYING//' CMakeLists.txt || die
+ rm bootstrap.sh || die
+ sed -i \
+ -e "s:cvmfs-\${CernVM-FS_VERSION_STRING}:${PF}:" \
+ CMakeLists.txt || die
+
+ # hack for bundled vjson
+ # vjson not worth unbundling, already upstream obsolete
+ # upstream replaced by gason with a new api
+ if use server; then
+ sed -i \
+ -e 's/g++/$(CXX)/g' \
+ -e 's/-O2/$(CXXFLAGS)/g' \
+ -e 's/ar/$(AR)/' \
+ -e 's/ranlib/$(RANLIB)/' \
+ externals/vjson/src/Makefile || die
+ mkdir -p "${WORKDIR}/${P}_build"/externals/build_vjson
+ cp externals/vjson/src/* "${WORKDIR}/${P}_build"/externals/build_vjson/ || die
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DGEOIP_BUILTIN=OFF
+ -DGOOGLETEST_BUILTIN=OFF
+ -DLEVELDB_BUILTIN=OFF
+ -DLIBCURL_BUILTIN=OFF
+ -DPACPARSER_BUILTIN=OFF
+ -DSPARSEHASH_BUILTIN=OFF
+ -DSQLITE3_BUILTIN=OFF
+ -DTBB_PRIVATE_LIB=OFF
+ -DZLIB_BUILTIN=OFF
+ $(cmake-utils_use debug BUILD_SERVER_DEBUG)
+ $(cmake-utils_use server BUILD_SERVER)
+ $(cmake-utils_use client BUILD_CVMFS)
+ $(cmake-utils_use client BUILD_LIBCVMFS)
+ $(cmake-utils_use client INSTALL_MOUNT_SCRIPTS)
+ $(cmake-utils_use test BUILD_UNITTESTS)
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ cd doc
+ doxygen cvmfs.doxy || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dohtml -r doc/html/*
+}
+
+pkg_config() {
+ if use client; then
+ einfo "Setting up CernVM-FS client"
+ cvmfs_config setup
+ einfo "Now edit ${EROOT%/}/etc/cvmfs/default.local"
+ einfo "and restart the autofs service"
+ fi
+}
diff --git a/net-fs/cvmfs/cvmfs-9999.ebuild b/net-fs/cvmfs/cvmfs-9999.ebuild
new file mode 100644
index 00000000000..44a8039649b
--- /dev/null
+++ b/net-fs/cvmfs/cvmfs-9999.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+EGIT_REPO_URI="https://github.com/cvmfs/cvmfs.git"
+EGIT_BRANCH="devel"
+
+inherit git-r3 cmake-utils
+
+DESCRIPTION="HTTP read-only file system for distributing software"
+HOMEPAGE="http://cernvm.cern.ch/portal/filesystem"
+
+SRC_URI=
+KEYWORDS=
+
+LICENSE="BSD"
+SLOT="0"
+
+IUSE="+client debug doc test server"
+
+CDEPEND="
+ dev-cpp/gtest
+ dev-db/sqlite:3=
+ dev-libs/openssl:0
+ net-libs/pacparser:0=
+ net-misc/curl:0=[adns]
+ sys-apps/attr
+ sys-libs/zlib:0=
+ client? (
+ >=dev-cpp/sparsehash-1.12
+ dev-libs/leveldb:0=
+ sys-fs/fuse:0= )
+ server? (
+ >=dev-python/geoip-python-1.3.1
+ >=dev-cpp/tbb-4.2:0= )"
+
+RDEPEND="${CDEPEND}
+ client? ( net-fs/autofs )
+ server? ( www-servers/apache[ssl] )"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen[dot] )"
+
+src_prepare() {
+ sed -i -e 's/COPYING//' CMakeLists.txt || die
+ rm bootstrap.sh || die
+ sed -i \
+ -e "s:cvmfs-\${CernVM-FS_VERSION_STRING}:${PF}:" \
+ CMakeLists.txt || die
+ # hack for bundled vjson
+ # vjson not worth unbundling, already upstream obsolete
+ # upstream replaced by gason with a new api
+ if use server; then
+ sed -i \
+ -e 's/g++/$(CXX)/g' \
+ -e 's/-O2/$(CXXFLAGS)/g' \
+ -e 's/ar/$(AR)/' \
+ -e 's/ranlib/$(RANLIB)/' \
+ externals/vjson/src/Makefile || die
+ mkdir -p "${WORKDIR}/${P}_build"/externals/build_vjson
+ cp externals/vjson/src/* "${WORKDIR}/${P}_build"/externals/build_vjson/ || die
+ fi
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DGEOIP_BUILTIN=OFF
+ -DGOOGLETEST_BUILTIN=OFF
+ -DLEVELDB_BUILTIN=OFF
+ -DLIBCURL_BUILTIN=OFF
+ -DPACPARSER_BUILTIN=OFF
+ -DSPARSEHASH_BUILTIN=OFF
+ -DSQLITE3_BUILTIN=OFF
+ -DTBB_PRIVATE_LIB=OFF
+ -DZLIB_BUILTIN=OFF
+ $(cmake-utils_use debug BUILD_SERVER_DEBUG)
+ $(cmake-utils_use server BUILD_SERVER)
+ $(cmake-utils_use client BUILD_CVMFS)
+ $(cmake-utils_use client BUILD_LIBCVMFS)
+ $(cmake-utils_use client INSTALL_MOUNT_SCRIPTS)
+ $(cmake-utils_use test BUILD_UNITTESTS)
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+ if use doc; then
+ cd doc
+ doxygen cvmfs.doxy || die
+ fi
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dohtml -r doc/html/*
+}
+
+pkg_config() {
+ if use client; then
+ einfo "Setting up CernVM-FS client"
+ cvmfs_config setup
+ einfo "Now edit ${EROOT%/}/etc/cvmfs/default.local and run"
+ einfo " ${EROOT%/}/usr/init.d/autofs restart"
+ fi
+}
diff --git a/net-fs/cvmfs/files/cvmfs-2.1.20.0_p05-cares-underlink.patch b/net-fs/cvmfs/files/cvmfs-2.1.20.0_p05-cares-underlink.patch
new file mode 100644
index 00000000000..198d137e7d1
--- /dev/null
+++ b/net-fs/cvmfs/files/cvmfs-2.1.20.0_p05-cares-underlink.patch
@@ -0,0 +1,106 @@
+diff -Nur cvmfs-cvmfs-2.1.20.0-fix05.orig/cmake/Modules/FindCARES.cmake cvmfs-cvmfs-2.1.20.0-fix05/cmake/Modules/FindCARES.cmake
+--- cvmfs-cvmfs-2.1.20.0-fix05.orig/cmake/Modules/FindCARES.cmake 1970-01-01 00:00:00.000000000 +0000
++++ cvmfs-cvmfs-2.1.20.0-fix05/cmake/Modules/FindCARES.cmake 2015-07-31 18:35:05.859879354 +0000
+@@ -0,0 +1,35 @@
++#
++# $Id$
++#
++# - Find cares
++# Find the native CARES includes and library
++#
++# CARES_INCLUDE_DIRS - where to find cares.h, etc.
++# CARES_LIBRARIES - List of libraries when using cares.
++# CARES_FOUND - True if cares found.
++
++
++IF (CARES_INCLUDE_DIRS)
++ # Already in cache, be silent
++ SET(CARES_FIND_QUIETLY TRUE)
++ENDIF (CARES_INCLUDE_DIRS)
++
++FIND_PATH(CARES_INCLUDE_DIR ares.h)
++
++SET(CARES_NAMES cares)
++FIND_LIBRARY(CARES_LIBRARY NAMES ${CARES_NAMES} )
++
++# handle the QUIETLY and REQUIRED arguments and set CARES_FOUND to TRUE if
++# all listed variables are TRUE
++INCLUDE(FindPackageHandleStandardArgs)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(CARES DEFAULT_MSG CARES_LIBRARY CARES_INCLUDE_DIR)
++
++IF(CARES_FOUND)
++ SET( CARES_LIBRARIES ${CARES_LIBRARY} )
++ SET( CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR} )
++ELSE(CARES_FOUND)
++ SET( CARES_LIBRARIES )
++ SET( CARES_INCLUDE_DIRS )
++ENDIF(CARES_FOUND)
++
++MARK_AS_ADVANCED( CARES_LIBRARIES CARES_INCLUDE_DIRS )
+diff -Nur cvmfs-cvmfs-2.1.20.0-fix05.orig/CMakeLists.txt cvmfs-cvmfs-2.1.20.0-fix05/CMakeLists.txt
+--- cvmfs-cvmfs-2.1.20.0-fix05.orig/CMakeLists.txt 2015-02-23 13:51:47.000000000 +0000
++++ cvmfs-cvmfs-2.1.20.0-fix05/CMakeLists.txt 2015-07-31 18:32:34.259882076 +0000
+@@ -252,9 +252,12 @@
+ include (${CARES_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
+ include (${LIBCURL_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
+ set (CURL_LIBRARIES "")
++ set (CARES_LIBRARIES "")
+ else (LIBCURL_BUILTIN)
+ find_package (CURL REQUIRED)
++ find_package (CARES REQUIRED)
+ set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${CURL_INCLUDE_DIRS})
++ set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${CARES_INCLUDE_DIRS})
+ if (CURL_INCLUDE_DIRS)
+ find_program(CURL_CONFIG_EXEC NAMES curl-config)
+ if (CURL_CONFIG_EXEC)
+diff -Nur cvmfs-cvmfs-2.1.20.0-fix05.orig/cvmfs/CMakeLists.txt cvmfs-cvmfs-2.1.20.0-fix05/cvmfs/CMakeLists.txt
+--- cvmfs-cvmfs-2.1.20.0-fix05.orig/cvmfs/CMakeLists.txt 2015-02-23 13:51:47.000000000 +0000
++++ cvmfs-cvmfs-2.1.20.0-fix05/cvmfs/CMakeLists.txt 2015-07-31 18:34:36.789879876 +0000
+@@ -271,7 +271,7 @@
+ set_target_properties (cvmfs_fuse_debug PROPERTIES VERSION ${CernVM-FS_VERSION_STRING})
+
+ # link the stuff (*_LIBRARIES are dynamic link libraries *_archive are static link libraries ... one of them will be empty for each dependency)
+- set (CVMFS_FUSE_LINK_LIBRARIES ${SQLITE3_LIBRARY} ${CURL_LIBRARIES} ${PACPARSER_LIBRARIES} ${ZLIB_LIBRARIES} ${LEVELDB_LIBRARIES} ${OPENSSL_LIBRARIES} ${FUSE_LIBRARIES} ${LIBFUSE_ARCHIVE} ${SQLITE3_ARCHIVE} ${LIBCURL_ARCHIVE} ${PACPARSER_ARCHIVE} ${LEVELDB_ARCHIVE} ${CARES_ARCHIVE} ${ZLIB_ARCHIVE} ${RT_LIBRARY} ${UUID_LIBRARIES} pthread dl)
++ set (CVMFS_FUSE_LINK_LIBRARIES ${SQLITE3_LIBRARY} ${CARES_LIBRARIES} ${CURL_LIBRARIES} ${PACPARSER_LIBRARIES} ${ZLIB_LIBRARIES} ${LEVELDB_LIBRARIES} ${OPENSSL_LIBRARIES} ${FUSE_LIBRARIES} ${LIBFUSE_ARCHIVE} ${SQLITE3_ARCHIVE} ${LIBCURL_ARCHIVE} ${PACPARSER_ARCHIVE} ${LEVELDB_ARCHIVE} ${CARES_ARCHIVE} ${ZLIB_ARCHIVE} ${RT_LIBRARY} ${UUID_LIBRARIES} pthread dl)
+
+ target_link_libraries (cvmfs2 ${CVMFS_LOADER_LIBS} ${OPENSSL_LIBRARIES} ${LIBFUSE} ${RT_LIBRARY} ${UUID_LIBRARIES} pthread dl)
+ target_link_libraries (cvmfs_fuse_debug ${CVMFS2_DEBUG_LIBS} ${CVMFS_FUSE_LINK_LIBRARIES})
+@@ -331,7 +331,7 @@
+ add_dependencies (libcvmfs cvmfs_only)
+
+ add_executable( test_libcvmfs ${TEST_LIBCVMFS_SOURCES} )
+- target_link_libraries( test_libcvmfs ${CMAKE_CURRENT_BINARY_DIR}/libcvmfs.a ${SQLITE3_LIBRARY} ${CURL_LIBRARIES} ${PACPARSER_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES} ${RT_LIBRARY} ${UUID_LIBRARIES} pthread dl )
++ target_link_libraries( test_libcvmfs ${CMAKE_CURRENT_BINARY_DIR}/libcvmfs.a ${SQLITE3_LIBRARY} ${CARES_LIBRARIES} ${CURL_LIBRARIES} ${PACPARSER_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES} ${RT_LIBRARY} ${UUID_LIBRARIES} pthread dl )
+ add_dependencies (test_libcvmfs libcvmfs)
+
+ endif (BUILD_LIBCVMFS)
+@@ -371,7 +371,7 @@
+ set_target_properties (cvmfs_swissknife PROPERTIES COMPILE_FLAGS "${CVMFS_SWISSKNIFE_CFLAGS}" LINK_FLAGS "${CVMFS_SWISSKNIFE_LD_FLAGS}")
+
+ # link the stuff (*_LIBRARIES are dynamic link libraries)
+- target_link_libraries (cvmfs_swissknife ${CVMFS_SWISSKNIFE_LIBS} ${SQLITE3_LIBRARY} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} ${TBB_LIBRARIES} ${OPENSSL_LIBRARIES} ${LIBCURL_ARCHIVE} ${CARES_ARCHIVE} ${SQLITE3_ARCHIVE} ${ZLIB_ARCHIVE} ${RT_LIBRARY} ${VJSON_ARCHIVE} pthread dl)
++ target_link_libraries (cvmfs_swissknife ${CVMFS_SWISSKNIFE_LIBS} ${SQLITE3_LIBRARY} ${CARES_LIBRARIES} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} ${TBB_LIBRARIES} ${OPENSSL_LIBRARIES} ${LIBCURL_ARCHIVE} ${CARES_ARCHIVE} ${SQLITE3_ARCHIVE} ${ZLIB_ARCHIVE} ${RT_LIBRARY} ${VJSON_ARCHIVE} pthread dl)
+
+ if (BUILD_SERVER_DEBUG)
+ add_executable (cvmfs_swissknife_debug ${CVMFS_SWISSKNIFE_DEBUG_SOURCES})
+@@ -399,7 +399,7 @@
+ message (WARNING "Debug libraries of TBB were not found. Using the release versions instead.")
+ set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARIES})
+ endif (NOT TBB_DEBUG_LIBRARIES)
+- target_link_libraries (cvmfs_swissknife_debug ${CVMFS_SWISSKNIFE_LIBS} ${SQLITE3_LIBRARY} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES} ${LIBCURL_ARCHIVE} ${CARES_ARCHIVE} ${SQLITE3_ARCHIVE} ${ZLIB_ARCHIVE} ${TBB_DEBUG_LIBRARIES} ${RT_LIBRARY} ${VJSON_ARCHIVE} pthread dl)
++ target_link_libraries (cvmfs_swissknife_debug ${CVMFS_SWISSKNIFE_LIBS} ${SQLITE3_LIBRARY} ${CARES_LIBRARIES} ${CURL_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES} ${LIBCURL_ARCHIVE} ${CARES_ARCHIVE} ${SQLITE3_ARCHIVE} ${ZLIB_ARCHIVE} ${TBB_DEBUG_LIBRARIES} ${RT_LIBRARY} ${VJSON_ARCHIVE} pthread dl)
+ endif (BUILD_SERVER_DEBUG)
+ endif (BUILD_SERVER)
+
+diff -Nur cvmfs-cvmfs-2.1.20.0-fix05.orig/cvmfs/CMakeLists.txt cvmfs-cvmfs-2.1.20.0-fix05/cvmfs/CMakeLists.txt
+--- cvmfs-cvmfs-2.1.20.0-fix05.orig/test/unittests/CMakeLists.txt.orig 2015-07-31 19:03:06.829849170 +0000
++++ cvmfs-cvmfs-2.1.20.0-fix05/test/unittests/CMakeLists.txt 2015-07-31 19:03:36.459848638 +0000
+@@ -212,7 +212,7 @@
+ endif (BUILD_UNITTESTS_DEBUG)
+
+ # link the stuff (*_LIBRARIES are dynamic link libraries)
+-set (UNITTEST_LINK_LIBRARIES ${GTEST_LIBRARIES} ${GOOGLETEST_ARCHIVE} ${OPENSSL_LIBRARIES}
++set (UNITTEST_LINK_LIBRARIES ${GTEST_LIBRARIES} ${GOOGLETEST_ARCHIVE} ${OPENSSL_LIBRARIES} ${CARES_LIBRARIES}
+ ${CURL_LIBRARIES} ${LIBCURL_ARCHIVE} ${CARES_ARCHIVE}
+ ${SQLITE3_LIBRARY} ${SQLITE3_ARCHIVE} ${TBB_LIBRARIES}
+ ${ZLIB_LIBRARIES} ${ZLIB_ARCHIVE} ${RT_LIBRARY} ${UUID_LIBRARIES}
diff --git a/net-fs/cvmfs/files/cvmfs-2.1.20.0_p05-geoip-missing-cmake.patch b/net-fs/cvmfs/files/cvmfs-2.1.20.0_p05-geoip-missing-cmake.patch
new file mode 100644
index 00000000000..e47f61ee894
--- /dev/null
+++ b/net-fs/cvmfs/files/cvmfs-2.1.20.0_p05-geoip-missing-cmake.patch
@@ -0,0 +1,151 @@
+--- /dev/null
++++ cmake/Modules/FindLibGeoIP.cmake
+@@ -0,0 +1,68 @@
++# - Try to find GeoIP headers and libraries
++#
++# Usage of this module as follows:
++#
++# find_package(LibGeoIP)
++#
++# Variables used by this module, they can change the default behaviour and need
++# to be set before calling find_package:
++#
++# LibGeoIP_ROOT_DIR Set this variable to the root installation of
++# libGeoIP if the module has problems finding the
++# proper installation path.
++#
++# Variables defined by this module:
++#
++# LIBGEOIP_FOUND System has GeoIP libraries and headers
++# LibGeoIP_LIBRARY The GeoIP library
++# LibGeoIP_INCLUDE_DIR The location of GeoIP headers
++# HAVE_GEOIP_COUNTRY_EDITION_V6 Whether the API support IPv6 country edition
++# HAVE_GEOIP_CITY_EDITION_REV0_V6 Whether the API supports IPv6 city edition
++
++find_path(LibGeoIP_ROOT_DIR
++ NAMES include/GeoIPCity.h
++)
++
++if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
++ # the static version of the library is preferred on OS X for the
++ # purposes of making packages (libGeoIP doesn't ship w/ OS X)
++ set(libgeoip_names libGeoIp.a GeoIP)
++else ()
++ set(libgeoip_names GeoIP)
++endif ()
++
++find_library(LibGeoIP_LIBRARY
++ NAMES ${libgeoip_names}
++ HINTS ${LibGeoIP_ROOT_DIR}/lib
++)
++
++find_path(LibGeoIP_INCLUDE_DIR
++ NAMES GeoIPCity.h
++ HINTS ${LibGeoIP_ROOT_DIR}/include
++)
++
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(LibGeoIP DEFAULT_MSG
++ LibGeoIP_LIBRARY
++ LibGeoIP_INCLUDE_DIR
++)
++
++if (LIBGEOIP_FOUND)
++ include(CheckCXXSourceCompiles)
++ set(CMAKE_REQUIRED_INCLUDES ${LibGeoIP_INCLUDE_DIR})
++ check_cxx_source_compiles("
++ #include <GeoIPCity.h>
++ int main() { GEOIP_COUNTRY_EDITION_V6; return 0; }
++ " HAVE_GEOIP_COUNTRY_EDITION_V6)
++ check_cxx_source_compiles("
++ #include <GeoIPCity.h>
++ int main() { GEOIP_CITY_EDITION_REV0_V6; return 0; }
++ " HAVE_GEOIP_CITY_EDITION_REV0_V6)
++ set(CMAKE_REQUIRED_INCLUDES)
++endif ()
++
++mark_as_advanced(
++ LibGeoIP_ROOT_DIR
++ LibGeoIP_LIBRARY
++ LibGeoIP_INCLUDE_DIR
++)
+\ No newline at end of file
+diff --git a/cmake/Modules/FindPythonModule.cmake b/cmake/Modules/FindPythonModule.cmake
+new file mode 100644
+index 0000000..1a29315
+--- /dev/null
++++ cmake/Modules/FindPythonModule.cmake
+@@ -0,0 +1,24 @@
++# Find if a Python module is installed
++# Found at http://www.cmake.org/pipermail/cmake/2011-January/041666.html
++# To use do: find_python_module(PyQt4 REQUIRED)
++function(find_python_module module)
++ string(TOUPPER ${module} module_upper)
++ if(NOT PYTHON_${module_upper})
++ include (FindPythonInterp)
++ if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
++ set(PY_${module}_FIND_REQUIRED TRUE)
++ endif()
++ # A module's location is usually a directory, but for binary modules
++ # it's a .so file.
++ execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
++ "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))"
++ RESULT_VARIABLE _${module}_status
++ OUTPUT_VARIABLE _${module}_location
++ ERROR_QUIET
++ OUTPUT_STRIP_TRAILING_WHITESPACE)
++ if(${_${module}_status} EQUAL 0)
++ set(PYTHON_${module_upper} ${_${module}_location} CACHE STRING "Location of Python module ${module}")
++ endif(${_${module}_status} EQUAL 0)
++ endif(NOT PYTHON_${module_upper})
++ find_package_handle_standard_args(PY_${module} DEFAULT_MSG PYTHON_${module_upper})
++endfunction(find_python_module)
+\ No newline at end of file
+diff --git a/cvmfs/CMakeLists.txt b/cvmfs/CMakeLists.txt
+index cb09b94..44be85e 100644
+--- cvmfs/CMakeLists.txt
++++ cvmfs/CMakeLists.txt
+@@ -347,9 +347,9 @@ if (BUILD_SERVER)
+ # create targets with corresponding sources and static link libraries
+ add_executable (cvmfs_swissknife ${CVMFS_SWISSKNIFE_SOURCES})
+ add_executable (cvmfs_suid_helper ${CVMFS_SUID_HELPER_SOURCES})
+- add_custom_target (geoip ALL)
+
+ if (GEOIP_BUILTIN)
++ add_custom_target (geoip ALL)
+ add_dependencies (python-geoip libgeoip)
+ add_dependencies (geoip python-geoip)
+ endif (GEOIP_BUILTIN)
+--- CMakeLists.txt.orig 2015-08-04 15:33:53.383868890 +0000
++++ CMakeLists.txt 2015-08-04 15:58:03.133842858 +0000
+@@ -145,6 +145,12 @@
+ endif (EXISTS "${CMAKE_SOURCE_DIR}/bootstrap.sh")
+
+ #
++# include some common functionality
++#
++include (FindPythonModule)
++
++
++#
+ # set some default flags
+ #
+ # flags in CMAKE_C**_FLAGS are always passed to the compiler
+@@ -309,13 +315,15 @@
+ set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GTEST_INCLUDE_DIRS})
+ endif (GOOGLETEST_BUILTIN)
+
++if (BUILD_SERVER OR BUILD_UNITTESTS)
+ if (GEOIP_BUILTIN)
+ include (${LIBGEOIP_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
+ include (${PYTHON_GEOIP_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
+ else (GEOIP_BUILTIN)
+- find_package (GeoIP REQUIRED)
+- find_package (python-GeoIP REQUIRED)
++ find_package (LibGeoIP REQUIRED)
++ find_python_module (GeoIP REQUIRED)
+ endif (GEOIP_BUILTIN)
++endif (BUILD_SERVER OR BUILD_UNITTESTS)
+
+ # required libraries for client and libcvmfs
+ if (BUILD_CVMFS OR BUILD_LIBCVMFS)
diff --git a/net-fs/cvmfs/metadata.xml b/net-fs/cvmfs/metadata.xml
new file mode 100644
index 00000000000..b33579ead77
--- /dev/null
+++ b/net-fs/cvmfs/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>bicatali@gentoo.org</email>
+</maintainer>
+<longdescription lang='en'>
+ The CernVM File System is a client-server file system developed to
+ deliver software stacks onto virtual machines in a fast, scalable,
+ and reliable way. CernVM-FS is implemented as a FUSE module. It
+ makes a specially prepared directory tree stored on a web server
+ look like a local read-only file system on the virtual
+ machine. CernVM-FS uses outgoing HTTP connections only, thereby it
+ avoids most of the firewall issues of other network file systems. It
+ transfers data file by file on demand, verifying the content by
+ SHA-1 keys.
+</longdescription>
+<use>
+ <flag name='client'>Install the cvmfs client programs and init script</flag>
+ <flag name='server'>Install the cvmfsd program and init script</flag>
+</use>
+</pkgmetadata>
diff --git a/net-fs/davfs2/Manifest b/net-fs/davfs2/Manifest
new file mode 100644
index 00000000000..2904835f7e7
--- /dev/null
+++ b/net-fs/davfs2/Manifest
@@ -0,0 +1,2 @@
+DIST davfs2-1.4.5.tar.gz 429635 SHA256 28f0ce00ddaf1ab93aa9f39db8d9f932d194c676bc21c3c8c3e2bea7f21274de SHA512 0fd20e8aba8d236feec06b3f2184388691ee19a4e993cf543a2356feb9c25e1de41521c462bd01497f89ff4d16d0d3defb3227a64c0a490db2c0647e1391c9d1 WHIRLPOOL 955d98c0a2b49d5400971b9381d05f87c21420a5b52a4ef1ec330cfd6d4f451e56a6fa884164ed84dabae06aa29010df66ccd6e048e932d30e01545257152e31
+DIST davfs2-1.4.7.tar.gz 444398 SHA256 50c0ee2a12e8d09fc6a852d32bdfebb1f784939433a85f05254bc7ef28cff044 SHA512 6754d08cdfcceea47a4248fb05a6f5a1907acbc9a6c0ab175dce640b160ee24b7efdf9da38be1cc8bd6dbb0825c88a7017a3534a7c3188860dcd1bef12a5d4ae WHIRLPOOL f4c44ccc1fbd146f563605b2290068b549f6dcf247224685f2efaf9cda91a947a45dceed17d3d585407dc8e4ffa85c933d6eb5b4e78e0f00bd18cfbd53f52c7d
diff --git a/net-fs/davfs2/davfs2-1.4.5-r1.ebuild b/net-fs/davfs2/davfs2-1.4.5-r1.ebuild
new file mode 100644
index 00000000000..bd443b7877e
--- /dev/null
+++ b/net-fs/davfs2/davfs2-1.4.5-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit autotools eutils linux-mod user
+
+DESCRIPTION="Linux FUSE (or coda) driver that allows you to mount a WebDAV resource"
+HOMEPAGE="http://savannah.nongnu.org/projects/davfs2"
+SRC_URI="http://mirror.lihnidos.org/GNU/savannah/davfs2/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+RESTRICT="test"
+
+DEPEND="dev-libs/libxml2
+ net-libs/neon
+ sys-libs/zlib"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup davfs2
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-glibc212.patch
+ sed -e "s/^NE_REQUIRE_VERSIONS.*29/& 30/" -i configure.ac
+ eautoreconf
+}
+
+src_configure() {
+ econf --enable-largefile
+}
+
+src_compile() {
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc AUTHORS BUGS ChangeLog FAQ NEWS README README.translators THANKS TODO
+
+ # Remove wrong locations created by install.
+ rm -fr "${D}/usr/share/doc/davfs2"
+ rm -fr "${D}/usr/share/davfs2"
+
+ dodir /var/run/mount.davfs
+ keepdir /var/run/mount.davfs
+ fowners root:davfs2 /var/run/mount.davfs
+ fperms 1774 /var/run/mount.davfs
+
+ # Ignore nobody's home
+ cat>>"${D}/etc/davfs2/davfs2.conf"<<EOF
+
+# nobody is a system account in Gentoo
+ignore_home nobody
+EOF
+}
+
+pkg_postinst() {
+ elog
+ elog "Quick setup:"
+ elog " (as root)"
+ elog " # gpasswd -a \${your_user} davfs2"
+ elog " # echo 'http://path/to/dav /home/\${your_user}/dav davfs rw,user,noauto 0 0' >> /etc/fstab"
+ elog " (as user)"
+ elog " # mkdir -p ~/dav"
+ elog " \$ mount ~/dav"
+ elog
+}
diff --git a/net-fs/davfs2/davfs2-1.4.7.ebuild b/net-fs/davfs2/davfs2-1.4.7.ebuild
new file mode 100644
index 00000000000..cde20257062
--- /dev/null
+++ b/net-fs/davfs2/davfs2-1.4.7.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools eutils linux-mod user
+
+DESCRIPTION="Linux FUSE (or coda) driver that allows you to mount a WebDAV resource"
+HOMEPAGE="http://savannah.nongnu.org/projects/davfs2"
+SRC_URI="http://mirror.lihnidos.org/GNU/savannah/davfs2/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+RESTRICT="test"
+
+DEPEND="dev-libs/libxml2
+ net-libs/neon
+ sys-libs/zlib"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup davfs2
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-destdir.patch # fixed in 1.4.7+ upstream
+ sed -e "s/^NE_REQUIRE_VERSIONS.*29/& 30/" -i configure.ac
+ eautoreconf
+}
+
+src_configure() {
+ econf dav_user=nobody --enable-largefile --docdir=/usr/share/doc/${P}
+}
+
+src_compile() {
+ emake
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+# dodoc AUTHORS BUGS ChangeLog FAQ NEWS README README.translators THANKS TODO
+
+ dodir /var/run/mount.davfs
+ keepdir /var/run/mount.davfs
+ fowners root:davfs2 /var/run/mount.davfs
+ fperms 1774 /var/run/mount.davfs
+
+}
+
+pkg_postinst() {
+ elog
+ elog "Quick setup:"
+ elog " (as root)"
+ elog " # gpasswd -a \${your_user} davfs2"
+ elog " # echo 'http://path/to/dav /home/\${your_user}/dav davfs rw,user,noauto 0 0' >> /etc/fstab"
+ elog " (as user)"
+ elog " # mkdir -p ~/dav"
+ elog " \$ mount ~/dav"
+ elog
+}
diff --git a/net-fs/davfs2/files/davfs2-1.4.5-glibc212.patch b/net-fs/davfs2/files/davfs2-1.4.5-glibc212.patch
new file mode 100644
index 00000000000..cd7cde3f26a
--- /dev/null
+++ b/net-fs/davfs2/files/davfs2-1.4.5-glibc212.patch
@@ -0,0 +1,60 @@
+http://bugs.gentoo.org/332865
+https://savannah.nongnu.org/bugs/?28916
+
+--- src/dav_coda.c
++++ src/dav_coda.c
+@@ -52,6 +52,9 @@
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
++#ifdef HAVE_SYS_STAT_H
++#include <sys/stat.h>
++#endif
+
+ #include "defaults.h"
+ #include "mount_davfs.h"
+--- src/dav_fuse.c
++++ src/dav_fuse.c
+@@ -41,6 +41,12 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++#ifdef HAVE_SYS_STAT_H
++#include <sys/stat.h>
++#endif
+
+ #include "defaults.h"
+ #include "mount_davfs.h"
+--- src/kernel_interface.c
++++ src/kernel_interface.c
+@@ -44,6 +44,12 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++#ifdef HAVE_SYS_STAT_H
++#include <sys/stat.h>
++#endif
+
+ #ifdef HAVE_SYS_MOUNT_H
+ #include <sys/mount.h>
+--- src/webdav.c
++++ src/webdav.c
+@@ -47,6 +47,12 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++#ifdef HAVE_SYS_STAT_H
++#include <sys/stat.h>
++#endif
+
+ #include <ne_alloc.h>
+ #include <ne_auth.h>
diff --git a/net-fs/davfs2/files/davfs2-1.4.7-destdir.patch b/net-fs/davfs2/files/davfs2-1.4.7-destdir.patch
new file mode 100644
index 00000000000..40dbd9585a2
--- /dev/null
+++ b/net-fs/davfs2/files/davfs2-1.4.7-destdir.patch
@@ -0,0 +1,18 @@
+https://bugs.gentoo.org/384703
+Patch by Jeroen Roovers
+
+https://savannah.nongnu.org/support/?108104
+
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -51,8 +51,8 @@
+ chmod u+s $(DESTDIR)$(sbindir)/mount.davfs; \
+ if test "$(sbindir)" != "$(ssbindir)"; then \
+ $(mkinstalldirs) $(DESTDIR)$(ssbindir); \
+- $(LN_S) -f $(DESTDIR)$(sbindir)/mount.davfs $(DESTDIR)$(ssbindir)/mount.davfs; \
+- $(LN_S) -f $(DESTDIR)$(sbindir)/umount.davfs $(DESTDIR)$(ssbindir)/umount.davfs; \
++ $(LN_S) -f $(sbindir)/mount.davfs $(DESTDIR)$(ssbindir)/mount.davfs; \
++ $(LN_S) -f $(sbindir)/umount.davfs $(DESTDIR)$(ssbindir)/umount.davfs; \
+ fi
+
+ uninstall-hook:
diff --git a/net-fs/davfs2/metadata.xml b/net-fs/davfs2/metadata.xml
new file mode 100644
index 00000000000..ae4618a83b4
--- /dev/null
+++ b/net-fs/davfs2/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-fs</herd>
+</pkgmetadata>
diff --git a/net-fs/libnfs/Manifest b/net-fs/libnfs/Manifest
new file mode 100644
index 00000000000..c7957c70768
--- /dev/null
+++ b/net-fs/libnfs/Manifest
@@ -0,0 +1,5 @@
+DIST libnfs-1.3.0.tgz 57936 SHA256 0acda3029db699c3978684080843f71d222ad35b30a2ff0d220d144e98854948 SHA512 95377bddc487f3c49db74878671115f40fdf59a2d8d63d3aed0b64b6420e5940897b7c4c515b6560e105131117aafe5c851849c44b611e35b12814c5adfde57f WHIRLPOOL 947d08a056071c331b0736ac316eeae9c81f138a8823158cb6a7e001f46e151f8b655017dba20f3dd453205e13249ab3816488b67d44f8000ac5f4ef1baf4928
+DIST libnfs-1.5.0.tar.gz 787385 SHA256 5663355dc18e75c893e09b133ca3ef70cf00754acfea863257f509922b5e5faa SHA512 e7e1699ef6fd9209eec54da804dc02048de2bc968be35e8a01770bb3dae5559a73d7cf54c1bf14ebe25ef3f1953b34aa6d1fc2521835fb1044c23a585d5dcff1 WHIRLPOOL 55068877acfbadba3c976239a51a4f6106069f3a13d774f1f34f447d3380ab1c0f743b4030b2ff3628db9d0d9c9b1795687dbc244ef26d0a35869d1c4a083d53
+DIST libnfs-1.8.0.tar.gz 107529 SHA256 e4d766efba85e79b04c18038070506d0a9df5b7e0f08aa54ab402892cd1542cc SHA512 c04fe22ba8857c6f8e2b8ac0b1309e5f1d613dd8485b12950efb62123944bf920e25ff0661bfe28ddb566a213f51a414fbfe553c7a1921a0902d0beda0019b4c WHIRLPOOL 0618950f2def241138c77b96fbf7abdcbab95e5904c7009de20e2fcdfe4b4ac45b96fddfeb8ff782d829b9305daf94b50a855d569203be28f45320e35791083d
+DIST libnfs-1.9.5.tar.gz 141162 SHA256 dd99ffa02a3d9fc936976e199614e0d0e2516bd27ead5639c063b8504008a393 SHA512 fee676503b3655f3710342f5f6944f598b1e404f0a00891387d36d41f55f25f27254cbe061b8d8b00ee445a1bfd51df9c2cbccd72f3cdb0f7e8925691fcb2a4b WHIRLPOOL 631000670b9b7f5a1084e182aa793a70b844945d8e96ac3bcb6d035cd92c0a3aa304b8421d7d1ff998134ad991c3f258ff78f85861ce92b481fccd7826633860
+DIST libnfs-1.9.7.tar.gz 145925 SHA256 7c2e088f5fd85b791ab644a5221b717894208bc5fb8b8a5a49633802ecaa0990 SHA512 0dec9a6eee61bcab5a406b6f8bd50d15ffa257bc0fae7079e25a3e0ecb1177845514c232d699c67c59a3f1a269099a46225959d413301bf4550aa37504e2f492 WHIRLPOOL bc3e37b4c6174a1d9d14c9e6722cf03c1610e3c39b020ad0d9e8dfdeda7b2e06e7c0287a5b789d89d4d4434b46192f662e1d48cec2e1d666e647ef8e5f75d31d
diff --git a/net-fs/libnfs/files/libnfs-1.5.0-headers.patch b/net-fs/libnfs/files/libnfs-1.5.0-headers.patch
new file mode 100644
index 00000000000..68ec6d3c71c
--- /dev/null
+++ b/net-fs/libnfs/files/libnfs-1.5.0-headers.patch
@@ -0,0 +1,42 @@
+From 32bd77c82fe12fbfe0a1d50f64fa1959cf699bea Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 3 Dec 2012 22:30:04 -0500
+Subject: [PATCH] fix implicit decl warnings
+
+Include the proper headers to fix these warnings:
+libnfs-sync.c:1529:3: warning: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
+libnfs-zdr.c:506:2: warning: implicit declaration of function 'getuid' [-Wimplicit-function-declaration]
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ lib/libnfs-sync.c | 1 +
+ lib/libnfs-zdr.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c
+index fd6f796..1fbeb8f 100644
+--- a/lib/libnfs-sync.c
++++ b/lib/libnfs-sync.c
+@@ -45,6 +45,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <assert.h>
++#include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+diff --git a/lib/libnfs-zdr.c b/lib/libnfs-zdr.c
+index a243d1d..3d5fd30 100644
+--- a/lib/libnfs-zdr.c
++++ b/lib/libnfs-zdr.c
+@@ -29,6 +29,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
++#include <unistd.h>
+ #include "libnfs-zdr.h"
+
+ struct opaque_auth _null_auth;
+--
+1.7.12.4
+
diff --git a/net-fs/libnfs/files/libnfs-1.8.0-makefile.patch b/net-fs/libnfs/files/libnfs-1.8.0-makefile.patch
new file mode 100644
index 00000000000..c06ba114d1d
--- /dev/null
+++ b/net-fs/libnfs/files/libnfs-1.8.0-makefile.patch
@@ -0,0 +1,38 @@
+This enables out of source build
+
+--- lib/Makefile.am 2013-10-31 05:17:49.000000000 +0400
++++ lib/Makefile.am 2014-01-07 21:23:07.281715242 +0400
+@@ -2,11 +2,11 @@
+
+ libnfs_la_CPPFLAGS = -I$(abs_top_srcdir)/include \
+ -I$(abs_top_srcdir)/include/nfsc \
+- -I../mount \
+- -I../nfs \
+- -I../nlm \
+- -I../portmap \
+- -I../rquota \
++ -I$(abs_top_srcdir)/mount \
++ -I$(abs_top_srcdir)/nfs \
++ -I$(abs_top_srcdir)/nlm \
++ -I$(abs_top_srcdir)/portmap \
++ -I$(abs_top_srcdir)/rquota \
+ "-D_U_=__attribute__((unused))"
+
+ libnfs_la_SOURCES = \
+--- examples/Makefile.am 2013-10-31 05:17:49.000000000 +0400
++++ examples/Makefile.am 2014-01-07 21:30:34.776726611 +0400
+@@ -3,10 +3,10 @@
+ AM_CPPFLAGS = \
+ -I$(abs_top_srcdir)/include \
+ -I$(abs_top_srcdir)/include/nfsc \
+- -I../mount \
+- -I../nfs \
+- -I../rquota \
+- -I../portmap \
++ -I$(abs_top_srcdir)/mount \
++ -I$(abs_top_srcdir)/nfs \
++ -I$(abs_top_srcdir)/rquota \
++ -I$(abs_top_srcdir)/portmap \
+ "-D_U_=__attribute__((unused))"
+
+ AM_LDFLAGS = ../lib/.libs/libnfs.la -lpopt
diff --git a/net-fs/libnfs/files/libnfs-1.9.5-headers.patch b/net-fs/libnfs/files/libnfs-1.9.5-headers.patch
new file mode 100644
index 00000000000..96719ffd54c
--- /dev/null
+++ b/net-fs/libnfs/files/libnfs-1.9.5-headers.patch
@@ -0,0 +1,86 @@
+From 0bfc3e09b7d7ca2b75d42c17874b89333b96f371 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 3 Dec 2012 22:30:04 -0500
+Subject: [PATCH] fix implicit decl warnings
+
+Include the proper headers to fix warnings like:
+libnfs-sync.c:1529:3: warning: implicit declaration of function 'gettimeofday' [-Wimplicit-function-declaration]
+libnfs-zdr.c:506:2: warning: implicit declaration of function 'getuid' [-Wimplicit-function-declaration]
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ lib/libnfs-sync.c | 1 +
+ lib/libnfs-zdr.c | 9 +++++++++
+ lib/libnfs.c | 1 +
+ lib/socket.c | 1 +
+ 4 files changed, 12 insertions(+)
+
+diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c
+index 0fc1094..c140258 100644
+--- a/lib/libnfs-sync.c
++++ b/lib/libnfs-sync.c
+@@ -77,6 +77,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <assert.h>
++#include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+diff --git a/lib/libnfs-zdr.c b/lib/libnfs-zdr.c
+index c32f661..b6b3ed9 100644
+--- a/lib/libnfs-zdr.c
++++ b/lib/libnfs-zdr.c
+@@ -20,6 +20,10 @@
+ * i.e. zdrmem_create() buffers.
+ * It aims to be compatible with normal rpcgen generated functions.
+ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ #ifdef WIN32
+ #include "win32_compat.h"
+ #endif
+@@ -28,9 +32,14 @@
+ #include "aros_compat.h"
+ #endif
+
++#ifdef HAVE_ARPA_INET_H
++#include <arpa/inet.h>
++#endif
++
+ #include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
++#include <unistd.h>
+ #include "libnfs-zdr.h"
+
+ struct opaque_auth _null_auth;
+diff --git a/lib/libnfs.c b/lib/libnfs.c
+index 5692dc3..0a7d139 100644
+--- a/lib/libnfs.c
++++ b/lib/libnfs.c
+@@ -73,6 +73,7 @@
+ #include <string.h>
+ #include <assert.h>
+ #include <errno.h>
++#include <time.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+diff --git a/lib/socket.c b/lib/socket.c
+index 3f7f89f..f8db957 100644
+--- a/lib/socket.c
++++ b/lib/socket.c
+@@ -68,6 +68,7 @@
+ #include <fcntl.h>
+ #include <string.h>
+ #include <errno.h>
++#include <time.h>
+ #include <sys/types.h>
+ #include "libnfs-zdr.h"
+ #include "libnfs.h"
+--
+2.0.0
+
diff --git a/net-fs/libnfs/files/libnfs-1.9.5-implicit-internal.patch b/net-fs/libnfs/files/libnfs-1.9.5-implicit-internal.patch
new file mode 100644
index 00000000000..e702c81f5cb
--- /dev/null
+++ b/net-fs/libnfs/files/libnfs-1.9.5-implicit-internal.patch
@@ -0,0 +1,27 @@
+From 2be32c3c41207c029f54ebd0f4aa08e216bd3c21 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 8 Aug 2014 05:45:32 -0400
+Subject: [PATCH 3/3] fix implicit decls of rpc_{g,s}et_error
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ lib/libnfs-zdr.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/libnfs-zdr.c b/lib/libnfs-zdr.c
+index b6b3ed9..90abe26 100644
+--- a/lib/libnfs-zdr.c
++++ b/lib/libnfs-zdr.c
+@@ -41,6 +41,9 @@
+ #include <time.h>
+ #include <unistd.h>
+ #include "libnfs-zdr.h"
++#include "libnfs.h"
++#include "libnfs-raw.h"
++#include "libnfs-private.h"
+
+ struct opaque_auth _null_auth;
+
+--
+2.0.0
+
diff --git a/net-fs/libnfs/libnfs-1.3.0.ebuild b/net-fs/libnfs/libnfs-1.3.0.ebuild
new file mode 100644
index 00000000000..141bcda85f7
--- /dev/null
+++ b/net-fs/libnfs/libnfs-1.3.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit autotools
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/sahlberg/libnfs.git"
+ inherit git-2
+else
+ SRC_URI="https://github.com/sahlberg/${PN}/tarball/${P} -> ${P}.tgz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="client library for accessing NFS shares over a network"
+HOMEPAGE="https://github.com/sahlberg/libnfs"
+
+LICENSE="LGPL-2.1 GPL-3"
+SLOT="0"
+IUSE="static-libs"
+
+RDEPEND="net-libs/libtirpc"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_unpack() {
+ default
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ else
+ mv sahlberg-libnfs-* "${S}" || die
+ fi
+}
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --enable-tirpc \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/net-fs/libnfs/libnfs-1.5.0.ebuild b/net-fs/libnfs/libnfs-1.5.0.ebuild
new file mode 100644
index 00000000000..50d1ea8287c
--- /dev/null
+++ b/net-fs/libnfs/libnfs-1.5.0.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/sahlberg/libnfs.git"
+ inherit git-2 autotools
+else
+ SRC_URI="mirror://github/sahlberg/${PN}/${P}.tar.gz"
+ KEYWORDS="amd64 x86"
+fi
+
+DESCRIPTION="client library for accessing NFS shares over a network"
+HOMEPAGE="https://github.com/sahlberg/libnfs"
+
+LICENSE="LGPL-2.1 GPL-3"
+SLOT="0"
+IUSE="static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_unpack() {
+ default
+ [[ ${PV} == "9999" ]] && git-2_src_unpack
+}
+
+src_prepare() {
+ [[ ${PV} == "9999" ]] && eautoreconf
+ epatch "${FILESDIR}"/${PN}-1.5.0-headers.patch
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/net-fs/libnfs/libnfs-1.8.0.ebuild b/net-fs/libnfs/libnfs-1.8.0.ebuild
new file mode 100644
index 00000000000..c0d608d32e9
--- /dev/null
+++ b/net-fs/libnfs/libnfs-1.8.0.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF="1"
+
+inherit eutils
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/sahlberg/libnfs.git"
+ inherit git-2 autotools-utils
+else
+ SRC_URI="https://github.com/sahlberg/${PN}/archive/${P}.tar.gz"
+ KEYWORDS="amd64 ~arm x86"
+ inherit autotools-utils
+fi
+
+DESCRIPTION="Client library for accessing NFS shares over a network"
+HOMEPAGE="https://github.com/sahlberg/libnfs"
+
+LICENSE="LGPL-2.1 GPL-3"
+SLOT="0"
+IUSE="examples static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}-${P}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.0-headers.patch
+ "${FILESDIR}"/${PN}-1.8.0-makefile.patch
+)
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ # --enable-examples configure switch just compiles them
+ # better install sources instead
+ exeinto /usr/share/doc/${PF}/examples/
+ for program in $(grep PROGRAMS examples/Makefile.am | cut -d= -f2); do
+ doexe examples/${program}.c
+ done
+ fi
+}
diff --git a/net-fs/libnfs/libnfs-1.9.5.ebuild b/net-fs/libnfs/libnfs-1.9.5.ebuild
new file mode 100644
index 00000000000..872cc882e54
--- /dev/null
+++ b/net-fs/libnfs/libnfs-1.9.5.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF="1"
+
+inherit eutils
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/sahlberg/libnfs.git"
+ inherit git-2 autotools-utils
+else
+ SRC_URI="https://github.com/sahlberg/${PN}/archive/${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm hppa ppc ppc64 x86"
+ inherit autotools-utils
+fi
+
+DESCRIPTION="Client library for accessing NFS shares over a network"
+HOMEPAGE="https://github.com/sahlberg/libnfs"
+
+LICENSE="LGPL-2.1 GPL-3"
+SLOT="0"
+IUSE="examples static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}-${P}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.9.5-headers.patch
+ "${FILESDIR}"/${PN}-1.9.5-implicit-internal.patch
+)
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ # --enable-examples configure switch just compiles them
+ # better install sources instead
+ exeinto /usr/share/doc/${PF}/examples/
+ for program in $(grep PROGRAMS examples/Makefile.am | cut -d= -f2); do
+ doexe examples/${program}.c
+ done
+ fi
+}
diff --git a/net-fs/libnfs/libnfs-1.9.7.ebuild b/net-fs/libnfs/libnfs-1.9.7.ebuild
new file mode 100644
index 00000000000..e88e2111e9d
--- /dev/null
+++ b/net-fs/libnfs/libnfs-1.9.7.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF="1"
+
+inherit eutils
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/sahlberg/libnfs.git"
+ inherit git-2 autotools-utils
+else
+ SRC_URI="https://github.com/sahlberg/${PN}/archive/${P}.tar.gz"
+ KEYWORDS="amd64 arm arm64 hppa ia64 m68k mips ppc ppc64 s390 sh x86"
+ inherit autotools-utils
+fi
+
+DESCRIPTION="Client library for accessing NFS shares over a network"
+HOMEPAGE="https://github.com/sahlberg/libnfs"
+
+LICENSE="LGPL-2.1 GPL-3"
+SLOT="0/8" # sub-slot matches SONAME major
+IUSE="examples static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}-${P}"
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ # --enable-examples configure switch just compiles them
+ # better install sources instead
+ exeinto /usr/share/doc/${PF}/examples/
+ for program in $(grep PROGRAMS examples/Makefile.am | cut -d= -f2); do
+ doexe examples/${program}.c
+ done
+ fi
+}
diff --git a/net-fs/libnfs/libnfs-9999.ebuild b/net-fs/libnfs/libnfs-9999.ebuild
new file mode 100644
index 00000000000..4a178ff1830
--- /dev/null
+++ b/net-fs/libnfs/libnfs-9999.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF="1"
+
+inherit eutils
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/sahlberg/libnfs.git"
+ inherit git-2 autotools-utils
+else
+ SRC_URI="https://github.com/sahlberg/${PN}/archive/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~x86"
+ inherit autotools-utils
+fi
+
+DESCRIPTION="Client library for accessing NFS shares over a network"
+HOMEPAGE="https://github.com/sahlberg/libnfs"
+
+LICENSE="LGPL-2.1 GPL-3"
+SLOT="0/8" # sub-slot matches SONAME major
+IUSE="examples static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}-${P}"
+
+src_install() {
+ autotools-utils_src_install
+ if use examples; then
+ # --enable-examples configure switch just compiles them
+ # better install sources instead
+ exeinto /usr/share/doc/${PF}/examples/
+ for program in $(grep PROGRAMS examples/Makefile.am | cut -d= -f2); do
+ doexe examples/${program}.c
+ done
+ fi
+}
diff --git a/net-fs/libnfs/metadata.xml b/net-fs/libnfs/metadata.xml
new file mode 100644
index 00000000000..b85299b685b
--- /dev/null
+++ b/net-fs/libnfs/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-fs</herd>
+ <upstream>
+ <remote-id type="github">sahlberg/libnfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-fs/metadata.xml b/net-fs/metadata.xml
new file mode 100644
index 00000000000..e419bebd83b
--- /dev/null
+++ b/net-fs/metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The net-fs category contains network filesystem packages.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie net-fs enthült Netzwerkdateisysteme.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría net-fs contiene paquetes de sistemas de ficheros en red.
+ </longdescription>
+ <longdescription lang="ja">
+ net-fsカテゴリーにはネットワーク・ファイルシステムのパッケージが含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De net-fs categorie bevat netwerk-bestandssystemen.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm net-fs chứa các gói hệ tập tin mạng.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria net-fs contiene pacchetti per i filesystem di rete.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria net-fs contém pacotes para sistemas de arquivos de
+ rede.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria net-fs zawiera pakiety związane z NFS, sieciowym systemem
+ plików.
+ </longdescription>
+</catmetadata>
+
diff --git a/net-fs/ncpfs/Manifest b/net-fs/ncpfs/Manifest
new file mode 100644
index 00000000000..3f9672aebb4
--- /dev/null
+++ b/net-fs/ncpfs/Manifest
@@ -0,0 +1 @@
+DIST ncpfs-2.2.6.tar.gz 2100545 SHA256 2837046046bcdb46d77a80c1d17dbfd15e878700e879edab4cda9f080e0337f9 SHA512 51f85eaae85deb66cea2ff434974699f6aa45ed1ed75217ef6176ac0b7d0f9f1c4fb186afc64c1b495474d5bad9ac7614033128c0bec39c05de723a9b29c8602 WHIRLPOOL c0d4cca71fb3921e39fc6def9932d5a2500a65c7ca60f15ee09eef25637f7653df489c1947b9880f5c4eb3fab11cba663b8604fad8989170b3a74994cd4eb847
diff --git a/net-fs/ncpfs/files/ipx.confd b/net-fs/ncpfs/files/ipx.confd
new file mode 100644
index 00000000000..8bbf9f5e606
--- /dev/null
+++ b/net-fs/ncpfs/files/ipx.confd
@@ -0,0 +1,28 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Config file for /etc/init.d/ipx
+
+# Automatically selecting a primary interface.
+IPX_AUTO_PRIMARY=on
+
+# Automatically creating interfaces.
+IPX_AUTO_INTERFACE=on
+
+# Interface to which IPX sockets are bound.
+IPX_DEVICE=eth0
+
+# The IPX frame type to use.
+# Valid values are: 802.2, 802.3, SNAP, & EtherII.
+IPX_FRAME=802.2
+
+# Create a special kind of IPX interface that does not
+# have a physical device or frame type.
+IPX_INTERNAL_NET=no
+
+# Network number
+IPX_NETNUM=1
+
+# Node number
+IPX_NODENUM=1
diff --git a/net-fs/ncpfs/files/ipx.init b/net-fs/ncpfs/files/ipx.init
new file mode 100644
index 00000000000..fffd62810ef
--- /dev/null
+++ b/net-fs/ncpfs/files/ipx.init
@@ -0,0 +1,42 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#NB: Config is in /etc/conf.d/ipx
+
+depend() {
+ need net netmount
+}
+
+start() {
+ local retval=0
+
+ ebegin "Bringing IPX up"
+ if [ ${IPX_INTERNAL_NET} = "yes" ]
+ then
+ /usr/bin/ipx_internal_net add ${IPX_NETNUM} ${IPX_NODENUM}
+ retval=$?
+ else
+ /usr/bin/ipx_interface add -p ${IPX_DEVICE} \
+ ${IPX_FRAME} ${IPX_NETNUM}
+ retval=$?
+ fi
+
+ /usr/bin/ipx_configure \
+ --auto_primary=${IPX_AUTO_PRIMARY} \
+ --auto_interface=${IPX_AUTO_INTERFACE}
+ retval=$(( $retval + $? ))
+ eend ${retval} "Failed to bring IPX up"
+}
+
+stop() {
+ local retval=0
+
+ ebegin "Bringing IPX down"
+ /usr/bin/ipx_configure --auto_primary=off --auto_interface=off
+ retval=$?
+ /usr/bin/ipx_interface delall
+ retval=$(( $retval + $? ))
+ eend ${retval} "Failed to down IPX"
+}
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.5-php.patch b/net-fs/ncpfs/files/ncpfs-2.2.5-php.patch
new file mode 100644
index 00000000000..f0143b2ceeb
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.5-php.patch
@@ -0,0 +1,16 @@
+--- contrib/php/build/rules.mk.orig 2004-12-09 13:01:04.417854240 +0000
++++ contrib/php/build/rules.mk 2004-12-09 13:01:42.460070944 +0000
+@@ -63,10 +63,10 @@
+
+ install-modules:
+ @test -d modules && \
+- $(mkinstalldirs) $(moduledir) && \
+- echo "installing shared modules into $(moduledir)" && \
++ $(mkinstalldirs) $(DESTDIR)/$(moduledir) && \
++ echo "installing shared modules into $(DESTDIR)/$(moduledir)" && \
+ rm -f modules/*.la && \
+- cp modules/* $(moduledir) || true
++ cp modules/* $(DESTDIR)/$(moduledir) || true
+
+ include $(builddir)/.deps
+
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-align-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-align-fix.patch
new file mode 100644
index 00000000000..2ec8f29e946
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-align-fix.patch
@@ -0,0 +1,12 @@
+diff -Naurp ncpfs-2.2.6.orig/lib/ndslib.c ncpfs-2.2.6/lib/ndslib.c
+--- ncpfs-2.2.6.orig/lib/ndslib.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/lib/ndslib.c 2014-08-12 21:07:35.559190454 -0400
+@@ -957,7 +957,7 @@ static NWDSCCODE nds_beginauth2(
+ NWDSCCODE err;
+ int n1, n3;
+ u_int16_t n3a;
+- char rpb_b[DEFAULT_MESSAGE_LEN];
++ char rpb_b[DEFAULT_MESSAGE_LEN] __attribute__ ((aligned (4)));
+ Buf_T rpb;
+ size_t k1tl;
+
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-drop-kernel-check.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-drop-kernel-check.patch
new file mode 100644
index 00000000000..9e42f79fe16
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-drop-kernel-check.patch
@@ -0,0 +1,31 @@
+Description: Drop kernel version check
+Author: Bastian Blank <waldi@debian.org>
+Bug-Debian: http://bugs.debian.org/692472
+
+--- ncpfs-2.2.6.orig/sutil/ncpm_common.c
++++ ncpfs-2.2.6/sutil/ncpm_common.c
+@@ -243,23 +243,6 @@ static int load_ncpfs(void)
+ #endif /* MOUNT2 */
+
+ static int getmountver(void) {
+- struct utsname name;
+- int maj, mid, rev;
+- int ver;
+-
+- if (uname(&name)) {
+- errexit(1, _("Cannot get kernel release\n"));
+- }
+- if (sscanf(name.release, "%d.%d.%d", &maj, &mid, &rev) != 3) {
+- errexit(2, _("Cannot convert kernel release \"%s\" to number\n"), name.release);
+- }
+- ver = maj*0x10000 + mid*0x100 + rev;
+- if (ver < 0x20100)
+- return 2;
+- if (ver < 0x20328)
+- return 3;
+- if (ver < 0x2051F)
+- return 4;
+ return 5;
+ }
+
+
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-drop-mtab-support.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-drop-mtab-support.patch
new file mode 100644
index 00000000000..c4588371afa
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-drop-mtab-support.patch
@@ -0,0 +1,269 @@
+diff -Naurp ncpfs-2.2.6.orig/sutil/ncplogin.c ncpfs-2.2.6/sutil/ncplogin.c
+--- ncpfs-2.2.6.orig/sutil/ncplogin.c 2014-08-13 02:52:56.859067273 -0400
++++ ncpfs-2.2.6/sutil/ncplogin.c 2014-08-13 02:53:42.699067001 -0400
+@@ -111,7 +111,6 @@
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <sys/mount.h>
+-#include <mntent.h>
+ #include <ncp/kernel/ipx.h>
+ #include <sys/ioctl.h>
+ #ifdef CONFIG_NATIVE_UNIX
+@@ -935,12 +934,6 @@ ncpipx:;
+ }
+ NWCCCloseConn(conn);
+ NWDSFreeContext(ctx);
+- /* ncpmap, ncplogin must write in /etc/mtab */
+- {
+- block_sigs();
+- add_mnt_entry(mount_name, mount_point, info.flags);
+- unblock_sigs();
+- }
+ free(mount_name);
+ if (info.echo_mnt_pnt) {
+ printf(_("mounted on:%s\n"),mount_point);
+diff -Naurp ncpfs-2.2.6.orig/sutil/ncpm_common.c ncpfs-2.2.6/sutil/ncpm_common.c
+--- ncpfs-2.2.6.orig/sutil/ncpm_common.c 2014-08-13 02:52:56.959067273 -0400
++++ ncpfs-2.2.6/sutil/ncpm_common.c 2014-08-13 02:55:38.349066313 -0400
+@@ -104,7 +104,6 @@
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <sys/mount.h>
+-#include <mntent.h>
+ #include <ncp/kernel/ipx.h>
+ #include <sys/ioctl.h>
+ #if MOUNT3
+@@ -1423,68 +1422,6 @@ static const struct smntflags {
+ {MS_NODIRATIME, "nodiratime"},
+ {0, NULL}};
+
+-void add_mnt_entry(char* mount_name, char* mpnt, unsigned long flags) {
+- const struct smntflags* sf;
+- char mnt_opts[80];
+- char* p;
+- struct mntent ment;
+- int fd;
+- FILE* mtab;
+-
+- if (check_name(mount_name) == -1 || check_name(mpnt) == -1)
+- errexit(107, _("Illegal character in mount entry\n"));
+-
+- ment.mnt_fsname = mount_name;
+- ment.mnt_dir = mpnt;
+- ment.mnt_type = (char*)"ncpfs";
+- ment.mnt_opts = mnt_opts;
+- ment.mnt_freq = 0;
+- ment.mnt_passno = 0;
+-
+- p = mnt_opts;
+- *p++ = 'r';
+- *p++ = (flags & MS_RDONLY)?'o':'w';
+- for (sf = mntflags; sf->flag; sf++) {
+- if (flags & sf->flag) {
+- *p++ = ',';
+- strcpy(p, sf->name);
+- p += strlen(p);
+- }
+- }
+- *p = 0;
+-
+- if (ncpm_suser()) {
+- errexit(91, _("Cannot switch to superuser: %s\n"), strerror(errno));
+- }
+- if ((fd = open(MOUNTED "~", O_RDWR | O_CREAT | O_EXCL, 0600)) == -1)
+- {
+- errexit(58, _("Can't get %s~ lock file\n"), MOUNTED);
+- }
+- close(fd);
+-
+- if ((mtab = setmntent(MOUNTED, "a+")) == NULL)
+- {
+- errexit(59, _("Can't open %s\n"), MOUNTED);
+- }
+- if (addmntent(mtab, &ment) == 1)
+- {
+- errexit(60, _("Can't write mount entry\n"));
+- }
+- if (fchmod(fileno(mtab), 0644) == -1)
+- {
+- errexit(61, _("Can't set perms on %s\n"), MOUNTED);
+- }
+- endmntent(mtab);
+-
+- if (unlink(MOUNTED "~") == -1)
+- {
+- errexit(62, _("Can't remove %s~\n"), MOUNTED);
+- }
+- if (ncpm_normal()) {
+- errexit(90, _("Cannot relinquish superuser rights: %s\n"), strerror(EPERM));
+- }
+-}
+-
+ static int __proc_option(const struct optinfo* opts, struct ncp_mount_info* info, const char* opt, const char* param) {
+ const struct optinfo* optr;
+
+diff -Naurp ncpfs-2.2.6.orig/sutil/ncpm_common.h ncpfs-2.2.6/sutil/ncpm_common.h
+--- ncpfs-2.2.6.orig/sutil/ncpm_common.h 2014-08-13 02:52:56.749067274 -0400
++++ ncpfs-2.2.6/sutil/ncpm_common.h 2014-08-13 02:53:42.699067001 -0400
+@@ -60,7 +60,6 @@ void verify_argv(int argc, char* argv[])
+ int ncp_mount_specific(struct ncp_conn* conn, int pathNS, const unsigned char* NWpath, int pathlen);
+ int mount_ok(struct stat *st);
+ void mycom_err(int, const char*, ...);
+-void add_mnt_entry(char* mount_name, char* mpoint, unsigned long flags);
+
+ struct ncp_mount_info {
+ struct ncp_mount_data_independent mdata;
+diff -Naurp ncpfs-2.2.6.orig/sutil/ncpmount.c ncpfs-2.2.6/sutil/ncpmount.c
+--- ncpfs-2.2.6.orig/sutil/ncpmount.c 2014-08-13 02:52:56.749067274 -0400
++++ ncpfs-2.2.6/sutil/ncpmount.c 2014-08-13 02:53:42.699067001 -0400
+@@ -114,7 +114,6 @@
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <sys/mount.h>
+-#include <mntent.h>
+ #include <ncp/kernel/ipx.h>
+ #include <ncp/nwclient.h>
+ #include <sys/ioctl.h>
+@@ -719,11 +718,6 @@ ncpipx:;
+ }
+ ncp_close(conn);
+
+- if (!opt_n) {
+- block_sigs();
+- add_mnt_entry(mount_name, mount_point, info.flags);
+- unblock_sigs();
+- }
+ return 0;
+ }
+
+diff -Naurp ncpfs-2.2.6.orig/sutil/ncpumount.c ncpfs-2.2.6/sutil/ncpumount.c
+--- ncpfs-2.2.6.orig/sutil/ncpumount.c 2014-08-13 02:52:56.749067274 -0400
++++ ncpfs-2.2.6/sutil/ncpumount.c 2014-08-13 02:55:10.369066480 -0400
+@@ -179,108 +179,6 @@ static void enableAlarm(void) {
+ sigprocmask(SIG_UNBLOCK, &sa.sa_mask, NULL);
+ }
+
+-static int __clearMtab (const char* mount_points[], unsigned int numEntries) {
+-// main logic from ncpumount.c
+- struct mntent *mnt;
+- FILE *mtab;
+- FILE *new_mtab;
+-
+-#define MOUNTED_TMP MOUNTED".tmp"
+-
+- if ((mtab = setmntent(MOUNTED, "r")) == NULL){
+- eprintf(_("Can't open %s: %s\n"), MOUNTED,
+- strerror(errno));
+- return 1;
+- }
+-
+- if ((new_mtab = setmntent(MOUNTED_TMP, "w")) == NULL){
+- eprintf(_("Can't open %s: %s\n"), MOUNTED_TMP,
+- strerror(errno));
+- endmntent(mtab);
+- return 1;
+- }
+- while ((mnt = getmntent(mtab)) != NULL) {
+- unsigned int i=0;
+- int found=0;
+-
+- while (i<numEntries && !found) {
+- found=!strcmp(mnt->mnt_dir, mount_points[i]);
+- i++;
+- }
+- if (!found) {
+- addmntent(new_mtab, mnt);
+- }
+- }
+-
+- endmntent(mtab);
+-
+- if (fchmod(fileno(new_mtab), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0){
+- eprintf(_("Error changing mode of %s: %s\n"),
+- MOUNTED_TMP, strerror(errno));
+- return 1;
+- }
+- endmntent(new_mtab);
+-
+- if (rename(MOUNTED_TMP, MOUNTED) < 0){
+- eprintf(_("Cannot rename %s to %s: %s\n"),
+- MOUNTED, MOUNTED_TMP, strerror(errno));
+- return 1;
+- }
+- return 0;
+-}
+-
+-static int clearMtab (const char* mount_points[], unsigned int numEntries) {
+- int fd;
+- int err;
+- int retries = 10;
+-
+- if (!numEntries)
+- return 0; /* don't waste time ! */
+-
+- block_sigs();
+-
+- while ((fd = open(MOUNTED "~", O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) {
+- struct timespec tm;
+-
+- if (errno != EEXIST || retries == 0) {
+- unblock_sigs();
+- eprintf(_("Can't get %s~ lock file: %s\n"), MOUNTED, strerror(errno));
+- return 1;
+- }
+- fd = open(MOUNTED "~", O_RDWR);
+- if (fd != -1) {
+- alarm(10);
+- err = lockf(fd, F_LOCK, 0);
+- alarm(0);
+- close(fd);
+- if (err) {
+- unblock_sigs();
+- eprintf(_("Can't lock lock file %s~: %s\n"), MOUNTED, _("Lock timed out"));
+- return 1;
+- }
+- tm.tv_sec = 0;
+- tm.tv_nsec = 20000000;
+- nanosleep(&tm, NULL);
+- }
+- retries--;
+- }
+- alarm(1);
+- lockf(fd, F_LOCK, 0);
+- alarm(0);
+- close(fd);
+-
+- err = __clearMtab(mount_points, numEntries);
+-
+- if ((unlink(MOUNTED "~") == -1) && (err == 0)){
+- unblock_sigs();
+- eprintf(_("Can't remove %s~"), MOUNTED);
+- return 1;
+- }
+- unblock_sigs();
+- return err;
+-}
+-
+-
+ int ncp_mnt_umount(const char *abs_mnt, const char *rel_mnt)
+ {
+ if (umount(rel_mnt) != 0) {
+@@ -617,10 +515,6 @@ static int old_ncpumount(int argc, char
+ ret = 1;
+ continue;
+ }
+- if (clearMtab(&mount_point, 1)) {
+- ret = 1;
+- continue;
+- }
+ }
+ return ret;
+ }
+@@ -739,7 +633,6 @@ main(int argc, char *argv[])
+ if (serverName || allConns) {
+ processBindServers(conns,curEntries,serverName,umountTable,&mountEntries);
+ }
+- clearMtab(umountTable, mountEntries);
+ } else if (treeName) {
+ eprintf(_("No NCP connections to tree %s.\n"),treeName);
+ } else if (serverName) {
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-gcc4.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-gcc4.patch
new file mode 100644
index 00000000000..7223b232c60
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-gcc4.patch
@@ -0,0 +1,36 @@
+diff -ur ncpfs-2.2.6-orig/lib/ncplib.c ncpfs-2.2.6/lib/ncplib.c
+--- ncpfs-2.2.6-orig/lib/ncplib.c 2006-01-13 16:55:05.000000000 -0500
++++ ncpfs-2.2.6/lib/ncplib.c 2006-01-13 16:56:08.000000000 -0500
+@@ -2421,7 +2421,7 @@
+ int i = 1;
+ NWCCODE nwerr;
+
+- static int get_argument(int arg_no, const char **target) {
++ int get_argument(int arg_no, const char **target) {
+ int count = 1;
+
+ if (target != NULL) {
+diff -ur ncpfs-2.2.6-orig/util/nwpjmv.c ncpfs-2.2.6/util/nwpjmv.c
+--- ncpfs-2.2.6-orig/util/nwpjmv.c 2006-01-13 16:55:05.000000000 -0500
++++ ncpfs-2.2.6/util/nwpjmv.c 2006-01-13 16:55:50.000000000 -0500
+@@ -131,7 +131,7 @@
+ char *s = q->command;
+ char *target_end = target + target_size;
+
+- static void add_string(const char *str)
++ void add_string(const char *str)
+ {
+ int len = strlen(str);
+ if (target + len + 1 > target_end)
+diff -ur ncpfs-2.2.6-orig/util/pserver.c ncpfs-2.2.6/util/pserver.c
+--- ncpfs-2.2.6-orig/util/pserver.c 2006-01-13 16:55:05.000000000 -0500
++++ ncpfs-2.2.6/util/pserver.c 2006-01-13 16:55:36.000000000 -0500
+@@ -153,7 +153,7 @@
+ char *s = q->command;
+ char *target_end = target + target_size;
+
+- static void add_string(const char *str)
++ void add_string(const char *str)
+ {
+ int len = strlen(str);
+ if (target + len + 1 > target_end)
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-getuid-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-getuid-fix.patch
new file mode 100644
index 00000000000..8b58a1375d9
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-getuid-fix.patch
@@ -0,0 +1,124 @@
+diff -Naurp ncpfs-2.2.6.orig/contrib/tcl-utils/chgpwd.c ncpfs-2.2.6/contrib/tcl-utils/chgpwd.c
+--- ncpfs-2.2.6.orig/contrib/tcl-utils/chgpwd.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/contrib/tcl-utils/chgpwd.c 2014-08-12 21:08:25.779190155 -0400
+@@ -292,12 +292,12 @@ int main(int argc, char *argv[]) {
+ }
+ } else {
+ if (!treeName[0]) {
+- NWCXGetPreferredDSTree(treeName,sizeof(treeName));
++ dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+
+ }
+ if (!treeName[0]) {
+ fprintf(stderr,"failed: You must specify a server or a tree\n");
+- dserr=114;
++ /*dserr=114;*/
+ goto finished;
+ }
+
+diff -Naurp ncpfs-2.2.6.orig/contrib/tcl-utils/ncplist.c ncpfs-2.2.6/contrib/tcl-utils/ncplist.c
+--- ncpfs-2.2.6.orig/contrib/tcl-utils/ncplist.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/contrib/tcl-utils/ncplist.c 2014-08-12 21:08:25.779190155 -0400
+@@ -299,7 +299,12 @@ int main(int argc, char *argv[]) {
+ }else {
+
+ if (!treeName[0]) {
+- NWCXGetPreferredDSTree(treeName,sizeof(treeName));
++ dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
++ if (dserr){
++ fprintf(stderr, "failed: Cannot get preffered DS tree: %s\n",
++ strnwerror(dserr);
++ exit(106);
++ }
+
+ }
+ if (!treeName[0]) {
+diff -Naurp ncpfs-2.2.6.orig/contrib/tcl-utils/ncpreadprop.c ncpfs-2.2.6/contrib/tcl-utils/ncpreadprop.c
+--- ncpfs-2.2.6.orig/contrib/tcl-utils/ncpreadprop.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/contrib/tcl-utils/ncpreadprop.c 2014-08-12 21:08:25.779190155 -0400
+@@ -470,7 +470,7 @@ main(int argc, char *argv[])
+ }
+ } else {
+ if (!treeName[0]) {
+- NWCXGetPreferredDSTree(treeName,sizeof(treeName));
++ dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+
+ }
+ if (!treeName[0]) {
+diff -Naurp ncpfs-2.2.6.orig/contrib/tcl-utils/ncpreadprops.c ncpfs-2.2.6/contrib/tcl-utils/ncpreadprops.c
+--- ncpfs-2.2.6.orig/contrib/tcl-utils/ncpreadprops.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/contrib/tcl-utils/ncpreadprops.c 2014-08-12 21:08:25.779190155 -0400
+@@ -507,7 +507,7 @@ main(int argc, char *argv[])
+ }
+ } else {
+ if (!treeName[0]) {
+- NWCXGetPreferredDSTree(treeName,sizeof(treeName));
++ dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName));
+
+ }
+ if (!treeName[0]) {
+diff -Naurp ncpfs-2.2.6.orig/lib/nwclient.c ncpfs-2.2.6/lib/nwclient.c
+--- ncpfs-2.2.6.orig/lib/nwclient.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/lib/nwclient.c 2014-08-12 21:08:25.779190155 -0400
+@@ -481,6 +481,10 @@ static char* readnwinfosfile (char * use
+ *err = EACCES;
+ return NULL;
+ }
++ if (st.st_uid != getuid()) {
++ *err = EACCES;
++ return NULL;
++ }
+ if ((st.st_mode & (S_IRWXO | S_IRWXG)) != 0) {
+ *err = NCPLIB_INVALID_MODE;
+ return NULL;
+@@ -560,7 +564,7 @@ NWDSCCODE NWCXGetPreferredDSTree (NWD
+ if (!res)
+ res=readnwinfosfile (NULL,NDS_PREFERRED_TREE,NULL, &err);
+ if (!res)
+- return -1;
++ return err;
+ if (strlen (res)+1 >maxLen)
+ return NWE_BUFFER_OVERFLOW;
+ strcpy(preferTree,res);
+@@ -581,7 +585,7 @@ NWDSCCODE NWCXGetDefaultNameContext (con
+ if (!res)
+ res=readnwinfosfile (NULL,NDS_PREFERRED_NAME_CTX,forTree,&err);
+ if (!res)
+- return -1;
++ return err;
+ if (strlen (res)+1 >maxLen)
+ return NWE_BUFFER_OVERFLOW;
+ strcpy(nameContext,res);
+@@ -603,7 +607,7 @@ NWDSCCODE NWCXGetPreferredServer (con
+
+ res=readnwinfosfile (NULL, NDS_PREFERRED_SERVER, forTree, &err);
+ if (!res) {
+- return -1;
++ return err;
+ }
+ }
+ /* test that this server DO belongs to tree forTree*/
+@@ -644,7 +648,7 @@ NWDSCCODE NWCXGetDefaultUserName (const
+ if (!res)
+ res=readnwinfosfile (NULL,NDS_USER,forTree, &err);
+ if (!res)
+- return -1;
++ return err;
+ if (strlen (res)+1 >maxLen)
+ return NWE_BUFFER_OVERFLOW;
+ strcpy(defaultName,res);
+diff -Naurp ncpfs-2.2.6.orig/sutil/ncplogin.c ncpfs-2.2.6/sutil/ncplogin.c
+--- ncpfs-2.2.6.orig/sutil/ncplogin.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/sutil/ncplogin.c 2014-08-12 21:08:25.779190155 -0400
+@@ -588,7 +588,10 @@ main(int argc, char *argv[])
+ int flags = 0;
+
+ if (!info.tree) {
+- NWCXGetPreferredDSTree(ntree, sizeof(ntree));
++ err=NWCXGetPreferredDSTree(ntree, sizeof(ntree));
++ if (err){
++ errexit(104, _("Cannot get preffered DS tree: %s\n"),strnwerror(err));
++ }
+ info.tree = ntree;
+ }
+
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-ldflags-support.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-ldflags-support.patch
new file mode 100644
index 00000000000..613fd120f07
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-ldflags-support.patch
@@ -0,0 +1,153 @@
+diff -Naurp ncpfs-2.2.6.orig/contrib/pam/Makefile.in ncpfs-2.2.6/contrib/pam/Makefile.in
+--- ncpfs-2.2.6.orig/contrib/pam/Makefile.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/contrib/pam/Makefile.in 2014-08-12 21:06:42.369190770 -0400
+@@ -17,6 +17,7 @@ PAM_LIBRARY = pam_ncp_auth.so
+ PAM_OBJECTS = pam_ncp_auth.do support.do
+
+ CFLAGS_pam_ncp_auth.do := -DNCPMOUNT_PATH=\"$(bindir)/ncpmount\" -DNCPUMOUNT_PATH=\"$(bindir)/ncpumount\"
++LDFLAGS = @LDFLAGS@
+
+ .PHONY : all install install-dev dep clean mrproper distclean
+ .PHONY : default
+@@ -45,7 +46,7 @@ $(PAM_OBJECTS): %.do: %.c
+
+
+ $(PAM_LIBRARY): $(PAM_OBJECTS)
+- $(CC) $(CFLAGS) -shared -o $@ $(PAM_OBJECTS) -L$(NCPLIB_DIR) -lncp -lpam ${LIBS}
++ $(CC) $(CFLAGS) -shared $(LDFLAGS) -o $@ $(PAM_OBJECTS) -L$(NCPLIB_DIR) -lncp -lpam ${LIBS}
+
+ dep:
+
+diff -Naurp ncpfs-2.2.6.orig/ipx-1.0/Makefile.in ncpfs-2.2.6/ipx-1.0/Makefile.in
+--- ncpfs-2.2.6.orig/ipx-1.0/Makefile.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/ipx-1.0/Makefile.in 2014-08-12 21:06:42.369190770 -0400
+@@ -9,6 +9,7 @@ vpath %.c ${this_srcdir}
+ vpath %.8 ${this_srcdir}
+
+ LIBS = @INTLLIBS@ @LIBS@
++LDFLAGS = @LDFLAGS@
+
+ O_UTILS = ipx_configure.o ipx_cmd.o
+ O_UTIIPX = ipx_interface.o ipx_internal_net.o ipx_route.o
+@@ -33,7 +34,7 @@ $(ALL_OBJECTS): %.o: %.c
+ [ -s $@ ] || rm -f $@
+
+ $(UTIIPX): %: %.o ipxutil.o
+- $(CC) $(CFLAGS) -o $@ $(addsuffix .o,$@) ipxutil.o ${LIBS}
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(addsuffix .o,$@) ipxutil.o ${LIBS}
+
+ $(UTILS): %: %.o
+ $(CC) $(CFLAGS) -o $@ $(addsuffix .o,$@) ${LIBS}
+diff -Naurp ncpfs-2.2.6.orig/ipxdump/Makefile.in ncpfs-2.2.6/ipxdump/Makefile.in
+--- ncpfs-2.2.6.orig/ipxdump/Makefile.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/ipxdump/Makefile.in 2014-08-12 21:06:42.369190770 -0400
+@@ -11,6 +11,7 @@ ncp_if_ether_support = @ncp_if_ether_sup
+ OBJECTS= ipxutil.o
+
+ ALL_OBJECTS := $(EXEC:%=%.o) $(OBJECTS)
++LDFLAGS = @LDFLAGS@
+
+ .PHONY : all install dep clean mrproper distclean
+ .PHONY : dist tgz
+@@ -24,7 +25,7 @@ install: $(EXEC)
+ ifeq ($(ncp_if_ether_support),yes)
+
+ $(EXEC): %: %.o $(OBJECTS)
+- $(CC) $(CFLAGS) -o $@ $(addsuffix .o,$@) $(OBJECTS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(addsuffix .o,$@) $(OBJECTS)
+
+ else
+ .PHONY ipxdump ipxparse
+diff -Naurp ncpfs-2.2.6.orig/lib/Makefile.in ncpfs-2.2.6/lib/Makefile.in
+--- ncpfs-2.2.6.orig/lib/Makefile.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/lib/Makefile.in 2014-08-12 21:06:42.369190770 -0400
+@@ -23,6 +23,7 @@ STATIC_NCPLIB_BIN := $(STATIC_NCPLIB)
+ CCFLAGS += -I.
+ PIC_FLAGS := -fPIC
+ NWCOMPAT := 1
++LDFLAGS := @LDFLAGS@
+
+ SHARED_VLINK :=
+ SHARED_VLINK_CFLAGS :=
+@@ -122,7 +123,7 @@ $(SHARED_NCPLIB): $(SHARED_NCPLIB_BIN)
+ ln -sf $< $@
+
+ $(SHARED_NCPLIB_BIN): $(SHARED_O_OBJ) ${this_srcdir}/libncp.vers
+- $(CC) -shared -o $@ -Wl,-soname=$(SHARED_NCPLIB_SONAME) $(SHARED_VLINK) $(SHARED_O_OBJ) ${LIBS} -lc
++ $(CC) -shared -o $@ -Wl,-soname=$(SHARED_NCPLIB_SONAME) $(LDFLAGS) $(SHARED_VLINK) $(SHARED_O_OBJ) ${LIBS} -lc
+
+ install_static: $(STATIC_NCPLIB_BIN)
+ $(INSTALL) -d $(DESTDIR)$(libadir)
+diff -Naurp ncpfs-2.2.6.orig/Make.rules.in ncpfs-2.2.6/Make.rules.in
+--- ncpfs-2.2.6.orig/Make.rules.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/Make.rules.in 2014-08-12 21:06:42.369190770 -0400
+@@ -42,6 +42,7 @@ CFLAGS_OPTIONS += $(CWARN)
+ CFLAGS_DEFINES := -DN_PLAT_LINUX -DLOCALEDIR=\"${localedir}\" -DNCPFS_VERSION=\"${VERSION}\" -DNCPFS_PACKAGE=\"${PACKAGE}\"
+
+ CCFLAGS := $(CFLAGS_DEFINES) $(CFLAGS_OPTIONS) $(INCLUDES)
++LDFLAGS := @LDFLAGS@
+
+ # If your system is ELF, either also do a 'make install', or append the util/
+ # directory where the dynamic library resides to the environment
+diff -Naurp ncpfs-2.2.6.orig/sutil/Makefile.in ncpfs-2.2.6/sutil/Makefile.in
+--- ncpfs-2.2.6.orig/sutil/Makefile.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/sutil/Makefile.in 2014-08-12 21:06:42.369190770 -0400
+@@ -14,6 +14,7 @@ USE_KERNEL = @USE_KERNEL@
+ NDS_SUPPORT = @NDS_SUPPORT@
+
+ LIBS = @INTLLIBS@ @LIBS@
++LDFLAGS := @LDFLAGS@
+
+ # environ in ncpmount
+ CCFLAGS += -D_GNU_SOURCE
+@@ -69,7 +70,7 @@ $(O_UTILS:.o=.d): %.d: %.c
+ [ -s $@ ] || rm -f $@
+
+ ncpmap.o: %.o: ncplogin.c
+- $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
++ $(CC) $(CFLAGS) $(LDFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
+
+ ncpmap.d: %.d: ncplogin.c
+ set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \
+@@ -85,7 +86,7 @@ ncpm_common.d mount_login.d: %.d: %.c
+ [ -s $@ ] || rm -f $@
+
+ $(UTILS): %: %.o ../lib/libncp.a ncpm_common.o mount_login.o
+- $(CC) @GC_SECTIONS@-o $@ $(addsuffix .o,$@) $(LDFLAGS_$@) ../lib/libncp.a ${LIBS}
++ $(CC) @GC_SECTIONS@-o $@ $(addsuffix .o,$@) $(LDFLAGS) $(LDFLAGS_$@) ../lib/libncp.a ${LIBS}
+
+ ../lib/libncp.a:
+ make -C ../lib libncp.a
+diff -Naurp ncpfs-2.2.6.orig/util/Makefile.in ncpfs-2.2.6/util/Makefile.in
+--- ncpfs-2.2.6.orig/util/Makefile.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/util/Makefile.in 2014-08-12 21:06:42.369190770 -0400
+@@ -15,6 +15,7 @@ NDS_SUPPORT = @NDS_SUPPORT@
+ MOUNT2 = @MOUNT2@
+
+ LIBS = @INTLLIBS@ @LIBS@
++LDFLAGS = @LDFLAGS@
+
+ O_OTHER = dsqueue.o
+ O_USERUTILS = slist.o pqlist.o nwfsinfo.o pserver.o nprint.o nsend.o \
+@@ -83,7 +84,7 @@ install-dev:
+ make -C ../lib libncp.so
+
+ $(O_USERUTILS) $(O_SBINUTILS) $(O_OTHER) ncptest.o: %.o: %.c
+- $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
++ $(CC) $(CFLAGS) $(LDFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
+
+ %.d: %.c
+ set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \
+@@ -94,10 +95,10 @@ $(O_USERUTILS) $(O_SBINUTILS) $(O_OTHER)
+ pqstat nwpqjob nprint: dsqueue.o
+
+ $(UTILS): %: %.o $(LIBDEP)
+- $(CC) $(CFLAGS) -o $@ $(addsuffix .o,$@) $(ADDOBJS_$@) -L$(NCPLIB_DIR) -lncp ${LIBS}
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(addsuffix .o,$@) $(ADDOBJS_$@) -L$(NCPLIB_DIR) -lncp ${LIBS}
+
+ ipx_probe: ipx_probe.c
+- $(CC) $(CFLAGS) $(CCFLAGS) -o ipx_probe ipx_probe.c ${LIBS}
++ $(CC) $(CFLAGS) $(LDFLAGS) $(CCFLAGS) -o ipx_probe ipx_probe.c ${LIBS}
+
+ dep:
+
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-makefile-fix-soname-link.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-makefile-fix-soname-link.patch
new file mode 100644
index 00000000000..240c9142476
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-makefile-fix-soname-link.patch
@@ -0,0 +1,15 @@
+diff -Naurp ncpfs-2.2.6.orig/lib/Makefile.in ncpfs-2.2.6/lib/Makefile.in
+--- ncpfs-2.2.6.orig/lib/Makefile.in 2014-08-12 23:23:27.149141996 -0400
++++ ncpfs-2.2.6/lib/Makefile.in 2014-08-12 23:23:55.969141824 -0400
+@@ -99,9 +99,10 @@ distclean: mrproper
+ install_shared: $(SHARED_NCPLIB_BIN)
+ $(INSTALL) -d $(DESTDIR)$(libsodir)
+ $(INSTALL) $(SHARED_NCPLIB_BIN) $(DESTDIR)$(libsodir)
++ ln -sf $(SHARED_NCPLIB_BIN) $(DESTDIR)$(libsodir)/$(SHARED_NCPLIB)
++ ln -sf $(SHARED_NCPLIB_BIN) $(DESTDIR)$(libsodir)/$(SHARED_NCPLIB_SONAME)
+
+ install-dev: install_shared install_static
+- ln -sf $(SHARED_NCPLIB_SONAME) $(DESTDIR)$(libsodir)/$(SHARED_NCPLIB)
+ $(INSTALL) -d $(DESTDIR)$(includedir)/ncp
+ $(INSTALL) -d $(DESTDIR)$(includedir)/ncp/ext
+ $(INSTALL) -d $(DESTDIR)$(includedir)/ncp/kernel
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-missing-includes.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-missing-includes.patch
new file mode 100644
index 00000000000..11a4f87add4
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-missing-includes.patch
@@ -0,0 +1,22 @@
+diff -ruN ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c ncpfs-2.2.6-fixed/contrib/pam/pam_ncp_auth.c
+--- ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c 2005-01-27 18:35:59.000000000 +0100
++++ ncpfs-2.2.6-fixed/contrib/pam/pam_ncp_auth.c 2007-05-11 21:38:05.143474750 +0200
+@@ -257,6 +257,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <syslog.h>
+ #include <unistd.h>
+ #include <pwd.h>
+ #include <grp.h>
+diff -ruN ncpfs-2.2.6/sutil/ncpm_common.c ncpfs-2.2.6-fixed/sutil/ncpm_common.c
+--- ncpfs-2.2.6/sutil/ncpm_common.c 2005-01-27 18:35:59.000000000 +0100
++++ ncpfs-2.2.6-fixed/sutil/ncpm_common.c 2007-05-11 21:38:29.609003750 +0200
+@@ -82,6 +82,7 @@
+
+ #include "ncpm_common.h"
+
++#include <stddef.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <signal.h>
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-multiple-vulns.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-multiple-vulns.patch
new file mode 100644
index 00000000000..a43c6ea0054
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-multiple-vulns.patch
@@ -0,0 +1,557 @@
+From: Dan Rosenberg <dan.j.rosenberg () gmail com>
+Date: Fri, 5 Mar 2010 12:06:01 -0500
+
+============================================
+ ncpfs, Multiple Vulnerabilities
+ March 5, 2010
+ CVE-2010-0788, CVE-2010-0790, CVE-2010-0791
+============================================
+
+==Description==
+
+The ncpmount, ncpumount, and ncplogin utilities, installed as part of the ncpfs
+package, contain several vulnerabilities.
+
+1. ncpmount, ncpumount, and ncplogin are vulnerable to race conditions that
+allow a local attacker to unmount arbitrary mountpoints, causing
+denial-of-service, or mount Netware shares to arbitrary directories,
+potentially leading to root compromise. This issue was formerly assigned
+CVE-2009-3297, but has since been re-assigned CVE-2010-0788 to avoid overlap
+with related bugs in other packages.
+
+2. ncpumount is vulnerable to an information disclosure vulnerability that
+allows a local attacker to verify the existence of arbitrary files, violating
+directory permissions. This issue has been assigned CVE-2010-0790.
+
+3. ncpmount, ncpumount, and ncplogin create lockfiles insecurely, allowing a
+local attacker to leave a stale lockfile at /etc/mtab~, causing other mount
+utilities to fail and creating denial-of-service conditions. This issue has
+been assigned CVE-2010-0791.
+
+==Workaround==
+
+If unprivileged users do not need the ability to mount and unmount Netware
+shares, then the suid bit should be removed from these utilities.
+
+==Solution==
+
+A patch has been released that resolves these issues (attached to this
+advisory). ncpfs-2.2.6.partial.patch is intended for ncpfs releases that have
+already been patched against the first vulnerability in this report
+(CVE-2010-0788, formerly CVE-2009-3297). It has been tested against the latest
+ncpfs packages distributed by Fedora, Red Hat, and Mandriva.
+ncpfs-2.2.6.full.patch is intended for ncpfs releases that have not been
+patched against any of these vulnerabilities. It has been tested against the
+latest ncpfs packages distributed by Debian, Ubuntu, and the upstream release
+(ftp://platan.vc.cvut.cz/pub/linux/ncpfs/).
+
+Users are advised to recompile from source, or request updated packages from
+downstream distributors.
+
+==Credits==
+
+These vulnerabilities were discovered by Dan Rosenberg
+(dan.j.rosenberg () gmail com).
+Thanks to Vitezslav Crhonek for the patch against the first issue.
+
+==References==
+
+CVE identifiers CVE-2010-0788, CVE-2010-0790, and CVE-2010-0791 have been
+assigned to these issues.
+
+http://seclists.org/fulldisclosure/2010/Mar/122
+
+
+diff -ur ncpfs-2.2.6.orig/sutil/ncplogin.c ncpfs-2.2.6/sutil/ncplogin.c
+--- ncpfs-2.2.6.orig/sutil/ncplogin.c 2010-03-03 16:18:59.000000000 -0500
++++ ncpfs-2.2.6/sutil/ncplogin.c 2010-03-03 16:17:41.000000000 -0500
+@@ -934,7 +934,9 @@
+ NWDSFreeContext(ctx);
+ /* ncpmap, ncplogin must write in /etc/mtab */
+ {
++ block_sigs();
+ add_mnt_entry(mount_name, mount_point, info.flags);
++ unblock_sigs();
+ }
+ free(mount_name);
+ if (info.echo_mnt_pnt) {
+diff -ur ncpfs-2.2.6.orig/sutil/ncpm_common.c ncpfs-2.2.6/sutil/ncpm_common.c
+--- ncpfs-2.2.6.orig/sutil/ncpm_common.c 2010-03-03 16:18:59.000000000 -0500
++++ ncpfs-2.2.6/sutil/ncpm_common.c 2010-03-03 16:17:41.000000000 -0500
+@@ -360,7 +360,7 @@
+ #endif
+
+ static inline int ncpm_suser(void) {
+- return setreuid(-1, 0);
++ return setresuid(0, 0, myuid);
+ }
+
+ static int ncpm_normal(void) {
+@@ -368,11 +368,31 @@
+ int v;
+
+ e = errno;
+- v = setreuid(-1, myuid);
++ v = setresuid(myuid, myuid, 0);
+ errno = e;
+ return v;
+ }
+
++void block_sigs(void) {
++
++ sigset_t mask, orig_mask;
++ sigfillset(&mask);
++
++ if(sigprocmask(SIG_SETMASK, &mask, &orig_mask) < 0) {
++ errexit(-1, _("Blocking signals failed.\n"));
++ }
++}
++
++void unblock_sigs(void) {
++
++ sigset_t mask, orig_mask;
++ sigemptyset(&mask);
++
++ if (sigprocmask(SIG_SETMASK, &mask, &orig_mask) < 0) {
++ errexit(-1, _("Un-blocking signals failed.\n"));
++ }
++}
++
+ static int proc_ncpm_mount(const char* source, const char* target, const char* filesystem, unsigned long mountflags, const void* data) {
+ int v;
+ int e;
+@@ -444,7 +464,7 @@
+ }
+ datav2.file_mode = data->file_mode;
+ datav2.dir_mode = data->dir_mode;
+- err = proc_ncpm_mount(mount_name, data->mount_point, "ncpfs", flags, (void*) &datav2);
++ err = proc_ncpm_mount(mount_name, ".", "ncpfs", flags, (void*) &datav2);
+ if (err)
+ return errno;
+ return 0;
+@@ -508,7 +528,7 @@
+ exit(0); /* Should not return from process_connection */
+ }
+ close(pp[0]);
+- err=proc_ncpm_mount(mount_name, data->mount_point, "ncpfs", flags, (void*) &datav3);
++ err=proc_ncpm_mount(mount_name, ".", "ncpfs", flags, (void*) &datav3);
+ if (err) {
+ err = errno;
+ /* Mount unsuccesful so we have to kill daemon */
+@@ -559,7 +579,7 @@
+ sprintf(mountopts, "version=%u,flags=%u,owner=%u,uid=%u,gid=%u,mode=%u,dirmode=%u,timeout=%u,retry=%u,wdogpid=%u,ncpfd=%u,infofd=%u",
+ NCP_MOUNT_VERSION_V5, ncpflags, data->mounted_uid, data->uid, data->gid, data->file_mode,
+ data->dir_mode, data->time_out, data->retry_count, wdog_pid, data->ncp_fd, pp[1]);
+- err=proc_ncpm_mount(mount_name, data->mount_point, "ncpfs", flags, mountopts);
++ err=proc_ncpm_mount(mount_name, ".", "ncpfs", flags, mountopts);
+ } else {
+ err=-1;
+ }
+@@ -577,7 +597,7 @@
+ datav4.file_mode = data->file_mode;
+ datav4.dir_mode = data->dir_mode;
+ datav4.wdog_pid = wdog_pid;
+- err = proc_ncpm_mount(mount_name, data->mount_point, "ncpfs", flags, (void*)&datav4);
++ err = proc_ncpm_mount(mount_name, ".", "ncpfs", flags, (void*)&datav4);
+ if (err) {
+ err = errno;
+ /* Mount unsuccesful so we have to kill daemon */
+@@ -1395,6 +1415,17 @@
+ }
+ #endif /* MOUNT3 */
+
++static int check_name(const char *name)
++{
++ char *s;
++ for (s = "\n\t\\"; *s; s++) {
++ if (strchr(name, *s)) {
++ return -1;
++ }
++ }
++ return 0;
++}
++
+ static const struct smntflags {
+ unsigned int flag;
+ const char* name;
+@@ -1416,6 +1447,9 @@
+ int fd;
+ FILE* mtab;
+
++ if (check_name(mount_name) == -1 || check_name(mpnt) == -1)
++ errexit(107, _("Illegal character in mount entry\n"));
++
+ ment.mnt_fsname = mount_name;
+ ment.mnt_dir = mpnt;
+ ment.mnt_type = (char*)"ncpfs";
+diff -ur ncpfs-2.2.6.orig/sutil/ncpm_common.h ncpfs-2.2.6/sutil/ncpm_common.h
+--- ncpfs-2.2.6.orig/sutil/ncpm_common.h 2010-03-03 16:18:59.000000000 -0500
++++ ncpfs-2.2.6/sutil/ncpm_common.h 2010-03-03 16:17:41.000000000 -0500
+@@ -121,6 +121,9 @@
+ int proc_aftermount(const struct ncp_mount_info* info, NWCONN_HANDLE* conn);
+ int proc_ncpm_umount(const char* dir);
+
++void block_sigs(void);
++void unblock_sigs(void);
++
+ #define UNUSED(x) x __attribute__((unused))
+
+ #endif /* __NCPM_COMMON_H__ */
+diff -ur ncpfs-2.2.6.orig/sutil/ncpmount.c ncpfs-2.2.6/sutil/ncpmount.c
+--- ncpfs-2.2.6.orig/sutil/ncpmount.c 2010-03-03 16:18:59.000000000 -0500
++++ ncpfs-2.2.6/sutil/ncpmount.c 2010-03-03 16:17:41.000000000 -0500
+@@ -359,11 +359,17 @@
+ usage();
+ return -1;
+ }
++
+ realpath(argv[optind], mount_point);
+
+- if (stat(mount_point, &st) == -1)
++ if (chdir(mount_point))
++ {
++ errexit(31, _("Could not change directory into mount target %s: %s\n"),
++ mount_point, strerror(errno));
++ }
++ if (stat(".", &st) == -1)
+ {
+- errexit(31, _("Could not find mount point %s: %s\n"),
++ errexit(31, _("Mount point %s does not exist: %s\n"),
+ mount_point, strerror(errno));
+ }
+ if (mount_ok(&st) != 0)
+@@ -714,7 +720,9 @@
+ ncp_close(conn);
+
+ if (!opt_n) {
++ block_sigs();
+ add_mnt_entry(mount_name, mount_point, info.flags);
++ unblock_sigs();
+ }
+ return 0;
+ }
+diff -ur ncpfs-2.2.6.orig/sutil/ncpumount.c ncpfs-2.2.6/sutil/ncpumount.c
+--- ncpfs-2.2.6.orig/sutil/ncpumount.c 2010-03-03 16:18:59.000000000 -0500
++++ ncpfs-2.2.6/sutil/ncpumount.c 2010-03-03 16:17:41.000000000 -0500
+@@ -70,13 +70,24 @@
+ #include <mntent.h>
+ #include <pwd.h>
+
++#include <sched.h>
++
+ #include "private/libintl.h"
+
+ #define _(X) X
+
++#ifndef MS_REC
++#define MS_REC 16384
++#endif
++#ifndef MS_SLAVE
++#define MS_SLAVE (1<<19)
++#endif
++
+ static char *progname;
+ static int is_ncplogout = 0;
+
++uid_t uid;
++
+ static void
+ usage(void)
+ {
+@@ -117,6 +128,40 @@
+ va_end(ap);
+ }
+
++/* Mostly copied from ncpm_common.c */
++void block_sigs(void) {
++
++ sigset_t mask, orig_mask;
++ sigfillset(&mask);
++ sigdelset(&mask, SIGALRM); /* Need SIGALRM for ncpumount */
++
++ if(setresuid(0, 0, uid) < 0) {
++ eprintf("Failed to raise privileges.\n");
++ exit(-1);
++ }
++
++ if(sigprocmask(SIG_SETMASK, &mask, &orig_mask) < 0) {
++ eprintf("Blocking signals failed.\n");
++ exit(-1);
++ }
++}
++
++void unblock_sigs(void) {
++
++ sigset_t mask, orig_mask;
++ sigemptyset(&mask);
++
++ if(setresuid(uid, uid, 0) < 0) {
++ eprintf("Failed to drop privileges.\n");
++ exit(-1);
++ }
++
++ if(sigprocmask(SIG_SETMASK, &mask, &orig_mask) < 0) {
++ eprintf("Un-blocking signals failed.\n");
++ exit(-1);
++ }
++}
++
+ static void alarmSignal(int sig) {
+ (void)sig;
+ }
+@@ -192,10 +237,13 @@
+ if (!numEntries)
+ return 0; /* don't waste time ! */
+
++ block_sigs();
++
+ while ((fd = open(MOUNTED "~", O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) {
+ struct timespec tm;
+
+ if (errno != EEXIST || retries == 0) {
++ unblock_sigs();
+ eprintf(_("Can't get %s~ lock file: %s\n"), MOUNTED, strerror(errno));
+ return 1;
+ }
+@@ -206,6 +254,7 @@
+ alarm(0);
+ close(fd);
+ if (err) {
++ unblock_sigs();
+ eprintf(_("Can't lock lock file %s~: %s\n"), MOUNTED, _("Lock timed out"));
+ return 1;
+ }
+@@ -223,26 +272,205 @@
+ err = __clearMtab(mount_points, numEntries);
+
+ if ((unlink(MOUNTED "~") == -1) && (err == 0)){
++ unblock_sigs();
+ eprintf(_("Can't remove %s~"), MOUNTED);
+ return 1;
+ }
++ unblock_sigs();
+ return err;
+ }
+
++
++int ncp_mnt_umount(const char *abs_mnt, const char *rel_mnt)
++{
++ if (umount(rel_mnt) != 0) {
++ eprintf(_("Could not umount %s: %s\n"),
++ abs_mnt, strerror(errno));
++ return -1;
++ }
++ return 0;
++}
++
++
++static int check_is_mount_child(void *p)
++{
++ const char **a = p;
++ const char *last = a[0];
++ const char *mnt = a[1];
++ int res;
++ const char *procmounts = "/proc/mounts";
++ int found;
++ FILE *fp;
++ struct mntent *entp;
++
++ res = mount("", "/", "", MS_SLAVE | MS_REC, NULL);
++ if (res == -1) {
++ eprintf(_("Failed to mark mounts slave: %s\n"),
++ strerror(errno));
++ return 1;
++ }
++
++ res = mount(".", "/tmp", "", MS_BIND | MS_REC, NULL);
++ if (res == -1) {
++ eprintf(_("Failed to bind parent to /tmp: %s\n"),
++ strerror(errno));
++ return 1;
++ }
++
++ fp = setmntent(procmounts, "r");
++ if (fp == NULL) {
++ eprintf(_("Failed to open %s: %s\n"),
++ procmounts, strerror(errno));
++ return 1;
++ }
++
++ found = 0;
++ while ((entp = getmntent(fp)) != NULL) {
++ if (strncmp(entp->mnt_dir, "/tmp/", 5) == 0 &&
++ strcmp(entp->mnt_dir + 5, last) == 0) {
++ found = 1;
++ break;
++ }
++ }
++ endmntent(fp);
++
++ if (!found) {
++ eprintf(_("%s not mounted\n"), mnt);
++ return 1;
++ }
++
++ return 0;
++}
++
++
++static int check_is_mount(const char *last, const char *mnt)
++{
++ char buf[131072];
++ pid_t pid, p;
++ int status;
++ const char *a[2] = { last, mnt };
++
++ pid = clone(check_is_mount_child, buf + 65536, CLONE_NEWNS, (void *) a);
++ if (pid == (pid_t) -1) {
++ eprintf(_("Failed to clone namespace: %s\n"),
++ strerror(errno));
++ return -1;
++ }
++ p = waitpid(pid, &status, __WCLONE);
++ if (p == (pid_t) -1) {
++ eprintf(_("Waitpid failed: %s\n"),
++ strerror(errno));
++ return -1;
++ }
++ if (!WIFEXITED(status)) {
++ eprintf(_("Child terminated abnormally (status %i)\n"),
++ status);
++ return -1;
++ }
++ if (WEXITSTATUS(status) != 0)
++ return -1;
++
++ return 0;
++}
++
++
++static int chdir_to_parent(char *copy, const char **lastp, int *currdir_fd)
++{
++ char *tmp;
++ const char *parent;
++ char buf[PATH_MAX];
++ int res;
++
++ tmp = strrchr(copy, '/');
++ if (tmp == NULL || tmp[1] == '\0') {
++ eprintf(_("Internal error: invalid abs path: <%s>\n"),
++ copy);
++ return -1;
++ }
++ if (tmp != copy) {
++ *tmp = '\0';
++ parent = copy;
++ *lastp = tmp + 1;
++ } else if (tmp[1] != '\0') {
++ *lastp = tmp + 1;
++ parent = "/";
++ } else {
++ *lastp = ".";
++ parent = "/";
++ }
++ *currdir_fd = open(".", O_RDONLY);
++ if (*currdir_fd == -1) {
++ eprintf(_("Failed to open current directory: %s\n"),
++ strerror(errno));
++ return -1;
++ }
++ res = chdir(parent);
++ if (res == -1) {
++ eprintf(_("Failed to chdir to %s: %s\n"),
++ parent, strerror(errno));
++ return -1;
++ }
++ if (getcwd(buf, sizeof(buf)) == NULL) {
++ eprintf(_("Failed to obtain current directory: %s\n"),
++ strerror(errno));
++ return -1;
++ }
++ if (strcmp(buf, parent) != 0) {
++ eprintf(_("Mountpoint moved (%s -> %s)\n"),
++ parent, buf);
++ return -1;
++
++ }
++
++ return 0;
++}
++
++
++static int unmount_ncp(const char *mount_point)
++{
++ int currdir_fd = -1;
++ char *copy;
++ const char *last;
++ int res;
++
++ copy = strdup(mount_point);
++ if (copy == NULL) {
++ eprintf(_("Failed to allocate memory\n"));
++ return -1;
++ }
++ res = chdir_to_parent(copy, &last, &currdir_fd);
++ if (res == -1)
++ goto out;
++ res = check_is_mount(last, mount_point);
++ if (res == -1)
++ goto out;
++ res = ncp_mnt_umount(mount_point, last);
++
++out:
++ free(copy);
++ if (currdir_fd != -1) {
++ fchdir(currdir_fd);
++ close(currdir_fd);
++ }
++
++ return res;
++}
++
+ static int
+ do_umount(const char *mount_point)
+ {
+ int fid = open(mount_point, O_RDONLY, 0);
+ uid_t mount_uid;
++ int res;
+
+ if (fid == -1) {
+- eprintf(_("Could not open %s: %s\n"),
+- mount_point, strerror(errno));
++ eprintf(_("Invalid or unauthorized mountpoint %s\n"),
++ mount_point);
+ return -1;
+ }
+ if (ncp_get_mount_uid(fid, &mount_uid) != 0) {
+ close(fid);
+- eprintf(_("%s probably not ncp-filesystem\n"),
++ eprintf(_("Invalid or unauthorized mountpoint %s\n"),
+ mount_point);
+ return -1;
+ }
+@@ -253,12 +481,8 @@
+ return -1;
+ }
+ close(fid);
+- if (umount(mount_point) != 0) {
+- eprintf(_("Could not umount %s: %s\n"),
+- mount_point, strerror(errno));
+- return -1;
+- }
+- return 0;
++ res = unmount_ncp(mount_point);
++ return res;
+ }
+
+
+@@ -409,7 +633,8 @@
+ int allConns = 0;
+ const char *serverName = NULL;
+ const char *treeName = NULL;
+- uid_t uid = getuid();
++
++ uid = getuid();
+
+ progname = strrchr(argv[0], '/');
+ if (progname) {
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-no-suid-root.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-no-suid-root.patch
new file mode 100644
index 00000000000..050de30b86b
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-no-suid-root.patch
@@ -0,0 +1,16 @@
+Description: Don't install utils as suid root
+Author: Bastian Blank <waldi@debian.org>
+Bug-Debian: http://bugs.debian.org/692929
+
+--- ncpfs-2.2.6.orig/sutil/Makefile.in
++++ ncpfs-2.2.6/sutil/Makefile.in
+@@ -51,7 +51,7 @@ all: $(UTILS)
+ install: all
+ ${INSTALL} -d $(DESTDIR)$(bindir)
+ ${INSTALL} -d $(DESTDIR)/sbin
+- ${INSTALL} -m 4755 $(UTILS) $(DESTDIR)$(bindir)
++ ${INSTALL} $(UTILS) $(DESTDIR)$(bindir)
+ ifeq ($(USE_KERNEL),1)
+ ln -sf $(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncp
+ ln -sf $(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncpfs
+
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-pam_ncp_auth-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-pam_ncp_auth-fix.patch
new file mode 100644
index 00000000000..2a9e0edd4b2
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-pam_ncp_auth-fix.patch
@@ -0,0 +1,12 @@
+diff -Naurp ncpfs-2.2.6.orig/contrib/pam/pam_ncp_auth.c ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c
+--- ncpfs-2.2.6.orig/contrib/pam/pam_ncp_auth.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c 2014-08-12 21:02:33.229192251 -0400
+@@ -2534,7 +2534,7 @@ nw_retrieve_nds_user_info(struct nw_user
+ bailoutctx:;
+ NWDSFreeContext(ctx);
+ bailout:;
+- if (!err & (ui->qflag & QF_DEBUG))
++ if ((!err) && (ui->qflag & QF_DEBUG))
+ syslog(LOG_NOTICE, "%u %u %s %s %s\n", ui->uid, ui->gid, ui->dir, ui->gecos, ui->shell);
+ return err;
+ }
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-pie-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-pie-fix.patch
new file mode 100644
index 00000000000..779991808ed
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-pie-fix.patch
@@ -0,0 +1,31 @@
+diff -Naurp ncpfs-2.2.6.orig/lib/Makefile.in ncpfs-2.2.6/lib/Makefile.in
+--- ncpfs-2.2.6.orig/lib/Makefile.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/lib/Makefile.in 2014-08-12 21:05:24.349191234 -0400
+@@ -57,7 +57,7 @@ NDS_CFLAGS := $(BASE_CFLAGS) -DPORTABLE
+ CFLAGS_ncplib.o := -DNWSFIND=\"$(bindir)/nwsfind\"
+ CFLAGS_cfgfile.o := -DGLOBALCFGFILE=\"$(sysconfdir)/ncpfs.conf\"
+
+-STATIC_CFLAGS := $(CFLAGS) $(CCFLAGS) $(REENTRANT_CFLAGS) @FFUNCTION_SECTIONS@
++STATIC_CFLAGS := $(CFLAGS) $(CCFLAGS) $(REENTRANT_CFLAGS) $(PIC_FLAGS) @FFUNCTION_SECTIONS@
+ SHARED_CFLAGS := $(CFLAGS) $(CCFLAGS) $(REENTRANT_CFLAGS) $(PIC_FLAGS) $(SHARED_VLINK_CFLAGS)
+
+ .PHONY : all dep install install-dev clean mrproper distclean
+diff -Naurp ncpfs-2.2.6.orig/sutil/Makefile.in ncpfs-2.2.6/sutil/Makefile.in
+--- ncpfs-2.2.6.orig/sutil/Makefile.in 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/sutil/Makefile.in 2014-08-12 21:05:24.349191234 -0400
+@@ -34,11 +34,12 @@ endif
+
+ CFLAGS_ncpmount.o = -DNCPMOUNT=1 -DMAKE_NCPLIB
+ CFLAGS_ncpmap.o = -DNCPMAP=1 -DMAKE_NCPLIB
+-CFLAGS_ncplogin.o = -DMAKE_NCPLIB
++CFLAGS_ncplogin.o = -DMAKE_NCPLIB
+ CFLAGS_ncpm_common.o = -DNWMSG=\"$(sbindir)/nwmsg\"
+ LDFLAGS_ncpmount = ncpm_common.o mount_login.o
+-LDFLAGS_ncplogin = ncpm_common.o mount_login.o
+-LDFLAGS_ncpmap = ncpm_common.o
++LDFLAGS_ncplogin = -pie ncpm_common.o mount_login.o
++LDFLAGS_ncpmap = -pie ncpm_common.o
++LDFLAGS_nwsfind = -pie
+
+ .PHONY : all install install-dev dep clean mrproper distclean
+ .PHONY : default
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-remove-libncp_atomic-header.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-remove-libncp_atomic-header.patch
new file mode 100644
index 00000000000..22768817045
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-remove-libncp_atomic-header.patch
@@ -0,0 +1,15 @@
+Description: Remove another generated file
+Author: Bastian Blank <waldi@debian.org>
+Bug-Debian: http://bugs.debian.org/692471
+
+--- ncpfs-2.2.6.orig/Makefile.in
++++ ncpfs-2.2.6/Makefile.in
+@@ -71,6 +71,7 @@ distclean:
+ rm -f intl/Makefile po/Makefile po/Makefile.in
+ rm -f lib/Makefile man/Makefile sutil/Makefile util/Makefile
+ rm -f include/config.h
++ rm -f include/private/libncp-atomic.h
+ rm -f include/ncp/ext/socket.h include/ncp/ext/stdint.h
+ rm -f include/ncp/kernel/fs.h
+ rm -f include/ncp/kernel/if.h include/ncp/kernel/route.h include/ncp/kernel/types.h
+
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-remove-packed-attrib.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-remove-packed-attrib.patch
new file mode 100644
index 00000000000..40267c72871
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-remove-packed-attrib.patch
@@ -0,0 +1,297 @@
+diff -Naurp ncpfs-2.2.6.orig//include/ncp/ipxlib.h ncpfs-2.2.6//include/ncp/ipxlib.h
+--- ncpfs-2.2.6.orig//include/ncp/ipxlib.h 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6//include/ncp/ipxlib.h 2011-02-10 02:38:18.822076000 -0500
+@@ -64,12 +64,12 @@ struct sap_query
+ struct sap_server_ident
+ {
+ u_int16_t server_type __attribute__((packed));
+- char server_name[48] __attribute__((packed));
++ char server_name[48];
+ IPXNet server_network __attribute__((packed));
+ #ifdef SWIG
+ u_int8_t server_node[6] __attribute__((packed));
+ #else
+- IPXNode server_node __attribute__((packed));
++ IPXNode server_node;
+ #endif
+ IPXPort server_port __attribute__((packed));
+ u_int16_t intermediate_network __attribute__((packed));
+@@ -87,7 +87,7 @@ struct ipx_rt_def {
+ struct ipx_rip_packet
+ {
+ u_int16_t operation __attribute__((packed));
+- struct ipx_rt_def rt[1] __attribute__((packed));
++ struct ipx_rt_def rt[1];
+ };
+
+ #ifdef SWIG
+diff -Naurp ncpfs-2.2.6.orig//include/ncp/kernel/ncp.h ncpfs-2.2.6//include/ncp/kernel/ncp.h
+--- ncpfs-2.2.6.orig//include/ncp/kernel/ncp.h 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6//include/ncp/kernel/ncp.h 2011-02-10 02:38:18.822076000 -0500
+@@ -53,12 +53,12 @@
+
+ struct ncp_request_header {
+ u_int16_t type __attribute__((packed));
+- u_int8_t sequence __attribute__((packed));
+- u_int8_t conn_low __attribute__((packed));
+- u_int8_t task __attribute__((packed));
+- u_int8_t conn_high __attribute__((packed));
+- u_int8_t function __attribute__((packed));
+- u_int8_t data[0] __attribute__((packed));
++ u_int8_t sequence;
++ u_int8_t conn_low;
++ u_int8_t task;
++ u_int8_t conn_high;
++ u_int8_t function;
++ u_int8_t data[0];
+ };
+
+ #define NCP_REPLY (0x3333)
+@@ -66,13 +66,13 @@ struct ncp_request_header {
+
+ struct ncp_reply_header {
+ u_int16_t type __attribute__((packed));
+- u_int8_t sequence __attribute__((packed));
+- u_int8_t conn_low __attribute__((packed));
+- u_int8_t task __attribute__((packed));
+- u_int8_t conn_high __attribute__((packed));
+- u_int8_t completion_code __attribute__((packed));
+- u_int8_t connection_state __attribute__((packed));
+- u_int8_t data[0] __attribute__((packed));
++ u_int8_t sequence;
++ u_int8_t conn_low;
++ u_int8_t task;
++ u_int8_t conn_high;
++ u_int8_t completion_code;
++ u_int8_t connection_state;
++ u_int8_t data[0];
+ };
+
+ #define NCP_VOLNAME_LEN (16)
+@@ -230,8 +230,8 @@ struct nw_info_struct {
+ u_int32_t EAKeyCount __attribute__((packed));
+ u_int32_t EAKeySize __attribute__((packed));
+ u_int32_t NSCreator __attribute__((packed));
+- u_int8_t nameLen __attribute__((packed));
+- u_int8_t entryName[256] __attribute__((packed));
++ u_int8_t nameLen;
++ u_int8_t entryName[256];
+ };
+ #endif
+
+@@ -282,13 +282,13 @@ struct nw_file_info {
+ int opened;
+ int access;
+ u_int32_t server_file_handle __attribute__((packed));
+- u_int8_t open_create_action __attribute__((packed));
+- u_int8_t file_handle[6] __attribute__((packed));
++ u_int8_t open_create_action;
++ u_int8_t file_handle[6];
+ };
+ #endif
+
+ struct nw_search_sequence {
+- u_int8_t volNumber __attribute__((packed));
++ u_int8_t volNumber;
+ u_int32_t dirBase __attribute__((packed));
+ u_int32_t sequence __attribute__((packed));
+ };
+diff -Naurp ncpfs-2.2.6.orig//include/ncp/ncp.h ncpfs-2.2.6//include/ncp/ncp.h
+--- ncpfs-2.2.6.orig//include/ncp/ncp.h 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6//include/ncp/ncp.h 2011-02-10 02:38:18.822076000 -0500
+@@ -95,7 +95,7 @@ struct prop_net_address {
+ #ifdef SWIG
+ fixedArray node[IPX_NODE_LEN];
+ #else
+- u_int8_t node[IPX_NODE_LEN] __attribute__((packed));
++ u_int8_t node[IPX_NODE_LEN];
+ #endif
+ u_int16_t port __attribute__((packed));
+ };
+@@ -163,20 +163,20 @@ struct nw_queue_job_entry {
+ u_int32_t ClientTask __attribute__((packed));
+ u_int32_t ClientObjectID __attribute__((packed));
+ u_int32_t TargetServerID __attribute__((packed));
+- u_int8_t TargetExecTime[6] __attribute__((packed));
+- u_int8_t JobEntryTime[6] __attribute__((packed));
++ u_int8_t TargetExecTime[6];
++ u_int8_t JobEntryTime[6];
+ u_int32_t JobNumber __attribute__((packed));
+ u_int16_t JobType __attribute__((packed));
+ u_int16_t JobPosition __attribute__((packed));
+ u_int16_t JobControlFlags __attribute__((packed));
+- u_int8_t FileNameLen __attribute__((packed));
+- char JobFileName[13] __attribute__((packed));
++ u_int8_t FileNameLen;
++ char JobFileName[13];
+ u_int32_t JobFileHandle __attribute__((packed));
+ u_int32_t ServerStation __attribute__((packed));
+ u_int32_t ServerTaskNumber __attribute__((packed));
+ u_int32_t ServerObjectID __attribute__((packed));
+- char JobTextDescription[50] __attribute__((packed));
+- char ClientRecordArea[152] __attribute__((packed));
++ char JobTextDescription[50];
++ char ClientRecordArea[152];
+ };
+
+ struct queue_job {
+@@ -217,18 +217,18 @@ struct print_job_record {
+ };
+ #else
+ struct print_job_record {
+- u_int8_t Version __attribute__((packed));
+- u_int8_t TabSize __attribute__((packed));
++ u_int8_t Version;
++ u_int8_t TabSize;
+ u_int16_t Copies __attribute__((packed));
+ u_int16_t CtrlFlags __attribute__((packed));
+ u_int16_t Lines __attribute__((packed));
+ u_int16_t Rows __attribute__((packed));
+- char FormName[16] __attribute__((packed));
+- u_int8_t Reserved[6] __attribute__((packed));
+- char BannerName[13] __attribute__((packed));
+- char FnameBanner[13] __attribute__((packed));
+- char FnameHeader[14] __attribute__((packed));
+- char Path[80] __attribute__((packed));
++ char FormName[16];
++ u_int8_t Reserved[6];
++ char BannerName[13];
++ char FnameBanner[13];
++ char FnameHeader[14];
++ char Path[80];
+ };
+ #endif
+
+diff -Naurp ncpfs-2.2.6.orig//include/ncp/ncplib.h ncpfs-2.2.6//include/ncp/ncplib.h
+--- ncpfs-2.2.6.orig//include/ncp/ncplib.h 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6//include/ncp/ncplib.h 2011-02-10 02:38:18.822076000 -0500
+@@ -462,24 +462,24 @@ struct ncp_file_server_info
+ #else
+ struct ncp_file_server_info
+ {
+- u_int8_t ServerName[48] __attribute__((packed));
+- u_int8_t FileServiceVersion __attribute__((packed));
+- u_int8_t FileServiceSubVersion __attribute__((packed));
++ u_int8_t ServerName[48];
++ u_int8_t FileServiceVersion;
++ u_int8_t FileServiceSubVersion;
+ u_int16_t MaximumServiceConnections __attribute__((packed));
+ u_int16_t ConnectionsInUse __attribute__((packed));
+ u_int16_t NumberMountedVolumes __attribute__((packed));
+- u_int8_t Revision __attribute__((packed));
+- u_int8_t SFTLevel __attribute__((packed));
+- u_int8_t TTSLevel __attribute__((packed));
++ u_int8_t Revision;
++ u_int8_t SFTLevel;
++ u_int8_t TTSLevel;
+ u_int16_t MaxConnectionsEverUsed __attribute__((packed));
+- u_int8_t AccountVersion __attribute__((packed));
+- u_int8_t VAPVersion __attribute__((packed));
+- u_int8_t QueueVersion __attribute__((packed));
+- u_int8_t PrintVersion __attribute__((packed));
+- u_int8_t VirtualConsoleVersion __attribute__((packed));
+- u_int8_t RestrictionLevel __attribute__((packed));
+- u_int8_t InternetBridge __attribute__((packed));
+- u_int8_t Reserved[60] __attribute__((packed));
++ u_int8_t AccountVersion;
++ u_int8_t VAPVersion;
++ u_int8_t QueueVersion;
++ u_int8_t PrintVersion;
++ u_int8_t VirtualConsoleVersion;
++ u_int8_t RestrictionLevel;
++ u_int8_t InternetBridge;
++ u_int8_t Reserved[60];
+ };
+ #endif
+
+@@ -592,7 +592,7 @@ struct ncp_station_addr
+ #ifdef SWIG
+ fixedArray Node[6];
+ #else
+- u_int8_t Node[6] __attribute__((packed));
++ u_int8_t Node[6];
+ #endif
+ u_int16_t Socket __attribute__((packed));
+ };
+@@ -602,32 +602,32 @@ struct ncp_prop_login_control
+ #ifdef SWIG
+ fixedArray AccountExpireDate[3];
+ #else
+- u_int8_t AccountExpireDate[3] __attribute__((packed));
++ u_int8_t AccountExpireDate[3];
+ #endif
+- u_int8_t Disabled __attribute__((packed));
++ u_int8_t Disabled;
+ #ifdef SWIG
+ fixedArray PasswordExpireDate[3];
+ #else
+- u_int8_t PasswordExpireDate[3] __attribute__((packed));
++ u_int8_t PasswordExpireDate[3];
+ #endif
+- u_int8_t GraceLogins __attribute__((packed));
++ u_int8_t GraceLogins;
+ u_int16_t PasswordExpireInterval __attribute__((packed));
+- u_int8_t MaxGraceLogins __attribute__((packed));
+- u_int8_t MinPasswordLength __attribute__((packed));
++ u_int8_t MaxGraceLogins;
++ u_int8_t MinPasswordLength;
+ u_int16_t MaxConnections __attribute__((packed));
+ #ifdef SWIG
+ fixedArray ConnectionTimeMask[42] __attribute__((packed));
+ fixedArray LastLogin[6] __attribute__((packed));
+ #else
+- u_int8_t ConnectionTimeMask[42] __attribute__((packed));
+- u_int8_t LastLogin[6] __attribute__((packed));
++ u_int8_t ConnectionTimeMask[42];
++ u_int8_t LastLogin[6];
+ #endif
+- u_int8_t RestrictionMask __attribute__((packed));
+- u_int8_t reserved __attribute__((packed));
++ u_int8_t RestrictionMask;
++ u_int8_t reserved;
+ u_int32_t MaxDiskUsage __attribute__((packed));
+ u_int16_t BadLoginCount __attribute__((packed));
+ u_int32_t BadLoginCountDown __attribute__((packed));
+- struct ncp_station_addr LastIntruder __attribute__((packed));
++ struct ncp_station_addr LastIntruder;
+ };
+
+ NWCCODE NWReadPropertyValue(NWCONN_HANDLE conn, const char *objName,
+diff -Naurp ncpfs-2.2.6.orig//ipx-1.0/ipx_cmd.c ncpfs-2.2.6//ipx-1.0/ipx_cmd.c
+--- ncpfs-2.2.6.orig//ipx-1.0/ipx_cmd.c 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6//ipx-1.0/ipx_cmd.c 2011-02-10 02:40:19.222076002 -0500
+@@ -63,8 +63,8 @@
+ /* we are doing EthernetII... Any objections? */
+ struct {
+ u_int16_t unknown __attribute__((packed));
+- u_int8_t dst[6] __attribute__((packed));
+- u_int8_t src[6] __attribute__((packed));
++ u_int8_t dst[6];
++ u_int8_t src[6];
+ u_int16_t type __attribute__((packed));
+ u_int8_t ipx[16384];
+ } buffer;
+diff -Naurp ncpfs-2.2.6.orig//lib/ncplib.c ncpfs-2.2.6//lib/ncplib.c
+--- ncpfs-2.2.6.orig//lib/ncplib.c 2011-02-10 02:38:05.000000000 -0500
++++ ncpfs-2.2.6//lib/ncplib.c 2011-02-10 02:38:18.822076000 -0500
+@@ -2584,13 +2584,13 @@ ncp_request(struct ncp_conn *conn, int f
+
+ struct nw_time_buffer
+ {
+- u_int8_t year __attribute__((packed));
+- u_int8_t month __attribute__((packed));
+- u_int8_t day __attribute__((packed));
+- u_int8_t hour __attribute__((packed));
+- u_int8_t minute __attribute__((packed));
+- u_int8_t second __attribute__((packed));
+- u_int8_t wday __attribute__((packed));
++ u_int8_t year;
++ u_int8_t month;
++ u_int8_t day;
++ u_int8_t hour;
++ u_int8_t minute;
++ u_int8_t second;
++ u_int8_t wday;
+ };
+
+ static time_t
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-servername-array-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-servername-array-fix.patch
new file mode 100644
index 00000000000..3e96aac5b36
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-servername-array-fix.patch
@@ -0,0 +1,15 @@
+diff -Naurp ncpfs-2.2.6.orig/include/ncp/ncplib.h ncpfs-2.2.6/include/ncp/ncplib.h
+--- ncpfs-2.2.6.orig/include/ncp/ncplib.h 2005-01-27 12:35:59.000000000 -0500
++++ ncpfs-2.2.6/include/ncp/ncplib.h 2014-08-12 21:01:01.159192798 -0400
+@@ -485,9 +485,9 @@ struct ncp_file_server_info
+
+ struct ncp_file_server_info_2 {
+ #ifdef SWIG
+- fixedArray ServerName[49];
++ fixedArray ServerName[50];
+ #else
+- u_int8_t ServerName[49];
++ u_int8_t ServerName[50];
+ #endif
+ u_int8_t FileServiceVersion;
+ u_int8_t FileServiceSubVersion;
diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-zend_function_entry.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-zend_function_entry.patch
new file mode 100644
index 00000000000..648cb8f7f77
--- /dev/null
+++ b/net-fs/ncpfs/files/ncpfs-2.2.6-zend_function_entry.patch
@@ -0,0 +1,11 @@
+--- a/contrib/php/php_auth_nds.c
++++ b/contrib/php/php_auth_nds.c
+@@ -1102,7 +1102,7 @@
+ php_info_print_table_end();
+ }
+
+-function_entry auth_nds_functions[] = {
++zend_function_entry auth_nds_functions[] = {
+ PHP_FE(auth_bindery, NULL)
+ PHP_FE(auth_nds, NULL)
+ PHP_FE(auth_tree, NULL)
diff --git a/net-fs/ncpfs/metadata.xml b/net-fs/ncpfs/metadata.xml
new file mode 100644
index 00000000000..55227da799d
--- /dev/null
+++ b/net-fs/ncpfs/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-fs</herd>
+ <longdescription>Provides Access to Netware services using the NCP protocol (Kernel support must be activated!)</longdescription>
+</pkgmetadata>
diff --git a/net-fs/ncpfs/ncpfs-2.2.6-r3.ebuild b/net-fs/ncpfs/ncpfs-2.2.6-r3.ebuild
new file mode 100644
index 00000000000..19a835a15fa
--- /dev/null
+++ b/net-fs/ncpfs/ncpfs-2.2.6-r3.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils pam
+
+DESCRIPTION="Provides Access to Netware services using the NCP protocol"
+HOMEPAGE="ftp://platan.vc.cvut.cz/pub/linux/ncpfs/"
+SRC_URI="ftp://platan.vc.cvut.cz/pub/linux/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips ppc ppc64 x86"
+IUSE="nls pam php"
+
+DEPEND="nls? ( sys-devel/gettext )
+ pam? ( virtual/pam )
+ php? ( || ( dev-lang/php virtual/httpd-php ) )"
+
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Add patch for PHP extension sandbox violation
+ epatch "${FILESDIR}"/${PN}-2.2.5-php.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch
+ epatch "${FILESDIR}"/${P}-missing-includes.patch
+
+ # Add a patch to fix multiple vulnerabilities.
+ # CVE-2010-0788, CVE-2010-0790, & CVE-2010-0791.
+ # http://seclists.org/fulldisclosure/2010/Mar/122
+ epatch "${FILESDIR}"/${P}-multiple-vulns.patch
+
+ # Add a patch that removes the __attribute__((packed)); directive
+ # from several struct members in include/ncp/ncplib.h. This will
+ # cut down on a large number of compile warnings generated by modern
+ # gcc releases.
+ epatch "${FILESDIR}"/${P}-remove-packed-attrib.patch
+
+ # Misc patches borrowed from Mageia.
+ epatch "${FILESDIR}"/${P}-align-fix.patch
+ epatch "${FILESDIR}"/${P}-getuid-fix.patch
+ epatch "${FILESDIR}"/${P}-pam_ncp_auth-fix.patch
+ epatch "${FILESDIR}"/${P}-servername-array-fix.patch
+
+ # Misc patches borrowed from Debian.
+ # Fixes Bug #497278
+ epatch "${FILESDIR}"/${P}-drop-kernel-check.patch
+ epatch "${FILESDIR}"/${P}-drop-mtab-support.patch
+ epatch "${FILESDIR}"/${P}-no-suid-root.patch
+ epatch "${FILESDIR}"/${P}-remove-libncp_atomic-header.patch
+
+ # Bug #273484.
+ sed -i '/ldconfig/d' lib/Makefile.in
+
+ # Support LDFLAGS.
+ epatch "${FILESDIR}"/${P}-ldflags-support.patch
+
+ # Bug 446696. This might need re-diffing if additional Makefile
+ # fixes are added.
+ epatch "${FILESDIR}"/${P}-makefile-fix-soname-link.patch
+
+ # bug 522444
+ epatch "${FILESDIR}"/${P}-zend_function_entry.patch
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable pam pam "$(getpam_mod_dir)") \
+ $(use_enable php)
+}
+
+src_install() {
+ dodir $(getpam_mod_dir) /usr/sbin /sbin
+
+ # Bug #446696.
+ #ln -s "${D}"/usr/lib64/libncp.so.2.3 "${D}"/libncp.so.2.3.0
+
+ # Install the main programs, then the headers.
+ emake DESTDIR="${D}" install || die
+ emake DESTDIR="${D}" install-dev || die
+
+ # Install a startup script in /etc/init.d and a conf file in /etc/conf.d
+ newconfd "${FILESDIR}"/ipx.confd ipx
+ newinitd "${FILESDIR}"/ipx.init ipx
+
+ # Docs
+ dodoc FAQ README
+}
diff --git a/net-fs/netatalk/Manifest b/net-fs/netatalk/Manifest
new file mode 100644
index 00000000000..19db43d2651
--- /dev/null
+++ b/net-fs/netatalk/Manifest
@@ -0,0 +1,2 @@
+DIST netatalk-3.1.6.tar.bz2 1817059 SHA256 2df2b3b12be3f11eddb0fc2f88cb39d09a8c95792a4d97d9dd22127c5a5efb21 SHA512 36bfd3df30f1a3228a6f8f05e7744f9551d01d5a59d9c05e581f731e4fe9417bc1a7178e2e6af1128ea9a5c848bfa9a447ecf22691daa201f1fa37adcbe19be8 WHIRLPOOL 9f52d774487781aa43444bfe920fc07d9b7fe6bece45bca7cb44a9b7bc498ed17662c42d64db0628f668098c0bf7b6cb3f9c813d39e0fdac9f59b7eeae359d5d
+DIST netatalk-3.1.7.tar.bz2 1780078 SHA256 e4049399e4e7d477f843a9ec4bd64f70eb7c7af946e890311140fd8fbd4bc071 SHA512 e8b22a156235cb93830ed5045e28346613e354fd830e742b2f7c1fc9302f9bdfce7fb2cc329ce8dfd1442857f96e9e54119a4ac177b6855af9143e64fb2208e7 WHIRLPOOL 3dfbc5c3091388fc2b1e811faf60c274549f5d6e9d7ae2c5dc0552a72ae01b2a075c8f7df634ad99188adc83c19c70ba7060aec80fe5f8783a206e4d5db16ecb
diff --git a/net-fs/netatalk/files/netatalk-3.1.6-gentoo.patch b/net-fs/netatalk/files/netatalk-3.1.6-gentoo.patch
new file mode 100644
index 00000000000..e5e396b68d2
--- /dev/null
+++ b/net-fs/netatalk/files/netatalk-3.1.6-gentoo.patch
@@ -0,0 +1,127 @@
+ Makefile.am | 6 ------
+ etc/netatalk/afp_avahi.c | 2 +-
+ etc/netatalk/Makefile.am | 5 +++--
+ etc/uams/Makefile.am | 20 ++++++++++----------
+ libatalk/dsi/Makefile.am | 3 ++-
+ libatalk/vfs/Makefile.am | 1 +
+ macros/netatalk.m4 | 1 -
+ 8 files changed, 18 insertions(+), 22 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 0100598..a7b6c22 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -11,9 +11,3 @@ EXTRA_DIST = CONTRIBUTORS COPYRIGHT COPYING NEWS VERSION
+ ACLOCAL_AMFLAGS = -I macros
+ AUTOMAKE_OPTIONS = foreign
+
+-if RUN_LDCONFIG
+-install-exec-hook:
+- @printf "Running ldconfig to ensure libraries installed in system library directories are added to the dynamic linker cache ... "
+- @-@NETA_LDCONFIG@
+- @printf "done\n"
+-endif
+diff --git a/etc/netatalk/afp_avahi.c b/etc/netatalk/afp_avahi.c
+index 5218d51..b68c266 100644
+--- a/etc/netatalk/afp_avahi.c
++++ b/etc/netatalk/afp_avahi.c
+@@ -174,8 +174,8 @@ static void register_stuff(void) {
+ return;
+
+ fail:
+- time(NULL);
+ // avahi_threaded_poll_quit(ctx->threaded_poll);
++ return;
+ }
+
+ /* Called when publishing of service data completes */
+diff --git a/etc/netatalk/Makefile.am b/etc/netatalk/Makefile.am
+index 06e5a8c..2d4ef20 100644
+--- a/etc/netatalk/Makefile.am
++++ b/etc/netatalk/Makefile.am
+@@ -14,6 +14,7 @@ netatalk_LDADD = \
+ $(top_builddir)/libatalk/libatalk.la
+
+ netatalk_LDFLAGS =
++netatalk_CPPFLAGS =
+
+ if USE_BUILTIN_LIBEVENT
+ netatalk_CFLAGS += \
+@@ -23,6 +24,6 @@ netatalk_CFLAGS += \
+ netatalk_LDADD += \
+ $(top_builddir)/libevent/libevent.la
+ else
+-netatalk_CFLAGS += @LIBEVENT_CFLAGS@
+-netatalk_LDFLAGS += @LIBEVENT_LDFLAGS@ -levent
++netatalk_CPPFLAGS += @LIBEVENT_CFLAGS@
++netatalk_LDADD += @LIBEVENT_LDFLAGS@ -levent
+ endif
+diff --git a/etc/uams/Makefile.am b/etc/uams/Makefile.am
+index 3a02b83..70a2f76 100644
+--- a/etc/uams/Makefile.am
++++ b/etc/uams/Makefile.am
+@@ -95,16 +95,16 @@ uams_dhx_pam_la_CFLAGS = @SSL_CFLAGS@ @PAM_CFLAGS@
+ uams_dhx2_pam_la_CFLAGS = @LIBGCRYPT_CFLAGS@ @PAM_CFLAGS@
+ uams_gss_la_CFLAGS = @GSSAPI_CFLAGS@ @KRB5_CFLAGS@
+
+-uams_guest_la_LDFLAGS = -module -avoid-version
+-uams_randnum_la_LDFLAGS = -module -avoid-version @SSL_LIBS@
+-uams_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@
+-uams_pam_la_LDFLAGS = -module -avoid-version @PAM_LIBS@
+-uams_pgp_la_LDFLAGS = -module -avoid-version @SSL_LIBS@
+-uams_dhx_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@
+-uams_dhx_pam_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ @PAM_LIBS@
+-uams_dhx2_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @LIBGCRYPT_LIBS@
+-uams_dhx2_pam_la_LDFLAGS = -module -avoid-version @LIBGCRYPT_LIBS@ @PAM_LIBS@
+-uams_gss_la_LDFLAGS = -module -avoid-version @GSSAPI_LIBS@ @KRB5_LIBS@
++uams_guest_la_LDFLAGS = -shared -module -avoid-version
++uams_randnum_la_LDFLAGS = -shared -module -avoid-version @SSL_LIBS@
++uams_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@
++uams_pam_la_LDFLAGS = -shared -module -avoid-version @PAM_LIBS@
++uams_pgp_la_LDFLAGS = -shared -module -avoid-version @SSL_LIBS@
++uams_dhx_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@
++uams_dhx_pam_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ @PAM_LIBS@
++uams_dhx2_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @LIBGCRYPT_LIBS@
++uams_dhx2_pam_la_LDFLAGS = -shared -module -avoid-version @LIBGCRYPT_LIBS@ @PAM_LIBS@
++uams_gss_la_LDFLAGS = -shared -module -avoid-version @GSSAPI_LIBS@ @KRB5_LIBS@
+
+ #
+ # module compilation
+diff --git a/libatalk/dsi/Makefile.am b/libatalk/dsi/Makefile.am
+index 34fa76e..dbde336 100644
+--- a/libatalk/dsi/Makefile.am
++++ b/libatalk/dsi/Makefile.am
+@@ -1,9 +1,10 @@
+ # Makefile.am for libatalk/dsi/
+
+-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
++AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
+ LIBS = @LIBS@
+
+ noinst_LTLIBRARIES = libdsi.la
+
+ libdsi_la_SOURCES = dsi_attn.c dsi_close.c dsi_cmdreply.c dsi_getsess.c dsi_getstat.c dsi_init.c dsi_opensess.c dsi_read.c dsi_tcp.c dsi_tickle.c dsi_write.c dsi_stream.c
++libdsi_la_LIBADD = $(WRAP_LIBS)
+diff --git a/libatalk/vfs/Makefile.am b/libatalk/vfs/Makefile.am
+index aa62aeb..8ac2045 100644
+--- a/libatalk/vfs/Makefile.am
++++ b/libatalk/vfs/Makefile.am
+@@ -6,4 +6,5 @@ libvfs_la_SOURCES = vfs.c unix.c ea_ad.c ea_sys.c extattr.c
+
+ if HAVE_ACLS
+ libvfs_la_SOURCES += acl.c
++libvfs_la_LIBADD = $(ACL_LIBS)
+ endif
+diff --git a/macros/netatalk.m4 b/macros/netatalk.m4
+index 7040eb0..5b63285 100644
+--- a/macros/netatalk.m4
++++ b/macros/netatalk.m4
+@@ -613,7 +613,6 @@ save_CFLAGS="$CFLAGS"
+ save_LDFLAGS="$LDFLAGS"
+ save_LIBS="$LIBS"
+ CFLAGS=""
+-LDFLAGS=""
+ LIBS=""
+ LDAP_CFLAGS=""
+ LDAP_LDFLAGS=""
diff --git a/net-fs/netatalk/files/netatalk-3.1.7-gentoo.patch b/net-fs/netatalk/files/netatalk-3.1.7-gentoo.patch
new file mode 100644
index 00000000000..82dd788fc6d
--- /dev/null
+++ b/net-fs/netatalk/files/netatalk-3.1.7-gentoo.patch
@@ -0,0 +1,132 @@
+ Makefile.am | 6 ------
+ etc/netatalk/Makefile.am | 5 +++--
+ etc/netatalk/afp_avahi.c | 2 +-
+ etc/uams/Makefile.am | 20 ++++++++++----------
+ libatalk/dsi/Makefile.am | 3 ++-
+ libatalk/vfs/Makefile.am | 1 +
+ macros/netatalk.m4 | 1 -
+ 7 files changed, 17 insertions(+), 21 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index ec7f14d..b87fd8a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -11,12 +11,6 @@ EXTRA_DIST = CONTRIBUTORS COPYRIGHT COPYING NEWS VERSION abigen.sh
+ ACLOCAL_AMFLAGS = -I macros
+ AUTOMAKE_OPTIONS = foreign
+
+-if RUN_LDCONFIG
+-install-exec-hook:
+- @printf "Running ldconfig to ensure libraries installed in system library directories are added to the dynamic linker cache ... "
+- @-@NETA_LDCONFIG@
+- @printf "done\n"
+-endif
+
+ if DEVELOPER
+ abi-clean:
+diff --git a/etc/netatalk/Makefile.am b/etc/netatalk/Makefile.am
+index 5392b9d..3e62e2d 100644
+--- a/etc/netatalk/Makefile.am
++++ b/etc/netatalk/Makefile.am
+@@ -18,6 +18,7 @@ netatalk_LDADD = \
+ $(top_builddir)/libatalk/libatalk.la
+
+ netatalk_LDFLAGS =
++netatalk_CPPFLAGS =
+
+ if USE_BUILTIN_LIBEVENT
+ netatalk_CFLAGS += \
+@@ -27,8 +28,8 @@ netatalk_CFLAGS += \
+ netatalk_LDADD += \
+ $(top_builddir)/libevent/libevent.la
+ else
+-netatalk_CFLAGS += @LIBEVENT_CFLAGS@
+-netatalk_LDFLAGS += @LIBEVENT_LDFLAGS@ -levent
++netatalk_CPPFLAGS += @LIBEVENT_CFLAGS@
++netatalk_LDADD += @LIBEVENT_LDFLAGS@ -levent
+ endif
+
+ noinst_HEADERS = afp_zeroconf.h afp_avahi.h afp_mdns.h
+diff --git a/etc/netatalk/afp_avahi.c b/etc/netatalk/afp_avahi.c
+index d6b55dc..dade1e0 100644
+--- a/etc/netatalk/afp_avahi.c
++++ b/etc/netatalk/afp_avahi.c
+@@ -164,8 +164,8 @@ static void register_stuff(void) {
+ return;
+
+ fail:
+- time(NULL);
+ // avahi_threaded_poll_quit(ctx->threaded_poll);
++ return;
+ }
+
+ /* Called when publishing of service data completes */
+diff --git a/etc/uams/Makefile.am b/etc/uams/Makefile.am
+index 23fd3d1..0e882ea 100644
+--- a/etc/uams/Makefile.am
++++ b/etc/uams/Makefile.am
+@@ -95,16 +95,16 @@ uams_dhx_pam_la_CFLAGS = @SSL_CFLAGS@ @PAM_CFLAGS@
+ uams_dhx2_pam_la_CFLAGS = @LIBGCRYPT_CFLAGS@ @PAM_CFLAGS@
+ uams_gss_la_CFLAGS = @GSSAPI_CFLAGS@ @KRB5_CFLAGS@
+
+-uams_guest_la_LDFLAGS = -module -avoid-version
+-uams_randnum_la_LDFLAGS = -module -avoid-version @SSL_LIBS@
+-uams_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@
+-uams_pam_la_LDFLAGS = -module -avoid-version @PAM_LIBS@
+-uams_pgp_la_LDFLAGS = -module -avoid-version @SSL_LIBS@
+-uams_dhx_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@
+-uams_dhx_pam_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ @PAM_LIBS@
+-uams_dhx2_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @LIBGCRYPT_LIBS@
+-uams_dhx2_pam_la_LDFLAGS = -module -avoid-version @LIBGCRYPT_LIBS@ @PAM_LIBS@
+-uams_gss_la_LDFLAGS = -module -avoid-version @GSSAPI_LIBS@ @KRB5_LIBS@
++uams_guest_la_LDFLAGS = -shared -module -avoid-version
++uams_randnum_la_LDFLAGS = -shared -module -avoid-version @SSL_LIBS@
++uams_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@
++uams_pam_la_LDFLAGS = -shared -module -avoid-version @PAM_LIBS@
++uams_pgp_la_LDFLAGS = -shared -module -avoid-version @SSL_LIBS@
++uams_dhx_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@
++uams_dhx_pam_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ @PAM_LIBS@
++uams_dhx2_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @LIBGCRYPT_LIBS@
++uams_dhx2_pam_la_LDFLAGS = -shared -module -avoid-version @LIBGCRYPT_LIBS@ @PAM_LIBS@
++uams_gss_la_LDFLAGS = -shared -module -avoid-version @GSSAPI_LIBS@ @KRB5_LIBS@
+
+ #
+ # module compilation
+diff --git a/libatalk/dsi/Makefile.am b/libatalk/dsi/Makefile.am
+index 34fa76e..dbde336 100644
+--- a/libatalk/dsi/Makefile.am
++++ b/libatalk/dsi/Makefile.am
+@@ -1,9 +1,10 @@
+ # Makefile.am for libatalk/dsi/
+
+-INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/sys
++AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys
+
+ LIBS = @LIBS@
+
+ noinst_LTLIBRARIES = libdsi.la
+
+ libdsi_la_SOURCES = dsi_attn.c dsi_close.c dsi_cmdreply.c dsi_getsess.c dsi_getstat.c dsi_init.c dsi_opensess.c dsi_read.c dsi_tcp.c dsi_tickle.c dsi_write.c dsi_stream.c
++libdsi_la_LIBADD = $(WRAP_LIBS)
+diff --git a/libatalk/vfs/Makefile.am b/libatalk/vfs/Makefile.am
+index aa62aeb..8ac2045 100644
+--- a/libatalk/vfs/Makefile.am
++++ b/libatalk/vfs/Makefile.am
+@@ -6,4 +6,5 @@ libvfs_la_SOURCES = vfs.c unix.c ea_ad.c ea_sys.c extattr.c
+
+ if HAVE_ACLS
+ libvfs_la_SOURCES += acl.c
++libvfs_la_LIBADD = $(ACL_LIBS)
+ endif
+diff --git a/macros/netatalk.m4 b/macros/netatalk.m4
+index ea2bbff..40ab817 100644
+--- a/macros/netatalk.m4
++++ b/macros/netatalk.m4
+@@ -790,7 +790,6 @@ save_CFLAGS="$CFLAGS"
+ save_LDFLAGS="$LDFLAGS"
+ save_LIBS="$LIBS"
+ CFLAGS=""
+-LDFLAGS=""
+ LIBS=""
+ LDAP_CFLAGS=""
+ LDAP_LDFLAGS=""
diff --git a/net-fs/netatalk/metadata.xml b/net-fs/netatalk/metadata.xml
new file mode 100644
index 00000000000..11e149878ac
--- /dev/null
+++ b/net-fs/netatalk/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-fs</herd>
+ <maintainer restrict="&gt;=net-fs/netatalk-2.2.1-r1">
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="pgp">
+ Add support pgp authentication module
+ </flag>
+ <flag name="pgp">
+ Add support pgp authentication module
+ </flag>
+ <flag name="quota">
+ Add support for user quota on various filesystems.
+ </flag>
+ <flag name="shadow">
+ Add shadow support
+ </flag>
+ <flag name="tracker">
+ Add support for spotlight like tracker
+ </flag>
+ <flag name="utils">
+ Install afpstats script
+ </flag>
+ <flag name="ssl">
+ Use <pkg>dev-libs/openssl</pkg> to provide DHX User Access
+ Modules. These are not used with most recent versions of OS X
+ and can be kept disabled without risks.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">netatalk</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-fs/netatalk/netatalk-3.1.6.ebuild b/net-fs/netatalk/netatalk-3.1.6.ebuild
new file mode 100644
index 00000000000..a7c545f40ab
--- /dev/null
+++ b/net-fs/netatalk/netatalk-3.1.6.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+AUTOTOOLS_AUTORECONF=yes
+
+inherit autotools-utils flag-o-matic multilib pam python-r1 systemd versionator
+
+DESCRIPTION="Open Source AFP server"
+HOMEPAGE="http://netatalk.sourceforge.net/"
+SRC_URI="mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-3)/${P}.tar.bz2"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 x86 ~x86-fbsd"
+IUSE="acl avahi cracklib dbus debug pgp kerberos ldap pam quota samba +shadow ssl static-libs tracker tcpd +utils"
+
+CDEPEND="
+ !app-editors/yudit
+ dev-libs/libevent
+ >=dev-libs/libgcrypt-1.2.3:0
+ sys-apps/coreutils
+ >=sys-libs/db-4.2.52:=
+ sys-libs/tdb
+ acl? (
+ sys-apps/attr
+ sys-apps/acl
+ )
+ avahi? ( net-dns/avahi[dbus,-mdnsresponder-compat] )
+ cracklib? ( sys-libs/cracklib )
+ dbus? ( sys-apps/dbus dev-libs/dbus-glib )
+ kerberos? ( virtual/krb5 )
+ ldap? ( net-nds/openldap )
+ pam? ( virtual/pam )
+ ssl? ( dev-libs/openssl:0 )
+ tcpd? ( sys-apps/tcp-wrappers )
+ tracker? ( app-misc/tracker )
+ utils? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${CDEPEND}
+ utils? (
+ dev-lang/perl
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ )"
+DEPEND="${CDEPEND}
+ virtual/yacc
+ sys-devel/flex"
+
+RESTRICT="test"
+
+REQUIRED_USE="
+ ldap? ( acl )
+ utils? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
+
+src_prepare() {
+ if ! use utils; then
+ sed \
+ -e "s:shell_utils::g" \
+ -i contrib/Makefile.am || die
+ fi
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=()
+
+ append-flags -fno-strict-aliasing
+
+ if use acl; then
+ myeconfargs+=( --with-acls $(use_with ldap) )
+ else
+ myeconfargs+=( --without-acls --without-ldap )
+ fi
+
+ # Ignore --with-init-style=gentoo, we install the init.d by hand and we avoid having
+ # to sed the Makefiles to not do rc-update.
+ # TODO:
+ # systemd : --with-init-style=systemd
+ myeconfargs+=(
+ --disable-silent-rules
+ $(use_enable avahi zeroconf)
+ $(use_enable debug)
+ $(use_enable debug debugging)
+ $(use_enable pgp pgp-uam)
+ $(use_enable kerberos)
+ $(use_enable kerberos krbV-uam)
+ $(use_enable quota)
+ $(use_enable tcpd tcp-wrappers)
+ $(use_with cracklib)
+ $(use_with dbus afpstats)
+ $(use_with pam)
+ $(use_with samba smbsharemodes)
+ $(use_with shadow)
+ $(use_with ssl ssl-dir)
+ $(use_with tracker)
+ $(use_with tracker tracker-pkgconfig-version $(get_version_component_range 1-2 $(best_version app-misc/tracker | sed 's:app-misc/tracker-::g')))
+ --enable-overwrite
+ --disable-krb4-uam
+ --disable-afs
+ --with-libevent-header=/usr/include
+ --with-libevent-lib=/usr/$(get_libdir)
+ --with-bdb=/usr
+ --with-uams-path=/usr/$(get_libdir)/${PN}
+ --disable-silent-rules
+ --with-init-style=gentoo
+ --without-libevent
+ --without-tdb
+ --with-lockfile=/run/lock/${PN}
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if use avahi; then
+ sed -i -e '/avahi-daemon/s:use:need:g' "${D}"/etc/init.d/${PN} || die
+ else
+ sed -i -e '/avahi-daemon/d' "${D}"/etc/init.d/${PN} || die
+ fi
+
+ # The pamd file isn't what we need, use pamd_mimic_system
+ rm -rf "${ED}/etc/pam.d" || die
+ pamd_mimic_system netatalk auth account password session
+
+ sed \
+ -e "s|:SBINDIR:|${EPREFIX}/usr/sbin|g" \
+ -e "s|:PATH_NETATALK_LOCK:|/run/lock/netatalk|g" \
+ distrib/initscripts/service.systemd.tmpl \
+ > "${T}"/service.systemd || die
+ systemd_newunit "${T}"/service.systemd ${PN}.service
+
+ use utils && python_foreach_impl python_doscript contrib/shell_utils/afpstats
+}
+
+pkg_postinst() {
+ local fle
+ if [[ ${REPLACING_VERSIONS} < 3 ]]; then
+ for fle in afp_signature.conf afp_voluuid.conf; do
+ if [[ -f "${ROOT}"etc/netatalk/${fle} ]]; then
+ if [[ ! -f "${ROOT}"var/lib/netatalk/${fle} ]]; then
+ mv \
+ "${ROOT}"etc/netatalk/${fle} \
+ "${ROOT}"var/lib/netatalk/
+ fi
+ fi
+ done
+
+ echo ""
+ elog "Starting from version 3.0 only uses a single init script again"
+ elog "Please update your runlevels accordingly"
+ echo ""
+ elog "Dependencies should be resolved automatically depending on settings"
+ elog "but please report issues with this on https://bugs.gentoo.org/ if"
+ elog "you find any."
+ echo ""
+ elog "Following config files are obsolete now:"
+ elog "afpd.conf, netatalk.conf, AppleVolumes.default and afp_ldap.conf"
+ elog "in favour of"
+ elog "/etc/afp.conf"
+ echo ""
+ elog "Please convert your existing configs before you restart your daemon"
+ echo ""
+ elog "The new AppleDouble default backend is appledouble = ea"
+ elog "Existing entries will be updated on access, but can do an offline"
+ elog "conversion with"
+ elog "dbd -ruve /path/to/Volume"
+ echo ""
+ elog "For general notes on the upgrade, please visit"
+ elog "http://netatalk.sourceforge.net/3.0/htmldocs/upgrade.html"
+ echo ""
+ fi
+}
diff --git a/net-fs/netatalk/netatalk-3.1.7.ebuild b/net-fs/netatalk/netatalk-3.1.7.ebuild
new file mode 100644
index 00000000000..1aa216eba2f
--- /dev/null
+++ b/net-fs/netatalk/netatalk-3.1.7.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+AUTOTOOLS_AUTORECONF=yes
+
+inherit autotools-utils flag-o-matic multilib pam python-r1 systemd versionator
+
+DESCRIPTION="Open Source AFP server"
+HOMEPAGE="http://netatalk.sourceforge.net/"
+SRC_URI="mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-3)/${P}.tar.bz2"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd"
+IUSE="acl avahi cracklib dbus debug pgp kerberos ldap pam quota samba +shadow ssl static-libs tracker tcpd +utils"
+
+CDEPEND="
+ !app-editors/yudit
+ dev-libs/libevent
+ >=dev-libs/libgcrypt-1.2.3:0
+ sys-apps/coreutils
+ >=sys-libs/db-4.2.52:=
+ sys-libs/tdb
+ acl? (
+ sys-apps/attr
+ sys-apps/acl
+ )
+ avahi? ( net-dns/avahi[dbus,-mdnsresponder-compat] )
+ cracklib? ( sys-libs/cracklib )
+ dbus? ( sys-apps/dbus dev-libs/dbus-glib )
+ kerberos? ( virtual/krb5 )
+ ldap? ( net-nds/openldap )
+ pam? ( virtual/pam )
+ ssl? ( dev-libs/openssl:0 )
+ tcpd? ( sys-apps/tcp-wrappers )
+ tracker? ( app-misc/tracker )
+ utils? ( ${PYTHON_DEPS} )
+ "
+RDEPEND="${CDEPEND}
+ utils? (
+ dev-lang/perl
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ )"
+DEPEND="${CDEPEND}
+ virtual/yacc
+ sys-devel/flex"
+
+RESTRICT="test"
+
+REQUIRED_USE="
+ ldap? ( acl )
+ utils? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
+
+src_prepare() {
+ if ! use utils; then
+ sed \
+ -e "s:shell_utils::g" \
+ -i contrib/Makefile.am || die
+ fi
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=()
+
+ append-flags -fno-strict-aliasing
+
+ if use acl; then
+ myeconfargs+=( --with-acls $(use_with ldap) )
+ else
+ myeconfargs+=( --without-acls --without-ldap )
+ fi
+
+ # Ignore --with-init-style=gentoo, we install the init.d by hand and we avoid having
+ # to sed the Makefiles to not do rc-update.
+ # TODO:
+ # systemd : --with-init-style=systemd
+ myeconfargs+=(
+ --disable-silent-rules
+ $(use_enable avahi zeroconf)
+ $(use_enable debug)
+ $(use_enable debug debugging)
+ $(use_enable pgp pgp-uam)
+ $(use_enable kerberos)
+ $(use_enable kerberos krbV-uam)
+ $(use_enable quota)
+ $(use_enable tcpd tcp-wrappers)
+ $(use_with cracklib)
+ $(use_with dbus afpstats)
+ $(use_with pam)
+ $(use_with samba smbsharemodes)
+ $(use_with shadow)
+ $(use_with ssl ssl-dir)
+ $(use_with tracker)
+ $(use_with tracker tracker-pkgconfig-version $(get_version_component_range 1-2 $(best_version app-misc/tracker | sed 's:app-misc/tracker-::g')))
+ --enable-overwrite
+ --disable-krb4-uam
+ --disable-afs
+ --with-libevent-header=/usr/include
+ --with-libevent-lib=/usr/$(get_libdir)
+ --with-bdb=/usr
+ --with-uams-path=/usr/$(get_libdir)/${PN}
+ --disable-silent-rules
+ --with-init-style=gentoo
+ --without-libevent
+ --without-tdb
+ --with-lockfile=/run/lock/${PN}
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if use avahi; then
+ sed -i -e '/avahi-daemon/s:use:need:g' "${D}"/etc/init.d/${PN} || die
+ else
+ sed -i -e '/avahi-daemon/d' "${D}"/etc/init.d/${PN} || die
+ fi
+
+ # The pamd file isn't what we need, use pamd_mimic_system
+ rm -rf "${ED}/etc/pam.d" || die
+ pamd_mimic_system netatalk auth account password session
+
+ sed \
+ -e "s|:SBINDIR:|${EPREFIX}/usr/sbin|g" \
+ -e "s|:PATH_NETATALK_LOCK:|/run/lock/netatalk|g" \
+ distrib/initscripts/service.systemd.tmpl \
+ > "${T}"/service.systemd || die
+ systemd_newunit "${T}"/service.systemd ${PN}.service
+
+ use utils && python_foreach_impl python_doscript contrib/shell_utils/afpstats
+}
+
+pkg_postinst() {
+ local fle
+ if [[ ${REPLACING_VERSIONS} < 3 ]]; then
+ for fle in afp_signature.conf afp_voluuid.conf; do
+ if [[ -f "${ROOT}"etc/netatalk/${fle} ]]; then
+ if [[ ! -f "${ROOT}"var/lib/netatalk/${fle} ]]; then
+ mv \
+ "${ROOT}"etc/netatalk/${fle} \
+ "${ROOT}"var/lib/netatalk/
+ fi
+ fi
+ done
+
+ echo ""
+ elog "Starting from version 3.0 only uses a single init script again"
+ elog "Please update your runlevels accordingly"
+ echo ""
+ elog "Dependencies should be resolved automatically depending on settings"
+ elog "but please report issues with this on https://bugs.gentoo.org/ if"
+ elog "you find any."
+ echo ""
+ elog "Following config files are obsolete now:"
+ elog "afpd.conf, netatalk.conf, AppleVolumes.default and afp_ldap.conf"
+ elog "in favour of"
+ elog "/etc/afp.conf"
+ echo ""
+ elog "Please convert your existing configs before you restart your daemon"
+ echo ""
+ elog "The new AppleDouble default backend is appledouble = ea"
+ elog "Existing entries will be updated on access, but can do an offline"
+ elog "conversion with"
+ elog "dbd -ruve /path/to/Volume"
+ echo ""
+ elog "For general notes on the upgrade, please visit"
+ elog "http://netatalk.sourceforge.net/3.0/htmldocs/upgrade.html"
+ echo ""
+ fi
+}
diff --git a/net-fs/nfs-utils/Manifest b/net-fs/nfs-utils/Manifest
new file mode 100644
index 00000000000..987134ab894
--- /dev/null
+++ b/net-fs/nfs-utils/Manifest
@@ -0,0 +1,3 @@
+DIST nfs-utils-1.2.9.tar.bz2 774112 SHA256 90b76d5692a520b74273e607a4fd69df4cc35f65e242e22e2bc61b58759722f3 SHA512 c71f986a7e8f38492f8411540b32fef904f689b45b831e0e3c193628085d09742c6352dc42d6d374b8ded12e2b54f8fb3c8de66695a36cf038fc4afa5c29879e WHIRLPOOL 22e86859e9bf7a9a298c91f73a8afea63aa1e39753062ff664a17601d311d62f8f0efed8a0c5271751b53bb46cfc91bf721ca852dc1e744e4bb51f321a34c119
+DIST nfs-utils-1.3.1.tar.bz2 785800 SHA256 748c4afbdfd3e92017fe579f1dd3280a10db1306c43228f83cd6b55f0d95aed3 SHA512 304e718aaee1df4decb0711c58c814ac773d55277baca01fd74d275969b9a1cee4bf0c0c20ba3ed72a112bd92b4744d45179f29a2a69a7fc2ca2590762a671c9 WHIRLPOOL 6fe5e9957c4a2775871ede47d1020f1a642e9242501ff3d21b74c4772ae8dfcafba27334e5844a06f9cc3e0fd286d1f90573511c2b198e330cb46c06cdbfc592
+DIST nfs-utils-1.3.2.tar.bz2 789540 SHA256 5b9c72eef260b86a84619771e11bb013b99431e6b7ff0bbdc03fee90dba591f7 SHA512 65633db58bbc5b6bff6acab412dc085affc61e0a6e0aef72d630e67d05a8d08012dced81178a4c7af65c967c25b48161f8d887d261fdf5ce505b719dbdab757c WHIRLPOOL eee615f032987aee71adf04a3ad5f5b8f79dc4487f1be1a7fb87c42918a12ef9397ba990b02d4adb02265706df9f1e3ef409c141491759c65b8037693b9b06c9
diff --git a/net-fs/nfs-utils/files/exports b/net-fs/nfs-utils/files/exports
new file mode 100644
index 00000000000..5102ef27c15
--- /dev/null
+++ b/net-fs/nfs-utils/files/exports
@@ -0,0 +1 @@
+# /etc/exports: NFS file systems being exported. See exports(5).
diff --git a/net-fs/nfs-utils/files/nfs-utils-1.1.4-mtab-sym.patch b/net-fs/nfs-utils/files/nfs-utils-1.1.4-mtab-sym.patch
new file mode 100644
index 00000000000..c9e60afc74d
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-utils-1.1.4-mtab-sym.patch
@@ -0,0 +1,39 @@
+ripped from Debian
+
+--- nfs-utils-1.1.4/utils/mount/fstab.c
++++ nfs-utils-1.1.4/utils/mount/fstab.c
+@@ -57,7 +57,7 @@ mtab_does_not_exist(void) {
+ return var_mtab_does_not_exist;
+ }
+
+-static int
++int
+ mtab_is_a_symlink(void) {
+ get_mtab_info();
+ return var_mtab_is_a_symlink;
+--- nfs-utils-1.1.4/utils/mount/fstab.h
++++ nfs-utils-1.1.4/utils/mount/fstab.h
+@@ -7,6 +7,7 @@
+ #define _PATH_FSTAB "/etc/fstab"
+ #endif
+
++int mtab_is_a_symlink(void);
+ int mtab_is_writable(void);
+ int mtab_does_not_exist(void);
+ void reset_mtab_info(void);
+--- nfs-utils-1.1.4/utils/mount/mount.c
++++ nfs-utils-1.1.4/utils/mount/mount.c
+@@ -230,6 +230,13 @@ create_mtab (void) {
+ int flags;
+ mntFILE *mfp;
+
++ /* Avoid writing if the mtab is a symlink to /proc/mounts, since
++ that would create a file /proc/mounts in case the proc filesystem
++ is not mounted, and the fchmod below would also fail. */
++ if (mtab_is_a_symlink()) {
++ return EX_SUCCESS;
++ }
++
+ lock_mtab();
+
+ mfp = nfs_setmntent (MOUNTED, "a+");
diff --git a/net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch b/net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch
new file mode 100644
index 00000000000..7317115a0e1
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch
@@ -0,0 +1,48 @@
+this is kind of hacky, but automake doesn't make this easy
+for us atm, so hack away :(
+
+(recent autotools will always add $(CFLAGS)/etc... to the compile)
+
+--- a/tools/locktest/Makefile.am
++++ b/tools/locktest/Makefile.am
+@@ -1,12 +1,11 @@
+ ## Process this file with automake to produce Makefile.in
+
+ CC=$(CC_FOR_BUILD)
+-LIBTOOL = @LIBTOOL@ --tag=CC
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ noinst_PROGRAMS = testlk
+ testlk_SOURCES = testlk.c
+-testlk_CFLAGS=$(CFLAGS_FOR_BUILD)
+-testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
+-testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ MAINTAINERCLEANFILES = Makefile.in
+--- a/tools/rpcgen/Makefile.am
++++ b/tools/rpcgen/Makefile.am
+@@ -1,7 +1,9 @@
+ ## Process this file with automake to produce Makefile.in
+
+ CC=$(CC_FOR_BUILD)
+-LIBTOOL = @LIBTOOL@ --tag=CC
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ noinst_PROGRAMS = rpcgen
+ rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \
+@@ -9,10 +11,6 @@
+ rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \
+ rpc_scan.h rpc_util.h
+
+-rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD)
+-rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD)
+-rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD)
+-rpcgen_LDADD=$(LIBTIRPC)
+
+ MAINTAINERCLEANFILES = Makefile.in
+
+ EXTRA_DIST = rpcgen.new.1
diff --git a/net-fs/nfs-utils/files/nfs-utils-1.3.0-gcc-4.9.patch b/net-fs/nfs-utils/files/nfs-utils-1.3.0-gcc-4.9.patch
new file mode 100644
index 00000000000..e2d98b517e3
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-utils-1.3.0-gcc-4.9.patch
@@ -0,0 +1,62 @@
+From 25e83c2270b2d2966c992885faed0b79be09f474 Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@poochiereds.net>
+Date: Thu, 1 May 2014 11:15:16 -0400
+Subject: [PATCH [nfs-utils]] mountd: fix segfault in add_name with newer gcc
+ compilers
+
+I hit a segfault in add_name with a mountd built with gcc-4.9.0. Some
+NULL pointer checks got reordered such that a pointer was dereferenced
+before checking to see whether it was NULL. The problem was due to
+nfs-utils relying on undefined behavior, which tricked gcc into assuming
+that the pointer would never be NULL.
+
+At first I assumed that this was a compiler bug, but Jakub Jelinek and
+Jeff Law pointed out:
+
+"If old is NULL, then:
+
+ strncpy(new, old, cp-old);
+
+is undefined behavior (even when cp == old == NULL in that case),
+therefore gcc assumes that old is never NULL, as otherwise it would be
+invalid.
+
+Just guard
+ strncpy(new, old, cp-old);
+ new[cp-old] = 0;
+with if (old) { ... }."
+
+This patch does that. If old is NULL though, then we still need to
+ensure that new is NULL terminated, lest the subsequent strcats walk off
+the end of it.
+
+Cc: Jeff Law <law@redhat.com>
+Cc: Jakub Jelinek <jakub@redhat.com>
+Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ support/export/client.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/support/export/client.c b/support/export/client.c
+index dbf47b9..f85e11c 100644
+--- a/support/export/client.c
++++ b/support/export/client.c
+@@ -482,8 +482,12 @@ add_name(char *old, const char *add)
+ else
+ cp = cp + strlen(cp);
+ }
+- strncpy(new, old, cp-old);
+- new[cp-old] = 0;
++ if (old) {
++ strncpy(new, old, cp-old);
++ new[cp-old] = 0;
++ } else {
++ new[0] = 0;
++ }
+ if (cp != old && !*cp)
+ strcat(new, ",");
+ strcat(new, add);
+--
+2.0.0
+
diff --git a/net-fs/nfs-utils/files/nfs-utils-1.3.2-background-statd.patch b/net-fs/nfs-utils/files/nfs-utils-1.3.2-background-statd.patch
new file mode 100644
index 00000000000..393f70b87a9
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-utils-1.3.2-background-statd.patch
@@ -0,0 +1,30 @@
+From 17a3e5bffb7110d46de1bf42b64b90713ff5ea50 Mon Sep 17 00:00:00 2001
+From: Chris Mayo <aklhfex@gmail.com>
+Date: Sun, 1 Feb 2015 12:03:46 -0500
+Subject: [PATCH] statd: Fix test for foreground mode
+
+daemon_init parameter has the opposite sense
+to code removed in commit 7addf9d
+
+Signed-off-by: Chris Mayo <aklhfex@gmail.com>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ utils/statd/statd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/statd/statd.c b/utils/statd/statd.c
+index 60ce6d1..2b7a167 100644
+--- a/utils/statd/statd.c
++++ b/utils/statd/statd.c
+@@ -393,7 +393,7 @@ int main (int argc, char **argv)
+ simulator (--argc, ++argv); /* simulator() does exit() */
+ #endif
+
+- daemon_init(!(run_mode & MODE_NODAEMON));
++ daemon_init((run_mode & MODE_NODAEMON));
+
+ if (run_mode & MODE_LOG_STDERR) {
+ xlog_syslog(0);
+--
+2.2.2
+
diff --git a/net-fs/nfs-utils/files/nfs-utils.conf b/net-fs/nfs-utils/files/nfs-utils.conf
new file mode 100644
index 00000000000..b9b586c2ac0
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-utils.conf
@@ -0,0 +1,3 @@
+d /var/lib/nfs/rpc_pipefs
+d /var/lib/nfs/v4recovery
+d /var/lib/nfs/v4root
diff --git a/net-fs/nfs-utils/files/nfs.confd b/net-fs/nfs-utils/files/nfs.confd
new file mode 100644
index 00000000000..9dc14058c1f
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs.confd
@@ -0,0 +1,38 @@
+# /etc/conf.d/nfs
+
+# If you wish to set the port numbers for lockd,
+# please see /etc/sysctl.conf
+
+# Optional services to include in default `/etc/init.d/nfs start`
+# For NFSv4 users, you'll want to add "rpc.idmapd" here.
+NFS_NEEDED_SERVICES=""
+
+# Options to pass to rpc.nfsd
+OPTS_RPC_NFSD="8"
+
+# Options to pass to rpc.mountd
+# ex. OPTS_RPC_MOUNTD="-p 32767"
+OPTS_RPC_MOUNTD=""
+
+# Options to pass to rpc.statd
+# ex. OPTS_RPC_STATD="-p 32765 -o 32766"
+OPTS_RPC_STATD=""
+
+# Options to pass to rpc.idmapd
+OPTS_RPC_IDMAPD=""
+
+# Options to pass to rpc.gssd
+OPTS_RPC_GSSD=""
+
+# Options to pass to rpc.svcgssd
+OPTS_RPC_SVCGSSD=""
+
+# Options to pass to rpc.rquotad (requires sys-fs/quota)
+OPTS_RPC_RQUOTAD=""
+
+# Timeout (in seconds) for exportfs
+EXPORTFS_TIMEOUT=30
+
+# Options to set in the nfsd filesystem (/proc/fs/nfsd/).
+# Format is <option>=<value>. Multiple options are allowed.
+#OPTS_NFSD="nfsv4leasetime=30 max_block_size=4096"
diff --git a/net-fs/nfs-utils/files/nfs.initd b/net-fs/nfs-utils/files/nfs.initd
new file mode 100755
index 00000000000..084506d4c47
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs.initd
@@ -0,0 +1,163 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload"
+
+# This variable is used for controlling whether or not to run exportfs -ua;
+# see stop() for more information
+restarting=no
+
+# The binary locations
+exportfs=/usr/sbin/exportfs
+ mountd=/usr/sbin/rpc.mountd
+ nfsd=/usr/sbin/rpc.nfsd
+smnotify=/usr/sbin/sm-notify
+
+depend() {
+ local myneed=""
+ # XXX: no way to detect NFSv4 is desired and so need rpc.idmapd
+ myneed="${myneed} $(
+ awk '!/^[[:space:]]*#/ {
+ # clear the path to avoid spurious matches
+ $1 = "";
+ if ($0 ~ /[(][^)]*sec=(krb|spkm)[^)]*[)]/) {
+ print "rpc.svcgssd"
+ exit 0
+ }
+ }' /etc/exports /etc/exports.d/*.exports 2>/dev/null
+ )"
+ config /etc/exports /etc/exports.d/*.exports
+ need portmap rpc.statd ${myneed} ${NFS_NEEDED_SERVICES}
+ use ypbind net dns rpc.rquotad rpc.idmapd rpc.svcgssd
+ after quota
+}
+
+mkdir_nfsdirs() {
+ local d
+ for d in v4recovery v4root ; do
+ d="/var/lib/nfs/${d}"
+ [ ! -d "${d}" ] && mkdir -p "${d}"
+ done
+}
+
+waitfor_exportfs() {
+ local pid=$1
+ ( sleep ${EXPORTFS_TIMEOUT:-30}; kill -9 ${pid} 2>/dev/null ) &
+ wait $1
+}
+
+mount_nfsd() {
+ if [ -e /proc/modules ] ; then
+ # Make sure nfs support is loaded in the kernel #64709
+ if ! grep -qs nfsd /proc/filesystems ; then
+ modprobe -q nfsd
+ fi
+ # Restart idmapd if needed #220747
+ if grep -qs nfsd /proc/modules ; then
+ killall -q -HUP rpc.idmapd
+ fi
+ fi
+
+ # This is the new "kernel 2.6 way" to handle the exports file
+ if grep -qs nfsd /proc/filesystems ; then
+ if ! mountinfo -q /proc/fs/nfsd ; then
+ ebegin "Mounting nfsd filesystem in /proc"
+ mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfsd
+ eend $?
+ fi
+
+ local o
+ for o in ${OPTS_NFSD} ; do
+ echo "${o#*=}" > "/proc/fs/nfsd/${o%%=*}"
+ done
+ fi
+}
+
+start_it() {
+ ebegin "Starting NFS $1"
+ shift
+ "$@"
+ eend $?
+ ret=$((ret + $?))
+}
+start() {
+ mount_nfsd
+ mkdir_nfsdirs
+
+ # Exportfs likes to hang if networking isn't working.
+ # If that's the case, then try to kill it so the
+ # bootup process can continue.
+ if grep -qs '^[[:space:]]*/' /etc/exports /etc/exports.d/*.exports ; then
+ ebegin "Exporting NFS directories"
+ ${exportfs} -r &
+ waitfor_exportfs $!
+ eend $?
+ fi
+
+ local ret=0
+ start_it mountd ${mountd} ${OPTS_RPC_MOUNTD}
+ start_it daemon ${nfsd} ${OPTS_RPC_NFSD}
+ [ -x "${smnotify}" ] && start_it smnotify ${smnotify} ${OPTS_SMNOTIFY}
+ return ${ret}
+}
+
+stop() {
+ local ret=0
+
+ ebegin "Stopping NFS mountd"
+ start-stop-daemon --stop --exec ${mountd}
+ eend $?
+ ret=$((ret + $?))
+
+ # nfsd sets its process name to [nfsd] so don't look for $nfsd
+ ebegin "Stopping NFS daemon"
+ start-stop-daemon --stop --name nfsd --user root --signal 2
+ eend $?
+ ret=$((ret + $?))
+ # in case things don't work out ... #228127
+ rpc.nfsd 0
+
+ # When restarting the NFS server, running "exportfs -ua" probably
+ # isn't what the user wants. Running it causes all entries listed
+ # in xtab to be removed from the kernel export tables, and the
+ # xtab file is cleared. This effectively shuts down all NFS
+ # activity, leaving all clients holding stale NFS filehandles,
+ # *even* when the NFS server has restarted.
+ #
+ # That's what you would want if you were shutting down the NFS
+ # server for good, or for a long period of time, but not when the
+ # NFS server will be running again in short order. In this case,
+ # then "exportfs -r" will reread the xtab, and all the current
+ # clients will be able to resume NFS activity, *without* needing
+ # to umount/(re)mount the filesystem.
+ if [ "${restarting}" = no -o "${RC_CMD}" = "restart" ] ; then
+ ebegin "Unexporting NFS directories"
+ # Exportfs likes to hang if networking isn't working.
+ # If that's the case, then try to kill it so the
+ # shutdown process can continue.
+ ${exportfs} -ua &
+ waitfor_exportfs $!
+ eend $?
+ fi
+
+ return ${ret}
+}
+
+reload() {
+ # Exportfs likes to hang if networking isn't working.
+ # If that's the case, then try to kill it so the
+ # bootup process can continue.
+ ebegin "Reloading /etc/exports"
+ ${exportfs} -r 1>&2 &
+ waitfor_exportfs $!
+ eend $?
+}
+
+restart() {
+ # See long comment in stop() regarding "restarting" and exportfs -ua
+ restarting=yes
+ svc_stop
+ svc_start
+}
diff --git a/net-fs/nfs-utils/files/nfsclient.confd b/net-fs/nfs-utils/files/nfsclient.confd
new file mode 100644
index 00000000000..8a995571e1b
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfsclient.confd
@@ -0,0 +1,18 @@
+# You need to decide which nfs protocol version you want to use.
+# If you are unsure, leave these alone.
+#
+# If you are using only nfsv4, uncomment this line:
+#
+#rc_need="!rpc.statd"
+#
+# If you are using only nfsv3, uncomment this line:
+#
+#rc_need="!rpc.idmapd"
+#
+# You will need to set the dependencies in the nfsclient script to match
+# the network configuration tools you are using. This should be done in
+# this file by following the examples below, and not by changing the
+# service script itself. See /etc/conf.d/netmount for more examples.
+#
+# This is a safe default.
+rc_after="net"
diff --git a/net-fs/nfs-utils/files/nfsclient.initd b/net-fs/nfs-utils/files/nfsclient.initd
new file mode 100644
index 00000000000..ab13913b7b4
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfsclient.initd
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+depend() {
+ local opts myneed=""
+ if [ -e /etc/fstab ] ; then
+ for opts in $(fstabinfo -o -t nfs,nfs4) ; do
+ case $opts in
+ *sec=krb*|*sec=spkm*) myneed="$myneed rpc.gssd" ;;
+ esac
+ done
+ fi
+ config /etc/fstab
+ need portmap rpc.statd rpc.idmapd ${myneed}
+ use ypbind dns
+}
+
+start() {
+ if [ -x /usr/sbin/sm-notify ] ; then
+ ebegin "Starting NFS sm-notify"
+ /usr/sbin/sm-notify ${OPTS_SMNOTIFY}
+ eend $?
+ fi
+
+ # Make sure nfs support is loaded in the kernel #64709
+ if [ -e /proc/modules ] && ! grep -qs 'nfs$' /proc/filesystems ; then
+ modprobe -q nfs
+ fi
+ return 0
+}
diff --git a/net-fs/nfs-utils/files/nfsd.service-r1 b/net-fs/nfs-utils/files/nfsd.service-r1
new file mode 100644
index 00000000000..e15cf98f9be
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfsd.service-r1
@@ -0,0 +1,15 @@
+[Unit]
+Description=NFS server
+After=rpcbind.service
+Requires=rpcbind.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/rpc.nfsd 8
+ExecStartPost=/usr/sbin/exportfs -a
+ExecStop=/usr/sbin/rpc.nfsd 0
+ExecStopPost=/usr/sbin/exportfs -a -u
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/nfs-utils/files/nfsmount.confd b/net-fs/nfs-utils/files/nfsmount.confd
new file mode 100644
index 00000000000..418353668f9
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfsmount.confd
@@ -0,0 +1,7 @@
+# You will need to set the dependencies in the nfsmount script to match
+# the network configuration tools you are using. This should be done in
+# this file by following the examples below, and not by changing the
+# service script itself. See /etc/conf.d/netmount for more examples.
+#
+# This is a safe default.
+rc_after="net"
diff --git a/net-fs/nfs-utils/files/nfsmount.initd b/net-fs/nfs-utils/files/nfsmount.initd
new file mode 100755
index 00000000000..642d3494f17
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfsmount.initd
@@ -0,0 +1,48 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+depend() {
+ local myneed=""
+ if [ -e /etc/fstab ] ; then
+ myneed="${myneed} $(
+ awk '!/^[[:space:]]*#/ && ($3 == "nfs" || $3 == "nfs4") {
+ if ($3 == "nfs4")
+ idmapd = "rpc.idmapd"
+ if ($4 ~ /sec=(krb|spkm)/)
+ gssd = "rpc.gssd"
+ }
+ END { print idmapd " " gssd }
+ ' /etc/fstab
+ )"
+ fi
+ config /etc/fstab
+ need portmap rpc.statd ${myneed}
+ use ypbind dns rpc.idmapd rpc.gssd
+}
+
+start() {
+ if [ -x /usr/sbin/sm-notify ] ; then
+ ebegin "Starting NFS sm-notify"
+ /usr/sbin/sm-notify ${OPTS_SMNOTIFY}
+ eend $?
+ fi
+
+ # Make sure nfs support is loaded in the kernel #64709
+ if [ -e /proc/modules ] && ! grep -qs 'nfs$' /proc/filesystems ; then
+ modprobe -q nfs
+ fi
+
+ ebegin "Mounting NFS filesystems"
+ mount -a -t nfs,nfs4
+ eend $?
+}
+
+stop() {
+ ebegin "Unmounting NFS filesystems"
+ umount -a -t nfs,nfs4
+ eend $?
+}
diff --git a/net-fs/nfs-utils/files/nfsmount.initd-1.3.1 b/net-fs/nfs-utils/files/nfsmount.initd-1.3.1
new file mode 100644
index 00000000000..ec74dbe4fdc
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfsmount.initd-1.3.1
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# This is mostly as a fix for bug #537996, to avoid breaking existing users
+# with nfsmount in their runlevels.
+# If neither nfsclient nor netmount are in your runlevels, and you manually
+# start netmount before nfsclient, then this will break. A real solution is
+# forthcoming, but requires feature development, see bug #406021 for soft
+# dependencies
+depend() {
+ need nfsclient netmount
+}
+
+msg() {
+ ewarn "nfsmount is deprecated, please migrate as described in the news item: 2015-02-02-nfs-service-changes"
+ ewarn "This migration script will be removed after 01 Aug 2015."
+}
+
+start() {
+ msg
+}
+
+stop() {
+ msg
+}
diff --git a/net-fs/nfs-utils/files/proc-fs-nfsd.mount b/net-fs/nfs-utils/files/proc-fs-nfsd.mount
new file mode 100644
index 00000000000..26b58b9682d
--- /dev/null
+++ b/net-fs/nfs-utils/files/proc-fs-nfsd.mount
@@ -0,0 +1,8 @@
+[Unit]
+Description=NFS Configuration File System
+DefaultDependencies=no
+
+[Mount]
+What=sunrpc
+Where=/proc/fs/nfsd
+Type=nfsd
diff --git a/net-fs/nfs-utils/files/rpc-gssd.service b/net-fs/nfs-utils/files/rpc-gssd.service
new file mode 100644
index 00000000000..4c96deef440
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc-gssd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=RPC GSS-API Client Daemon
+Documentation=man:rpc.gssd(8)
+After=rpcbind.service var-lib-nfs-rpc_pipefs.mount
+Requires=rpcbind.service var-lib-nfs-rpc_pipefs.mount
+Before=remote-fs-pre.target
+
+[Service]
+ExecStart=/usr/sbin/rpc.gssd -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/nfs-utils/files/rpc-idmapd.service b/net-fs/nfs-utils/files/rpc-idmapd.service
new file mode 100644
index 00000000000..4a63b91ca73
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc-idmapd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=NFS v4 ID-Name Mapping Daemon
+Documentation=man:rpc.idmapd(8) man:idmapd.conf(5)
+After=var-lib-nfs-rpc_pipefs.mount nfsd.service
+Requires=var-lib-nfs-rpc_pipefs.mount
+
+[Service]
+ExecStart=/usr/sbin/rpc.idmapd -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/nfs-utils/files/rpc-mountd.service-r1 b/net-fs/nfs-utils/files/rpc-mountd.service-r1
new file mode 100644
index 00000000000..d5f5b24af39
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc-mountd.service-r1
@@ -0,0 +1,10 @@
+[Unit]
+Description=NFS Mount Daemon
+After=rpcbind.service nfsd.service
+Requires=rpcbind.service nfsd.service
+
+[Service]
+ExecStart=/usr/sbin/rpc.mountd -F
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/nfs-utils/files/rpc-statd.service-r2 b/net-fs/nfs-utils/files/rpc-statd.service-r2
new file mode 100644
index 00000000000..3633ebded5d
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc-statd.service-r2
@@ -0,0 +1,12 @@
+[Unit]
+Description=NFSv2/3 Network Status Monitor Daemon
+After=rpcbind.service
+Requires=rpcbind.service
+Before=remote-fs-pre.target
+Wants=remote-fs-pre.target
+
+[Service]
+ExecStart=/sbin/rpc.statd -F
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/nfs-utils/files/rpc-svcgssd.service b/net-fs/nfs-utils/files/rpc-svcgssd.service
new file mode 100644
index 00000000000..121c61a49b3
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc-svcgssd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=RPC GSS-API Server Daemon
+Documentation=man:rpc.svcgssd(8)
+After=rpcbind.service
+Requires=rpcbind.service
+Before=nfs-server.target
+PartOf=nfs-server.target
+
+[Service]
+ExecStart=/usr/sbin/rpc.svcgssd -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/nfs-utils/files/rpc.gssd.initd b/net-fs/nfs-utils/files/rpc.gssd.initd
new file mode 100755
index 00000000000..465b05ef462
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc.gssd.initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+depend() {
+ use ypbind net
+ need portmap rpc.pipefs
+ after quota
+}
+
+start() {
+ ebegin "Starting gssd"
+ start-stop-daemon --start --exec /usr/sbin/rpc.gssd -- ${OPTS_RPC_GSSD}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping gssd"
+ start-stop-daemon --stop --exec /usr/sbin/rpc.gssd
+ eend $?
+}
diff --git a/net-fs/nfs-utils/files/rpc.idmapd.initd b/net-fs/nfs-utils/files/rpc.idmapd.initd
new file mode 100755
index 00000000000..dcd0acd69e0
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc.idmapd.initd
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+rpc_bin=/usr/sbin/rpc.idmapd
+
+depend() {
+ use ypbind net
+ need portmap rpc.pipefs
+ after quota
+}
+
+start() {
+ ebegin "Starting idmapd"
+ ${rpc_bin} ${OPTS_RPC_IDMAPD}
+ eend $? "make sure DNOTIFY support is enabled ..."
+}
+
+stop() {
+ ebegin "Stopping idmapd"
+ start-stop-daemon --stop --exec ${rpc_bin}
+ eend $?
+}
diff --git a/net-fs/nfs-utils/files/rpc.pipefs.initd b/net-fs/nfs-utils/files/rpc.pipefs.initd
new file mode 100644
index 00000000000..1cd79e229a8
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc.pipefs.initd
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+MNT="/var/lib/nfs/rpc_pipefs"
+
+mount_pipefs() {
+ local fstype=rpc_pipefs
+
+ # if things are already mounted, nothing to do
+ mountinfo -q ${MNT} && return 0
+
+ # if rpc_pipefs is not available, try to load sunrpc for it #219566
+ grep -qs ${fstype} /proc/filesystems || modprobe -q sunrpc
+ # if still not available, the `mount` will issue an error for the user
+
+ # now just do it for kicks
+ mkdir -p ${MNT}
+ mount -t ${fstype} ${fstype} ${MNT}
+}
+
+start() {
+ ebegin "Setting up RPC pipefs"
+ mount_pipefs
+ eend $? "make sure you have NFS/SUNRPC enabled in your kernel"
+}
+
+stop() {
+ ebegin "Unmounting RPC pipefs"
+ umount ${MNT}
+ eend $?
+}
diff --git a/net-fs/nfs-utils/files/rpc.statd.initd b/net-fs/nfs-utils/files/rpc.statd.initd
new file mode 100755
index 00000000000..fd4a7a1e164
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc.statd.initd
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+rpc_bin=/sbin/rpc.statd
+rpc_pid=/var/run/rpc.statd.pid
+
+depend() {
+ use ypbind net
+ need portmap
+ after quota
+}
+
+start() {
+ # Don't start rpc.statd if already started by someone else ...
+ # Don't try and kill it if it's already dead ...
+ if killall -q -0 ${rpc_bin} ; then
+ return 0
+ fi
+
+ ebegin "Starting NFS statd"
+ start-stop-daemon --start --exec ${rpc_bin} -- --no-notify ${OPTS_RPC_STATD}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping NFS statd"
+ start-stop-daemon --stop --exec ${rpc_bin} --pidfile /var/run/rpc.statd.pid
+ eend $?
+}
diff --git a/net-fs/nfs-utils/files/rpc.svcgssd.initd b/net-fs/nfs-utils/files/rpc.svcgssd.initd
new file mode 100755
index 00000000000..f677cb56d23
--- /dev/null
+++ b/net-fs/nfs-utils/files/rpc.svcgssd.initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
+
+depend() {
+ use ypbind net
+ need portmap rpc.pipefs
+ after quota
+}
+
+start() {
+ ebegin "Starting svcgssd"
+ start-stop-daemon --start --exec /usr/sbin/rpc.svcgssd -- ${OPTS_RPC_SVCGSSD}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping svcgssd"
+ start-stop-daemon --stop --exec /usr/sbin/rpc.svcgssd
+ eend $?
+}
diff --git a/net-fs/nfs-utils/files/var-lib-nfs-rpc_pipefs.mount b/net-fs/nfs-utils/files/var-lib-nfs-rpc_pipefs.mount
new file mode 100644
index 00000000000..c4166582225
--- /dev/null
+++ b/net-fs/nfs-utils/files/var-lib-nfs-rpc_pipefs.mount
@@ -0,0 +1,7 @@
+[Unit]
+Description=RPC Pipe File System
+
+[Mount]
+What=rpc_pipefs
+Where=/var/lib/nfs/rpc_pipefs
+Type=rpc_pipefs
diff --git a/net-fs/nfs-utils/metadata.xml b/net-fs/nfs-utils/metadata.xml
new file mode 100644
index 00000000000..d89ebcfd96a
--- /dev/null
+++ b/net-fs/nfs-utils/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-fs</herd>
+ <longdescription>NFS client and server daemons</longdescription>
+ <use>
+ <flag name="libmount">Link mount.nfs with libmount</flag>
+ <flag name="nfsdcld">Enable nfsdcld NFSv4 clientid tracking daemon</flag>
+ <flag name="nfsidmap">Enable support for newer nfsidmap helper</flag>
+ <flag name="nfsv4">Enable support for NFSv4</flag>
+ <flag name="nfsv41">Enable support for NFSv4.1</flag>
+ <flag name="uuid">Support UUID lookups in rpc.mountd</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">nfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-fs/nfs-utils/nfs-utils-1.2.9-r3.ebuild b/net-fs/nfs-utils/nfs-utils-1.2.9-r3.ebuild
new file mode 100644
index 00000000000..d0ac4136738
--- /dev/null
+++ b/net-fs/nfs-utils/nfs-utils-1.2.9-r3.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic multilib autotools systemd
+
+DESCRIPTION="NFS client and server daemons"
+HOMEPAGE="http://linux-nfs.org/"
+SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="caps ipv6 kerberos +libmount nfsdcld +nfsidmap +nfsv4 nfsv41 selinux tcpd +uuid"
+REQUIRED_USE="kerberos? ( nfsv4 )"
+RESTRICT="test" #315573
+
+# kth-krb doesn't provide the right include
+# files, and nfs-utils doesn't build against heimdal either,
+# so don't depend on virtual/krb.
+# (04 Feb 2005 agriffis)
+DEPEND_COMMON="tcpd? ( sys-apps/tcp-wrappers )
+ caps? ( sys-libs/libcap )
+ sys-libs/e2fsprogs-libs
+ >=net-nds/rpcbind-0.2.0-r1
+ net-libs/libtirpc
+ libmount? ( sys-apps/util-linux )
+ nfsdcld? ( >=dev-db/sqlite-3.3 )
+ nfsv4? (
+ >=dev-libs/libevent-1.0b
+ >=net-libs/libnfsidmap-0.21-r1
+ kerberos? (
+ >=net-libs/libtirpc-0.2.4-r1[kerberos]
+ app-crypt/mit-krb5
+ )
+ nfsidmap? (
+ >=net-libs/libnfsidmap-0.24
+ sys-apps/keyutils
+ )
+ )
+ nfsv41? (
+ sys-fs/lvm2
+ )
+ uuid? ( sys-apps/util-linux )"
+RDEPEND="${DEPEND_COMMON}
+ !net-nds/portmap
+ selinux? (
+ sec-policy/selinux-rpc
+ sec-policy/selinux-rpcbind
+ )
+"
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.1.4-mtab-sym.patch
+ epatch "${FILESDIR}"/${PN}-1.2.8-cross-build.patch
+
+ sed \
+ -e "/^sbindir/s:= := \"${EPREFIX}\":g" \
+ -i utils/*/Makefile.am || die
+
+ eautoreconf
+}
+
+src_configure() {
+ export libsqlite3_cv_is_recent=yes # Our DEPEND forces this.
+ export ac_cv_header_keyutils_h=$(usex nfsidmap)
+ econf \
+ --with-statedir="${EPREFIX}"/var/lib/nfs \
+ --enable-tirpc \
+ --with-tirpcinclude="${EPREFIX}"/usr/include/tirpc/ \
+ $(use_enable libmount libmount-mount) \
+ $(use_with tcpd tcp-wrappers) \
+ $(use_enable nfsdcld nfsdcltrack) \
+ $(use_enable nfsv4) \
+ $(use_enable nfsv41) \
+ $(use_enable ipv6) \
+ $(use_enable caps) \
+ $(use_enable uuid) \
+ $(use_enable kerberos gss) \
+ --without-gssglue
+}
+
+src_compile(){
+ # remove compiled files bundled in the tarball
+ emake clean
+ default
+}
+
+src_install() {
+ default
+ rm linux-nfs/Makefile* || die
+ dodoc -r linux-nfs README
+
+ # Don't overwrite existing xtab/etab, install the original
+ # versions somewhere safe... more info in pkg_postinst
+ keepdir /var/lib/nfs/{,sm,sm.bak}
+ mv "${ED}"/var/lib "${ED}"/usr/$(get_libdir) || die
+
+ # Install some client-side binaries in /sbin
+ dodir /sbin
+ mv "${ED}"/usr/sbin/rpc.statd "${ED}"/sbin/ || die
+
+ if use nfsv4 && use nfsidmap ; then
+ # Install a config file for idmappers in newer kernels. #415625
+ insinto /etc/request-key.d
+ echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf
+ doins id_resolver.conf
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/exports
+
+ local f list=() opt_need=""
+ if use nfsv4 ; then
+ opt_need="rpc.idmapd"
+ list+=( rpc.idmapd rpc.pipefs )
+ use kerberos && list+=( rpc.gssd rpc.svcgssd )
+ fi
+ for f in nfs nfsmount rpc.statd "${list[@]}" ; do
+ newinitd "${FILESDIR}"/${f}.initd ${f}
+ done
+ for f in nfs nfsmount ; do
+ newconfd "${FILESDIR}"/${f}.confd ${f}
+ done
+ sed -i \
+ -e "/^NFS_NEEDED_SERVICES=/s:=.*:=\"${opt_need}\":" \
+ "${ED}"/etc/conf.d/nfs || die #234132
+
+ systemd_dotmpfilesd "${FILESDIR}"/nfs-utils.conf
+ systemd_newunit "${FILESDIR}"/nfsd.service-r1 nfsd.service
+ systemd_newunit "${FILESDIR}"/rpc-statd.service-r2 rpc-statd.service
+ systemd_newunit "${FILESDIR}"/rpc-mountd.service-r1 rpc-mountd.service
+ systemd_dounit "${FILESDIR}"/rpc-idmapd.service
+ systemd_dounit "${FILESDIR}"/{proc-fs-nfsd,var-lib-nfs-rpc_pipefs}.mount
+ use nfsv4 && use kerberos && systemd_dounit "${FILESDIR}"/rpc-{gssd,svcgssd}.service
+}
+
+pkg_postinst() {
+ # Install default xtab and friends if there's none existing. In
+ # src_install we put them in /usr/lib/nfs for safe-keeping, but
+ # the daemons actually use the files in /var/lib/nfs. #30486
+ local f
+ mkdir -p "${EROOT}"/var/lib/nfs #368505
+ for f in "${EROOT}"/usr/$(get_libdir)/nfs/*; do
+ [[ -e ${EROOT}/var/lib/nfs/${f##*/} ]] && continue
+ einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs"
+ cp -pPR "${f}" "${EROOT}"/var/lib/nfs/
+ done
+}
diff --git a/net-fs/nfs-utils/nfs-utils-1.3.1-r4.ebuild b/net-fs/nfs-utils/nfs-utils-1.3.1-r4.ebuild
new file mode 100644
index 00000000000..dfef08df4f8
--- /dev/null
+++ b/net-fs/nfs-utils/nfs-utils-1.3.1-r4.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic multilib autotools systemd
+
+DESCRIPTION="NFS client and server daemons"
+HOMEPAGE="http://linux-nfs.org/"
+SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86"
+IUSE="caps ipv6 kerberos +libmount nfsdcld +nfsidmap +nfsv4 nfsv41 selinux tcpd +uuid"
+REQUIRED_USE="kerberos? ( nfsv4 )"
+RESTRICT="test" #315573
+
+# kth-krb doesn't provide the right include
+# files, and nfs-utils doesn't build against heimdal either,
+# so don't depend on virtual/krb.
+# (04 Feb 2005 agriffis)
+DEPEND_COMMON="tcpd? ( sys-apps/tcp-wrappers )
+ caps? ( sys-libs/libcap )
+ sys-libs/e2fsprogs-libs
+ >=net-nds/rpcbind-0.2.0-r1
+ net-libs/libtirpc
+ libmount? ( sys-apps/util-linux )
+ nfsdcld? ( >=dev-db/sqlite-3.3 )
+ nfsv4? (
+ <=dev-libs/libevent-2.1
+ >=net-libs/libnfsidmap-0.21-r1
+ kerberos? (
+ >=net-libs/libtirpc-0.2.4-r1[kerberos]
+ app-crypt/mit-krb5
+ )
+ nfsidmap? (
+ >=net-libs/libnfsidmap-0.24
+ >=sys-apps/keyutils-1.5.9
+ )
+ )
+ nfsv41? (
+ sys-fs/lvm2
+ )
+ uuid? ( sys-apps/util-linux )"
+RDEPEND="${DEPEND_COMMON}
+ !net-nds/portmap
+ !<sys-apps/openrc-0.13.4
+ selinux? (
+ sec-policy/selinux-rpc
+ sec-policy/selinux-rpcbind
+ )
+"
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.1.4-mtab-sym.patch
+ epatch "${FILESDIR}"/${PN}-1.2.8-cross-build.patch
+
+ sed \
+ -e "/^sbindir/s:= := \"${EPREFIX}\":g" \
+ -i utils/*/Makefile.am || die
+
+ eautoreconf
+}
+
+src_configure() {
+ export libsqlite3_cv_is_recent=yes # Our DEPEND forces this.
+ export ac_cv_header_keyutils_h=$(usex nfsidmap)
+ econf \
+ --with-statedir="${EPREFIX}"/var/lib/nfs \
+ --enable-tirpc \
+ --with-tirpcinclude="${EPREFIX}"/usr/include/tirpc/ \
+ $(use_enable libmount libmount-mount) \
+ $(use_with tcpd tcp-wrappers) \
+ $(use_enable nfsdcld nfsdcltrack) \
+ $(use_enable nfsv4) \
+ $(use_enable nfsv41) \
+ $(use_enable ipv6) \
+ $(use_enable caps) \
+ $(use_enable uuid) \
+ $(use_enable kerberos gss) \
+ --without-gssglue
+}
+
+src_compile(){
+ # remove compiled files bundled in the tarball
+ emake clean
+ default
+}
+
+src_install() {
+ default
+ rm linux-nfs/Makefile* || die
+ dodoc -r linux-nfs README
+
+ # Don't overwrite existing xtab/etab, install the original
+ # versions somewhere safe... more info in pkg_postinst
+ keepdir /var/lib/nfs/{,sm,sm.bak}
+ mv "${ED}"/var/lib "${ED}"/usr/$(get_libdir) || die
+
+ # Install some client-side binaries in /sbin
+ dodir /sbin
+ mv "${ED}"/usr/sbin/rpc.statd "${ED}"/sbin/ || die
+
+ if use nfsv4 && use nfsidmap ; then
+ # Install a config file for idmappers in newer kernels. #415625
+ insinto /etc/request-key.d
+ echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf
+ doins id_resolver.conf
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/exports
+ keepdir /etc/exports.d
+
+ local f list=() opt_need=""
+ if use nfsv4 ; then
+ opt_need="rpc.idmapd"
+ list+=( rpc.idmapd rpc.pipefs )
+ use kerberos && list+=( rpc.gssd rpc.svcgssd )
+ fi
+ for f in nfs nfsclient rpc.statd "${list[@]}" ; do
+ newinitd "${FILESDIR}"/${f}.initd ${f}
+ done
+ newinitd "${FILESDIR}"/nfsmount.initd-1.3.1 nfsmount # Nuke after 2015/08/01
+ for f in nfs nfsclient ; do
+ newconfd "${FILESDIR}"/${f}.confd ${f}
+ done
+ sed -i \
+ -e "/^NFS_NEEDED_SERVICES=/s:=.*:=\"${opt_need}\":" \
+ "${ED}"/etc/conf.d/nfs || die #234132
+
+ systemd_dounit systemd/*.{mount,service,target}
+ if ! use nfsv4 || ! use kerberos ; then
+ rm "${D}$(systemd_get_unitdir)"/rpc-{gssd,svcgssd}.service || die
+ fi
+ rm "${D}$(systemd_get_unitdir)"/nfs-config.service || die
+ sed -i -r \
+ -e "/^EnvironmentFile=/s:=.*:=${EPREFIX}/etc/conf.d/nfs:" \
+ -e '/^(After|Wants)=nfs-config.service$/d' \
+ -e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \
+ "${D}$(systemd_get_unitdir)"/* || die
+}
+
+pkg_postinst() {
+ # Install default xtab and friends if there's none existing. In
+ # src_install we put them in /usr/lib/nfs for safe-keeping, but
+ # the daemons actually use the files in /var/lib/nfs. #30486
+ local f
+ mkdir -p "${EROOT}"/var/lib/nfs #368505
+ for f in "${EROOT}"/usr/$(get_libdir)/nfs/*; do
+ [[ -e ${EROOT}/var/lib/nfs/${f##*/} ]] && continue
+ einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs"
+ cp -pPR "${f}" "${EROOT}"/var/lib/nfs/
+ done
+
+ if systemd_is_booted; then
+ if [[ ${REPLACING_VERSIONS} < 1.3.0 ]]; then
+ ewarn "We have switched to upstream systemd unit files. Since"
+ ewarn "they got renamed, you should probably enable the new ones."
+ ewarn "You can run 'equery files nfs-utils | grep systemd'"
+ ewarn "to know what services you need to enable now."
+ fi
+ else
+ ewarn "If you use OpenRC, the nfsmount service has been replaced with nfsclient."
+ ewarn "If you were using nfsmount, please add nfsclient and netmount to the"
+ ewarn "same runlevel as nfsmount."
+ fi
+}
diff --git a/net-fs/nfs-utils/nfs-utils-1.3.1-r5.ebuild b/net-fs/nfs-utils/nfs-utils-1.3.1-r5.ebuild
new file mode 100644
index 00000000000..a903a2298d3
--- /dev/null
+++ b/net-fs/nfs-utils/nfs-utils-1.3.1-r5.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic multilib autotools systemd
+
+DESCRIPTION="NFS client and server daemons"
+HOMEPAGE="http://linux-nfs.org/"
+SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="caps ipv6 kerberos +libmount nfsdcld +nfsidmap +nfsv4 nfsv41 selinux tcpd +uuid"
+REQUIRED_USE="kerberos? ( nfsv4 )"
+RESTRICT="test" #315573
+
+# kth-krb doesn't provide the right include
+# files, and nfs-utils doesn't build against heimdal either,
+# so don't depend on virtual/krb.
+# (04 Feb 2005 agriffis)
+DEPEND_COMMON="tcpd? ( sys-apps/tcp-wrappers )
+ caps? ( sys-libs/libcap )
+ sys-libs/e2fsprogs-libs
+ >=net-nds/rpcbind-0.2.0-r1
+ net-libs/libtirpc
+ libmount? ( sys-apps/util-linux )
+ nfsdcld? ( >=dev-db/sqlite-3.3 )
+ nfsv4? (
+ <=dev-libs/libevent-2.1
+ >=net-libs/libnfsidmap-0.21-r1
+ kerberos? (
+ >=net-libs/libtirpc-0.2.4-r1[kerberos]
+ app-crypt/mit-krb5
+ )
+ nfsidmap? (
+ >=net-libs/libnfsidmap-0.24
+ >=sys-apps/keyutils-1.5.9
+ )
+ )
+ nfsv41? (
+ sys-fs/lvm2
+ )
+ uuid? ( sys-apps/util-linux )"
+RDEPEND="${DEPEND_COMMON}
+ !net-nds/portmap
+ !<sys-apps/openrc-0.13.9
+ selinux? (
+ sec-policy/selinux-rpc
+ sec-policy/selinux-rpcbind
+ )
+"
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.1.4-mtab-sym.patch
+ epatch "${FILESDIR}"/${PN}-1.2.8-cross-build.patch
+
+ sed \
+ -e "/^sbindir/s:= := \"${EPREFIX}\":g" \
+ -i utils/*/Makefile.am || die
+
+ eautoreconf
+}
+
+src_configure() {
+ export libsqlite3_cv_is_recent=yes # Our DEPEND forces this.
+ export ac_cv_header_keyutils_h=$(usex nfsidmap)
+ econf \
+ --with-statedir="${EPREFIX}"/var/lib/nfs \
+ --enable-tirpc \
+ --with-tirpcinclude="${EPREFIX}"/usr/include/tirpc/ \
+ $(use_enable libmount libmount-mount) \
+ $(use_with tcpd tcp-wrappers) \
+ $(use_enable nfsdcld nfsdcltrack) \
+ $(use_enable nfsv4) \
+ $(use_enable nfsv41) \
+ $(use_enable ipv6) \
+ $(use_enable caps) \
+ $(use_enable uuid) \
+ $(use_enable kerberos gss) \
+ --without-gssglue
+}
+
+src_compile(){
+ # remove compiled files bundled in the tarball
+ emake clean
+ default
+}
+
+src_install() {
+ default
+ rm linux-nfs/Makefile* || die
+ dodoc -r linux-nfs README
+
+ # Don't overwrite existing xtab/etab, install the original
+ # versions somewhere safe... more info in pkg_postinst
+ keepdir /var/lib/nfs/{,sm,sm.bak}
+ mv "${ED}"/var/lib "${ED}"/usr/$(get_libdir) || die
+
+ # Install some client-side binaries in /sbin
+ dodir /sbin
+ mv "${ED}"/usr/sbin/rpc.statd "${ED}"/sbin/ || die
+
+ if use nfsv4 && use nfsidmap ; then
+ # Install a config file for idmappers in newer kernels. #415625
+ insinto /etc/request-key.d
+ echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf
+ doins id_resolver.conf
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/exports
+ keepdir /etc/exports.d
+
+ local f list=() opt_need=""
+ if use nfsv4 ; then
+ opt_need="rpc.idmapd"
+ list+=( rpc.idmapd rpc.pipefs )
+ use kerberos && list+=( rpc.gssd rpc.svcgssd )
+ fi
+ for f in nfs nfsclient rpc.statd "${list[@]}" ; do
+ newinitd "${FILESDIR}"/${f}.initd ${f}
+ done
+ newinitd "${FILESDIR}"/nfsmount.initd-1.3.1 nfsmount # Nuke after 2015/08/01
+ for f in nfs nfsclient ; do
+ newconfd "${FILESDIR}"/${f}.confd ${f}
+ done
+ sed -i \
+ -e "/^NFS_NEEDED_SERVICES=/s:=.*:=\"${opt_need}\":" \
+ "${ED}"/etc/conf.d/nfs || die #234132
+
+ systemd_dounit systemd/*.{mount,service,target}
+ if ! use nfsv4 || ! use kerberos ; then
+ rm "${D}$(systemd_get_unitdir)"/rpc-{gssd,svcgssd}.service || die
+ fi
+ rm "${D}$(systemd_get_unitdir)"/nfs-config.service || die
+ sed -i -r \
+ -e "/^EnvironmentFile=/s:=.*:=${EPREFIX}/etc/conf.d/nfs:" \
+ -e '/^(After|Wants)=nfs-config.service$/d' \
+ -e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \
+ "${D}$(systemd_get_unitdir)"/* || die
+}
+
+pkg_postinst() {
+ # Install default xtab and friends if there's none existing. In
+ # src_install we put them in /usr/lib/nfs for safe-keeping, but
+ # the daemons actually use the files in /var/lib/nfs. #30486
+ local f
+ mkdir -p "${EROOT}"/var/lib/nfs #368505
+ for f in "${EROOT}"/usr/$(get_libdir)/nfs/*; do
+ [[ -e ${EROOT}/var/lib/nfs/${f##*/} ]] && continue
+ einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs"
+ cp -pPR "${f}" "${EROOT}"/var/lib/nfs/
+ done
+
+ if systemd_is_booted; then
+ if [[ ${REPLACING_VERSIONS} < 1.3.0 ]]; then
+ ewarn "We have switched to upstream systemd unit files. Since"
+ ewarn "they got renamed, you should probably enable the new ones."
+ ewarn "You can run 'equery files nfs-utils | grep systemd'"
+ ewarn "to know what services you need to enable now."
+ fi
+ else
+ ewarn "If you use OpenRC, the nfsmount service has been replaced with nfsclient."
+ ewarn "If you were using nfsmount, please add nfsclient and netmount to the"
+ ewarn "same runlevel as nfsmount."
+ fi
+}
diff --git a/net-fs/nfs-utils/nfs-utils-1.3.2-r6.ebuild b/net-fs/nfs-utils/nfs-utils-1.3.2-r6.ebuild
new file mode 100644
index 00000000000..5843c4ddb5d
--- /dev/null
+++ b/net-fs/nfs-utils/nfs-utils-1.3.2-r6.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic multilib autotools systemd
+
+DESCRIPTION="NFS client and server daemons"
+HOMEPAGE="http://linux-nfs.org/"
+SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="caps ipv6 kerberos +libmount nfsdcld +nfsidmap +nfsv4 nfsv41 selinux tcpd +uuid"
+REQUIRED_USE="kerberos? ( nfsv4 )"
+RESTRICT="test" #315573
+
+# kth-krb doesn't provide the right include
+# files, and nfs-utils doesn't build against heimdal either,
+# so don't depend on virtual/krb.
+# (04 Feb 2005 agriffis)
+DEPEND_COMMON="tcpd? ( sys-apps/tcp-wrappers )
+ caps? ( sys-libs/libcap )
+ sys-libs/e2fsprogs-libs
+ >=net-nds/rpcbind-0.2.0-r1
+ net-libs/libtirpc
+ libmount? ( sys-apps/util-linux )
+ nfsdcld? ( >=dev-db/sqlite-3.3 )
+ nfsv4? (
+ dev-libs/libevent
+ >=net-libs/libnfsidmap-0.21-r1
+ kerberos? (
+ >=net-libs/libtirpc-0.2.4-r1[kerberos]
+ app-crypt/mit-krb5
+ )
+ nfsidmap? (
+ >=net-libs/libnfsidmap-0.24
+ >=sys-apps/keyutils-1.5.9
+ )
+ )
+ nfsv41? (
+ sys-fs/lvm2
+ )
+ uuid? ( sys-apps/util-linux )"
+RDEPEND="${DEPEND_COMMON}
+ !net-nds/portmap
+ !<sys-apps/openrc-0.13.9
+ selinux? (
+ sec-policy/selinux-rpc
+ sec-policy/selinux-rpcbind
+ )
+"
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.1.4-mtab-sym.patch
+ epatch "${FILESDIR}"/${PN}-1.2.8-cross-build.patch
+ epatch "${FILESDIR}"/${PN}-1.3.2-background-statd.patch
+
+ sed \
+ -e "/^sbindir/s:= := \"${EPREFIX}\":g" \
+ -i utils/*/Makefile.am || die
+
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ export libsqlite3_cv_is_recent=yes # Our DEPEND forces this.
+ export ac_cv_header_keyutils_h=$(usex nfsidmap)
+ econf \
+ --with-statedir="${EPREFIX}"/var/lib/nfs \
+ --enable-tirpc \
+ --with-tirpcinclude="${EPREFIX}"/usr/include/tirpc/ \
+ $(use_enable libmount libmount-mount) \
+ $(use_with tcpd tcp-wrappers) \
+ $(use_enable nfsdcld nfsdcltrack) \
+ $(use_enable nfsv4) \
+ $(use_enable nfsv41) \
+ $(use_enable ipv6) \
+ $(use_enable caps) \
+ $(use_enable uuid) \
+ $(use_enable kerberos gss) \
+ --without-gssglue
+}
+
+src_compile(){
+ # remove compiled files bundled in the tarball
+ emake clean
+ default
+}
+
+src_install() {
+ default
+ rm linux-nfs/Makefile* || die
+ dodoc -r linux-nfs README
+
+ # Don't overwrite existing xtab/etab, install the original
+ # versions somewhere safe... more info in pkg_postinst
+ keepdir /var/lib/nfs/{,sm,sm.bak}
+ mv "${ED}"/var/lib "${ED}"/usr/$(get_libdir) || die
+
+ # Install some client-side binaries in /sbin
+ dodir /sbin
+ mv "${ED}"/usr/sbin/rpc.statd "${ED}"/sbin/ || die
+
+ if use nfsv4 && use nfsidmap ; then
+ # Install a config file for idmappers in newer kernels. #415625
+ insinto /etc/request-key.d
+ echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf
+ doins id_resolver.conf
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/exports
+ keepdir /etc/exports.d
+
+ local f list=() opt_need=""
+ if use nfsv4 ; then
+ opt_need="rpc.idmapd"
+ list+=( rpc.idmapd rpc.pipefs )
+ use kerberos && list+=( rpc.gssd rpc.svcgssd )
+ fi
+ for f in nfs nfsclient rpc.statd "${list[@]}" ; do
+ newinitd "${FILESDIR}"/${f}.initd ${f}
+ done
+ newinitd "${FILESDIR}"/nfsmount.initd-1.3.1 nfsmount # Nuke after 2015/08/01
+ for f in nfs nfsclient ; do
+ newconfd "${FILESDIR}"/${f}.confd ${f}
+ done
+ sed -i \
+ -e "/^NFS_NEEDED_SERVICES=/s:=.*:=\"${opt_need}\":" \
+ "${ED}"/etc/conf.d/nfs || die #234132
+
+ systemd_dounit systemd/*.{mount,service,target}
+ if ! use nfsv4 || ! use kerberos ; then
+ rm "${D}$(systemd_get_unitdir)"/rpc-{gssd,svcgssd}.service || die
+ fi
+ if ! use nfsv41 ; then
+ rm "${D}$(systemd_get_unitdir)"/nfs-blkmap.* || die
+ fi
+ rm "${D}$(systemd_get_unitdir)"/nfs-config.service || die
+ sed -i -r \
+ -e "/^EnvironmentFile=/s:=.*:=${EPREFIX}/etc/conf.d/nfs:" \
+ -e '/^(After|Wants)=nfs-config.service$/d' \
+ -e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \
+ "${D}$(systemd_get_unitdir)"/* || die
+}
+
+pkg_postinst() {
+ # Install default xtab and friends if there's none existing. In
+ # src_install we put them in /usr/lib/nfs for safe-keeping, but
+ # the daemons actually use the files in /var/lib/nfs. #30486
+ local f
+ mkdir -p "${EROOT}"/var/lib/nfs #368505
+ for f in "${EROOT}"/usr/$(get_libdir)/nfs/*; do
+ [[ -e ${EROOT}/var/lib/nfs/${f##*/} ]] && continue
+ einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs"
+ cp -pPR "${f}" "${EROOT}"/var/lib/nfs/
+ done
+
+ if systemd_is_booted; then
+ if [[ ${REPLACING_VERSIONS} < 1.3.0 ]]; then
+ ewarn "We have switched to upstream systemd unit files. Since"
+ ewarn "they got renamed, you should probably enable the new ones."
+ ewarn "You can run 'equery files nfs-utils | grep systemd'"
+ ewarn "to know what services you need to enable now."
+ fi
+ else
+ ewarn "If you use OpenRC, the nfsmount service has been replaced with nfsclient."
+ ewarn "If you were using nfsmount, please add nfsclient and netmount to the"
+ ewarn "same runlevel as nfsmount."
+ fi
+}
diff --git a/net-fs/nfs4-acl-tools/Manifest b/net-fs/nfs4-acl-tools/Manifest
new file mode 100644
index 00000000000..6f74fe600cc
--- /dev/null
+++ b/net-fs/nfs4-acl-tools/Manifest
@@ -0,0 +1 @@
+DIST nfs4-acl-tools-0.3.3.tar.gz 176018 SHA256 1990cf5664ff1258695d5f15100b352912366ea2db2c661941adf053bbe966b4 SHA512 8efa67c9f8a2f360c96b0df4e4aad55c044544188ebacd2e23b5f1c8a2c6c03d06cb8ffa434b03f502351a3403e98f4013bf6e6d9c85909995747b5489ea22d7 WHIRLPOOL 4fd941e18571a987e67b598e3dbaae9cfab51ef757e9fb0a2affd60a0dda75ca269f4f37ed85f00b6ec9fe70749eb4634c9add06a6fd792ec431eaf6ef110b36
diff --git a/net-fs/nfs4-acl-tools/metadata.xml b/net-fs/nfs4-acl-tools/metadata.xml
new file mode 100644
index 00000000000..ca66751dee2
--- /dev/null
+++ b/net-fs/nfs4-acl-tools/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-fs</herd>
+</pkgmetadata>
diff --git a/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.3.3.ebuild b/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.3.3.ebuild
new file mode 100644
index 00000000000..63998ee64b7
--- /dev/null
+++ b/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.3.3.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Commandline and GUI tools that deal directly with NFSv4 ACLs"
+HOMEPAGE="http://www.citi.umich.edu/projects/nfsv4/linux/"
+SRC_URI="http://www.citi.umich.edu/projects/nfsv4/linux/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-apps/attr"
+RDEPEND="${DEPEND}"
diff --git a/net-fs/nfstest/Manifest b/net-fs/nfstest/Manifest
new file mode 100644
index 00000000000..40e21f475d6
--- /dev/null
+++ b/net-fs/nfstest/Manifest
@@ -0,0 +1 @@
+DIST NFStest-1.0.2.tar.gz 214840 SHA256 9fcde8dfb8da1a36626c5af907eae052ff6530b11a0b0cbf2851eef4f82fa10c SHA512 3758f6af8c3959274a3dfdc33a3c9e76451bd46c85b779ce7352ec4b4d616273ff2b409598fb31dbaf4663b8a2d743f9e0a1cc3a0c4eabcd918d6d5fbed2f09e WHIRLPOOL c97d65634d01eeb0087f8545781c8402ef195d6bd819f812aec7cbe7908cac76fe13da2e8c78c24d714a5e515bd7f61cbbbc3e4865984d2eb88261c02454f0e3
diff --git a/net-fs/nfstest/metadata.xml b/net-fs/nfstest/metadata.xml
new file mode 100644
index 00000000000..4a00a64b40a
--- /dev/null
+++ b/net-fs/nfstest/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-fs/nfstest/nfstest-1.0.2.ebuild b/net-fs/nfstest/nfstest-1.0.2.ebuild
new file mode 100644
index 00000000000..2e673217dc0
--- /dev/null
+++ b/net-fs/nfstest/nfstest-1.0.2.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+MY_PN="NFStest"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Tools for testing either the NFS client or the NFS server"
+HOMEPAGE="http://wiki.linux-nfs.org/wiki/index.php/NFStest"
+SRC_URI="http://www.linux-nfs.org/~mora/nfstest/releases/${MY_P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="net-fs/nfs-utils"
+DEPEND=""
+
+S="${WORKDIR}"/${MY_P}
diff --git a/net-fs/openafs-kernel/Manifest b/net-fs/openafs-kernel/Manifest
new file mode 100644
index 00000000000..746c5ef5ea0
--- /dev/null
+++ b/net-fs/openafs-kernel/Manifest
@@ -0,0 +1,9 @@
+DIST openafs-1.6.11-doc.tar.bz2 3530829 SHA256 d5cfa17ec06812a9961960bfdf54c1a753f512826fbbb41e3fdbb2310b5b5a59 SHA512 9bd792eae719c6cfa3d250ae31fcc2cd47e40d0b78f5e3453a5b242255bc64d88b9943ac5a7ab2565509904499d6b11a94d27e9c9b48b515aa51bd8f0670ec67 WHIRLPOOL 1a6bdc5d0920eb046c6b975b4f17caca2e30295d0b26993edda17bec09adffa9254bfb5897979beb92ccafe4e1fbfc36d82ed715d46e967a6a0b1cb4bf4e05f8
+DIST openafs-1.6.11-patches.tar.xz 9628 SHA256 16fdf63d81bd986aea4112f43f4005912dd62175aeb355e7b729b309842c970c SHA512 8227cb156f7498afa70e3086f4bfd26672576229a8f847d24a85b495942270e4964aa715536d43c2e63bbd3f4ced7cd19971c76007cb8e2e5aef17fe0ceb9d1d WHIRLPOOL 9ae675c36ec5fe07b7d095705dc6ee02f4a4ac227d9396e29299d94cde10f18e217c06e3c62f73d3d2b07a43410b35e464e7b328e25710e6c497d093381ce158
+DIST openafs-1.6.11-src.tar.bz2 14605284 SHA256 cc42da08ef750a2363f7ea291e2264a9334c6ecf1400a75f5dabc170205bd01d SHA512 4e82553443009f899dfbd3eed0b9ed63c55aff5d5ce02f31657277385f0dfdef7e724b81a25fabb962d03b5a622d8d3fa9eca04879d1b84f4b253a52ea4ab90c WHIRLPOOL fbf188144643a71f7e505251033ed68c3d684dabd6647b4096c7a4010a76285db46c0cd586c5481635eb7da8406b5adee72c02528e59c4f89c6d923640cc93fb
+DIST openafs-1.6.11.1-doc.tar.bz2 3530413 SHA256 cb398583931e7f0edf17b2321a858afc62cffa3c48cf69021eccc198d3e764f9 SHA512 bcf48ae1e4f12a758adf3f64b60738cce6853501d66dce594df75d28687e939b2f369b485e27fbe116bd14816277c39ebe213f65f20c9ca6ab76946742ee18f8 WHIRLPOOL 6d8f5a2e602d4388dfca8634b7f5a8545bb39e5859b012700e0a361b4d7151eb8a6493e7a18f408a1ab54f083dfc4b0e8ca310c7772f5144dd0083af5b7488af
+DIST openafs-1.6.11.1-src.tar.bz2 14603197 SHA256 ae1a87faec8ee273f7d4baa69d1346f798415b38de72888decde011405423dc7 SHA512 43238d16d52498c62f6de944e030edeafdce9373074f961820d383bf82034511a484e79f1f655d5152f39abb38dfb744a9d02c47bb762c59e505de165bcc5579 WHIRLPOOL eb56015aaec4aa8c2a0d5aa901f4291a043e373d533bed5a48620e3b3a472226599dd083a4837ecc5a8763e7448ed1fb8c08aeec7ca53cf82db8be39d63dc522
+DIST openafs-1.6.12-doc.tar.bz2 3531628 SHA256 1b5726f77ee98ae45b4b6d0142a65724e8f08099eb1b2a4308ae8f0638199963 SHA512 b0389f5aecce913a50e827204c3d3f19964473d4b8b0e6e39d91d00971e4be57b4cfece0b4bc40fb3b6f5d7d60ee40b079883505625413f0748035452c3c2686 WHIRLPOOL a795b70caf84e17d5bea720a12e2c1aa159a34105f51dbcf60a464b2c8bf81a9624e8beede566c9c4b6ceeff424db7925bf588a7383f0860df8ec65828d32cc1
+DIST openafs-1.6.12-src.tar.bz2 14603726 SHA256 c47ffaa24bf2373264e330a624acafb5f509f4b00d63394b96e9bab131bf5802 SHA512 12c4b1ad12be7d44c56907f250b1d1ef94ca04f2b6e6d8c750da2a304cd0c60dd410516a3fa414442149e3a99c0cfd7aef283f09106889039035347793f01fc8 WHIRLPOOL f14e72aef41c47dd4e78b519b65fc01b67d709bd027a3004a501b621d71cc76f4d27ab5704421e39f05a611516ddcba9f1c2715fd4662cff13349be31b7a61a9
+DIST openafs-patches-20150503.tar.xz 9736 SHA256 066f61fe795e2cb3235a0a991abe8c5e876758bae7ea9bec61e98a3f601c9d7d SHA512 c687be78c7a6442b81c1362cab6ba215301911bdefcf39d2758ffeddecfa3efaa67990ea8277bbc1dedc14ad70a33213a37dbc45c43cd53871eec089759596c6 WHIRLPOOL 0935946c9a535f8e9ce6dd292801c671aef1c40f2a3f51aa4a85e5f4181fb46c3b2df55be56eec56c7fcab0eaf27d97cc6cef98c1b70178ba8cd7258174036cf
+DIST openafs-patches-20150626.tar.xz 10588 SHA256 b221842e82e4807e6b8064454df3792b12f3d73104462d83aa88c79e3028fb4a SHA512 b77df9dc734965301585d5f66732fef119282e49cbd5c121f45aa9f0b64fc6c62e1cd93c8b7ff81702f6baece0df3cf9d99ab796e84f2c0c610dc2e2fd3cedf6 WHIRLPOOL 71778ab6f64a156f8f559d446e09cbb8278f2f0965225a21767a2a28883e228620c37241cd439426a3163ede8b04f676f2b4aea7c14394c82bdc47dc2643e6b2
diff --git a/net-fs/openafs-kernel/metadata.xml b/net-fs/openafs-kernel/metadata.xml
new file mode 100644
index 00000000000..14612822dde
--- /dev/null
+++ b/net-fs/openafs-kernel/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-fs</herd>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>np.hardass@gmail.com</email>
+ <description>proxied maintainer, please assign bugs to</description>
+</maintainer>
+<maintainer>
+ <email>steve@pressers.name</email>
+ <name>Steven Presser</name>
+ <description>proxied maintainer, please CC on bugs</description>
+</maintainer>
+<maintainer>
+ <email>bircoph@gentoo.org</email>
+ <name>Andrew Savchenko</name>
+ <description>maintainer, please CC on bugs</description>
+</maintainer>
+</pkgmetadata>
diff --git a/net-fs/openafs-kernel/openafs-kernel-1.6.11.1.ebuild b/net-fs/openafs-kernel/openafs-kernel-1.6.11.1.ebuild
new file mode 100644
index 00000000000..4cf3439f3dd
--- /dev/null
+++ b/net-fs/openafs-kernel/openafs-kernel-1.6.11.1.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils linux-mod multilib toolchain-funcs versionator
+
+MY_PV=$(delete_version_separator '_')
+MY_PN="${PN/-kernel}"
+MY_P="${MY_PN}-${MY_PV}"
+PVER="20150503"
+
+DESCRIPTION="The OpenAFS distributed file system kernel module"
+HOMEPAGE="http://www.openafs.org/"
+# We always d/l the doc tarball as man pages are not USE=doc material
+[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE=""
+SRC_URI="
+ http://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2
+ http://openafs.org/dl/openafs/${MY_PV}/${MY_P}-doc.tar.bz2
+ http://dev.gentoo.org/~bircoph/patches/${MY_PN}-patches-${PVER}.tar.xz
+"
+
+LICENSE="IBM BSD openafs-krb5-a APSL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~amd64-fbsd ~amd64-linux ~sparc ~x86 ~x86-fbsd ~x86-linux"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+CONFIG_CHECK="!DEBUG_RODATA ~!AFS_FS KEYS"
+ERROR_DEBUG_RODATA="OpenAFS is incompatible with linux' CONFIG_DEBUG_RODATA option"
+ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!"
+ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled"
+
+QA_TEXTRELS_x86_fbsd="/boot/modules/libafs.ko"
+QA_TEXTRELS_amd64_fbsd="/boot/modules/libafs.ko"
+
+pkg_pretend() {
+ if use kernel_linux && kernel_is ge 4 1 ; then
+ ewarn "Gentoo supports kernels which are supported by OpenAFS"
+ ewarn "which are limited to the kernel versions: <4.1"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Please do not file a bug report about this."
+ fi
+}
+
+pkg_setup() {
+ if use kernel_linux; then
+ linux-mod_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # do not tamper with CFLAGS for the kernel module
+ EPATCH_EXCLUDE="040_all_flags.patch" \
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/gentoo/patches
+ epatch_user
+
+ # packaging is f-ed up, so we can't run eautoreconf
+ # run autotools commands based on what is listed in regen.sh
+ eaclocal -I src/cf
+ eautoconf
+ eautoconf -o configure-libafs configure-libafs.ac
+ eautoheader
+ einfo "Deleting autom4te.cache directory"
+ rm -rf autom4te.cache
+}
+
+src_configure() {
+ local myconf=""
+ # OpenAFS 1.6.11 has a bug with kernels 3.17-3.17.2 that requires a config option
+ if use kernel_linux && kernel_is -ge 3 17 && kernel_is -le 3 17 2; then
+ myconf="--enable-linux-d_splice_alias-extra-iput"
+ fi
+
+ ARCH="$(tc-arch-kernel)" \
+ econf \
+ --with-linux-kernel-headers=${KV_DIR} \
+ --with-linux-kernel-build=${KV_OUT_DIR} \
+ ${myconf}
+}
+
+src_compile() {
+ ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 -j1 only_libafs
+}
+
+src_install() {
+ if use kernel_linux; then
+ local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*)
+ [[ -f ${srcdir}/libafs.${KV_OBJ} ]] || die "Couldn't find compiled kernel module"
+
+ MODULE_NAMES="libafs(fs/openafs:${srcdir})"
+
+ linux-mod_src_install
+ elif use kernel_FreeBSD; then
+ insinto /boot/modules
+ doins "${S}"/src/libafs/MODLOAD/libafs.ko
+ fi
+}
+
+pkg_postinst() {
+ # Update linker.hints file
+ use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules"
+ use kernel_linux && linux-mod_pkg_postinst
+}
+
+pkg_postrm() {
+ # Update linker.hints file
+ use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules"
+ use kernel_linux && linux-mod_pkg_postrm
+}
diff --git a/net-fs/openafs-kernel/openafs-kernel-1.6.11.ebuild b/net-fs/openafs-kernel/openafs-kernel-1.6.11.ebuild
new file mode 100644
index 00000000000..c2f3c9c5296
--- /dev/null
+++ b/net-fs/openafs-kernel/openafs-kernel-1.6.11.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils linux-mod multilib toolchain-funcs versionator
+
+MY_PV=$(delete_version_separator '_')
+MY_P="${PN/-kernel}-${MY_PV}"
+PVER="1"
+OAFS_PVER="1.6.5"
+
+DESCRIPTION="The OpenAFS distributed file system kernel module"
+HOMEPAGE="http://www.openafs.org/"
+# We always d/l the doc tarball as man pages are not USE=doc material
+[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE=""
+SRC_URI="
+ http://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2
+ http://openafs.org/dl/openafs/${MY_PV}/${MY_P}-doc.tar.bz2
+ http://dev.gentoo.org/~bircoph/patches/${MY_P}-patches.tar.xz
+"
+
+LICENSE="IBM BSD openafs-krb5-a APSL-2"
+SLOT="0"
+KEYWORDS="amd64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+CONFIG_CHECK="!DEBUG_RODATA ~!AFS_FS KEYS"
+ERROR_DEBUG_RODATA="OpenAFS is incompatible with linux' CONFIG_DEBUG_RODATA option"
+ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!"
+ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled"
+
+QA_TEXTRELS_x86_fbsd="/boot/modules/libafs.ko"
+QA_TEXTRELS_amd64_fbsd="/boot/modules/libafs.ko"
+
+pkg_pretend() {
+ if use kernel_linux && kernel_is ge 4 ; then
+ ewarn "Gentoo supports kernels which are supported by OpenAFS"
+ ewarn "which are limited to the kernel versions: <4.0"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Please do not file a bug report about this."
+ fi
+}
+
+pkg_setup() {
+ if use kernel_linux; then
+ linux-mod_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # do not tamper with CFLAGS for the kernel module
+ EPATCH_EXCLUDE="040_all_flags.patch" \
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/gentoo/patches
+ epatch_user
+
+ # packaging is f-ed up, so we can't run eautoreconf
+ # run autotools commands based on what is listed in regen.sh
+ eaclocal -I src/cf
+ eautoconf
+ eautoconf -o configure-libafs configure-libafs.ac
+ eautoheader
+ einfo "Deleting autom4te.cache directory"
+ rm -rf autom4te.cache
+}
+
+src_configure() {
+ local myconf=""
+ # OpenAFS 1.6.11 has a bug with kernels 3.17-3.17.2 that requires a config option
+ if use kernel_linux && kernel_is -ge 3 17 && kernel_is -le 3 17 2; then
+ myconf="--enable-linux-d_splice_alias-extra-iput"
+ fi
+
+ ARCH="$(tc-arch-kernel)" \
+ econf \
+ --with-linux-kernel-headers=${KV_DIR} \
+ --with-linux-kernel-build=${KV_OUT_DIR} \
+ ${myconf}
+}
+
+src_compile() {
+ ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 -j1 only_libafs
+}
+
+src_install() {
+ if use kernel_linux; then
+ local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*)
+ [[ -f ${srcdir}/libafs.${KV_OBJ} ]] || die "Couldn't find compiled kernel module"
+
+ MODULE_NAMES="libafs(fs/openafs:${srcdir})"
+
+ linux-mod_src_install
+ elif use kernel_FreeBSD; then
+ insinto /boot/modules
+ doins "${S}"/src/libafs/MODLOAD/libafs.ko
+ fi
+}
+
+pkg_postinst() {
+ # Update linker.hints file
+ use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules"
+ use kernel_linux && linux-mod_pkg_postinst
+}
+
+pkg_postrm() {
+ # Update linker.hints file
+ use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules"
+ use kernel_linux && linux-mod_pkg_postrm
+}
diff --git a/net-fs/openafs-kernel/openafs-kernel-1.6.12.ebuild b/net-fs/openafs-kernel/openafs-kernel-1.6.12.ebuild
new file mode 100644
index 00000000000..93681afba6e
--- /dev/null
+++ b/net-fs/openafs-kernel/openafs-kernel-1.6.12.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils linux-mod multilib toolchain-funcs versionator
+
+MY_PV=$(delete_version_separator '_')
+MY_PN="${PN/-kernel}"
+MY_P="${MY_PN}-${MY_PV}"
+PVER="20150626"
+
+DESCRIPTION="The OpenAFS distributed file system kernel module"
+HOMEPAGE="http://www.openafs.org/"
+# We always d/l the doc tarball as man pages are not USE=doc material
+[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE=""
+SRC_URI="
+ http://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2
+ http://openafs.org/dl/openafs/${MY_PV}/${MY_P}-doc.tar.bz2
+ http://dev.gentoo.org/~bircoph/afs/${MY_PN}-patches-${PVER}.tar.xz
+"
+
+LICENSE="IBM BSD openafs-krb5-a APSL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~amd64-fbsd ~amd64-linux ~sparc ~x86 ~x86-fbsd ~x86-linux"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+CONFIG_CHECK="!DEBUG_RODATA ~!AFS_FS KEYS"
+ERROR_DEBUG_RODATA="OpenAFS is incompatible with linux' CONFIG_DEBUG_RODATA option"
+ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!"
+ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled"
+
+QA_TEXTRELS_x86_fbsd="/boot/modules/libafs.ko"
+QA_TEXTRELS_amd64_fbsd="/boot/modules/libafs.ko"
+
+pkg_pretend() {
+ if use kernel_linux && kernel_is ge 4 2 ; then
+ ewarn "Gentoo supports kernels which are supported by OpenAFS"
+ ewarn "which are limited to the kernel versions: <4.2"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Please do not file a bug report about this."
+ fi
+}
+
+pkg_setup() {
+ if use kernel_linux; then
+ linux-mod_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # do not tamper with CFLAGS for the kernel module
+ EPATCH_EXCLUDE="040_all_flags.patch" \
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/gentoo/patches
+ epatch_user
+
+ # packaging is f-ed up, so we can't run eautoreconf
+ # run autotools commands based on what is listed in regen.sh
+ eaclocal -I src/cf
+ eautoconf
+ eautoconf -o configure-libafs configure-libafs.ac
+ eautoheader
+ einfo "Deleting autom4te.cache directory"
+ rm -rf autom4te.cache
+}
+
+src_configure() {
+ local myconf=""
+ # OpenAFS 1.6.11 has a bug with kernels 3.17-3.17.2 that requires a config option
+ if use kernel_linux && kernel_is -ge 3 17 && kernel_is -le 3 17 2; then
+ myconf="--enable-linux-d_splice_alias-extra-iput"
+ fi
+
+ local ARCH="$(tc-arch-kernel)"
+ local MY_ARCH="$(tc-arch)"
+ local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC"
+
+ if use kernel_linux; then
+ myconf+=( --with-linux-kernel-headers="${KV_DIR}" \
+ --with-linux-kernel-build="${KV_OUT_DIR}"
+ )
+ elif use kernel_FreeBSD; then
+ myconf+=( --with-bsd-kernel-build="${BSD_BUILD_DIR}" )
+ fi
+ econf "${myconf[@]}"
+}
+
+src_compile() {
+ ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 -j1 only_libafs
+}
+
+src_install() {
+ if use kernel_linux; then
+ local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*)
+ [[ -f ${srcdir}/libafs.${KV_OBJ} ]] || die "Couldn't find compiled kernel module"
+
+ MODULE_NAMES="libafs(fs/openafs:${srcdir})"
+
+ linux-mod_src_install
+ elif use kernel_FreeBSD; then
+ insinto /boot/modules
+ doins "${S}"/src/libafs/MODLOAD/libafs.ko
+ fi
+}
+
+pkg_postinst() {
+ # Update linker.hints file
+ use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules"
+ use kernel_linux && linux-mod_pkg_postinst
+}
+
+pkg_postrm() {
+ # Update linker.hints file
+ use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules"
+ use kernel_linux && linux-mod_pkg_postrm
+}
diff --git a/net-fs/openafs-legacy/metadata.xml b/net-fs/openafs-legacy/metadata.xml
new file mode 100644
index 00000000000..dfc945c6112
--- /dev/null
+++ b/net-fs/openafs-legacy/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-fs</herd>
+</pkgmetadata>
diff --git a/net-fs/openafs-legacy/openafs-legacy-0.1.ebuild b/net-fs/openafs-legacy/openafs-legacy-0.1.ebuild
new file mode 100644
index 00000000000..d3200443541
--- /dev/null
+++ b/net-fs/openafs-legacy/openafs-legacy-0.1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Legacy path symlinks to access FHS-compliant OpenAFS installation"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-apps/baselayout"
+RDEPEND="${DEPEND}"
+PDEPEND="net-fs/openafs"
+
+S="${WORKDIR}"
+
+# As a guide for these links, acinclude.m4 from the openafs package was
+# used. A README file exists as well, but at the time of writing, the
+# afsbosserver-variable was inaccurately described.
+
+src_install() {
+ # some basenames for FHS paths
+ sysconfdir=/etc
+ libexecdir=/usr/libexec
+ localstatedir=/var/lib
+ sbindir=/usr/sbin
+
+ # create parent directories for Transarc mode
+ dodir /usr/{vice,afs}
+
+ # viceetcdir
+ viceetcdir=${sysconfdir}/openafs
+ dosym ${viceetcdir} /usr/vice/etc
+
+ # afssrvdir
+ afssrvbindir=${libexecdir}/openafs
+ dosym ${afssrvbindir} /usr/afs/bin
+
+ # afsconfdir
+ afsconfdir=${sysconfdir}/openafs/server
+ dosym ${afsconfdir} /usr/afs/etc
+
+ # afslocaldir
+ afslocaldir=${localstatedir}/openafs
+ dosym ${afslocaldir} /usr/afs/local
+
+ # afsdbdir
+ afsdbdir=${localstatedir}/openafs/db
+ dosym ${afsdbdir} /usr/afs/db
+
+ # afslogdir
+ afslogdir=${localstatedir}/openafs/logs
+ dosym ${afslogdir} /usr/afs/logs
+
+ # afsbosconfig
+ dodir ${afslocaldir}
+ dosym ${viceetcdir}/BosConfig ${afslocaldir}/BosConfig
+
+ # afsbosserver
+ dodir ${afssrvbindir}
+ dosym ${sbindir}/bosserver ${afssrvbindir}/bosserver
+}
+
+pkg_prerm() {
+ ewarn "It is recommended to remove this package AFTER removing openafs"
+ ewarn "This way there will be no dead links left lying around"
+}
diff --git a/net-fs/openafs/Manifest b/net-fs/openafs/Manifest
new file mode 100644
index 00000000000..746c5ef5ea0
--- /dev/null
+++ b/net-fs/openafs/Manifest
@@ -0,0 +1,9 @@
+DIST openafs-1.6.11-doc.tar.bz2 3530829 SHA256 d5cfa17ec06812a9961960bfdf54c1a753f512826fbbb41e3fdbb2310b5b5a59 SHA512 9bd792eae719c6cfa3d250ae31fcc2cd47e40d0b78f5e3453a5b242255bc64d88b9943ac5a7ab2565509904499d6b11a94d27e9c9b48b515aa51bd8f0670ec67 WHIRLPOOL 1a6bdc5d0920eb046c6b975b4f17caca2e30295d0b26993edda17bec09adffa9254bfb5897979beb92ccafe4e1fbfc36d82ed715d46e967a6a0b1cb4bf4e05f8
+DIST openafs-1.6.11-patches.tar.xz 9628 SHA256 16fdf63d81bd986aea4112f43f4005912dd62175aeb355e7b729b309842c970c SHA512 8227cb156f7498afa70e3086f4bfd26672576229a8f847d24a85b495942270e4964aa715536d43c2e63bbd3f4ced7cd19971c76007cb8e2e5aef17fe0ceb9d1d WHIRLPOOL 9ae675c36ec5fe07b7d095705dc6ee02f4a4ac227d9396e29299d94cde10f18e217c06e3c62f73d3d2b07a43410b35e464e7b328e25710e6c497d093381ce158
+DIST openafs-1.6.11-src.tar.bz2 14605284 SHA256 cc42da08ef750a2363f7ea291e2264a9334c6ecf1400a75f5dabc170205bd01d SHA512 4e82553443009f899dfbd3eed0b9ed63c55aff5d5ce02f31657277385f0dfdef7e724b81a25fabb962d03b5a622d8d3fa9eca04879d1b84f4b253a52ea4ab90c WHIRLPOOL fbf188144643a71f7e505251033ed68c3d684dabd6647b4096c7a4010a76285db46c0cd586c5481635eb7da8406b5adee72c02528e59c4f89c6d923640cc93fb
+DIST openafs-1.6.11.1-doc.tar.bz2 3530413 SHA256 cb398583931e7f0edf17b2321a858afc62cffa3c48cf69021eccc198d3e764f9 SHA512 bcf48ae1e4f12a758adf3f64b60738cce6853501d66dce594df75d28687e939b2f369b485e27fbe116bd14816277c39ebe213f65f20c9ca6ab76946742ee18f8 WHIRLPOOL 6d8f5a2e602d4388dfca8634b7f5a8545bb39e5859b012700e0a361b4d7151eb8a6493e7a18f408a1ab54f083dfc4b0e8ca310c7772f5144dd0083af5b7488af
+DIST openafs-1.6.11.1-src.tar.bz2 14603197 SHA256 ae1a87faec8ee273f7d4baa69d1346f798415b38de72888decde011405423dc7 SHA512 43238d16d52498c62f6de944e030edeafdce9373074f961820d383bf82034511a484e79f1f655d5152f39abb38dfb744a9d02c47bb762c59e505de165bcc5579 WHIRLPOOL eb56015aaec4aa8c2a0d5aa901f4291a043e373d533bed5a48620e3b3a472226599dd083a4837ecc5a8763e7448ed1fb8c08aeec7ca53cf82db8be39d63dc522
+DIST openafs-1.6.12-doc.tar.bz2 3531628 SHA256 1b5726f77ee98ae45b4b6d0142a65724e8f08099eb1b2a4308ae8f0638199963 SHA512 b0389f5aecce913a50e827204c3d3f19964473d4b8b0e6e39d91d00971e4be57b4cfece0b4bc40fb3b6f5d7d60ee40b079883505625413f0748035452c3c2686 WHIRLPOOL a795b70caf84e17d5bea720a12e2c1aa159a34105f51dbcf60a464b2c8bf81a9624e8beede566c9c4b6ceeff424db7925bf588a7383f0860df8ec65828d32cc1
+DIST openafs-1.6.12-src.tar.bz2 14603726 SHA256 c47ffaa24bf2373264e330a624acafb5f509f4b00d63394b96e9bab131bf5802 SHA512 12c4b1ad12be7d44c56907f250b1d1ef94ca04f2b6e6d8c750da2a304cd0c60dd410516a3fa414442149e3a99c0cfd7aef283f09106889039035347793f01fc8 WHIRLPOOL f14e72aef41c47dd4e78b519b65fc01b67d709bd027a3004a501b621d71cc76f4d27ab5704421e39f05a611516ddcba9f1c2715fd4662cff13349be31b7a61a9
+DIST openafs-patches-20150503.tar.xz 9736 SHA256 066f61fe795e2cb3235a0a991abe8c5e876758bae7ea9bec61e98a3f601c9d7d SHA512 c687be78c7a6442b81c1362cab6ba215301911bdefcf39d2758ffeddecfa3efaa67990ea8277bbc1dedc14ad70a33213a37dbc45c43cd53871eec089759596c6 WHIRLPOOL 0935946c9a535f8e9ce6dd292801c671aef1c40f2a3f51aa4a85e5f4181fb46c3b2df55be56eec56c7fcab0eaf27d97cc6cef98c1b70178ba8cd7258174036cf
+DIST openafs-patches-20150626.tar.xz 10588 SHA256 b221842e82e4807e6b8064454df3792b12f3d73104462d83aa88c79e3028fb4a SHA512 b77df9dc734965301585d5f66732fef119282e49cbd5c121f45aa9f0b64fc6c62e1cd93c8b7ff81702f6baece0df3cf9d99ab796e84f2c0c610dc2e2fd3cedf6 WHIRLPOOL 71778ab6f64a156f8f559d446e09cbb8278f2f0965225a21767a2a28883e228620c37241cd439426a3163ede8b04f676f2b4aea7c14394c82bdc47dc2643e6b2
diff --git a/net-fs/openafs/metadata.xml b/net-fs/openafs/metadata.xml
new file mode 100644
index 00000000000..8a2e43a1f56
--- /dev/null
+++ b/net-fs/openafs/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-fs</herd>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>np.hardass@gmail.com</email>
+ <description>proxied maintainer, please assign bugs to</description>
+</maintainer>
+<maintainer>
+ <email>steve@pressers.name</email>
+ <name>Steven Presser</name>
+ <description>proxied maintainer, please CC on bugs</description>
+</maintainer>
+<maintainer>
+ <email>bircoph@gentoo.org</email>
+ <name>Andrew Savchenko</name>
+ <description>maintainer, please CC on bugs</description>
+</maintainer>
+<use>
+ <flag name='modules'>Build libafs kernel module. Disable only if you know
+ what you're doing: without this module OpenAFS client will not work.</flag>
+</use>
+</pkgmetadata>
diff --git a/net-fs/openafs/openafs-1.6.11.1.ebuild b/net-fs/openafs/openafs-1.6.11.1.ebuild
new file mode 100644
index 00000000000..6223885baf3
--- /dev/null
+++ b/net-fs/openafs/openafs-1.6.11.1.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic multilib pam systemd toolchain-funcs versionator
+
+MY_PV=$(delete_version_separator '_')
+MY_P="${PN}-${MY_PV}"
+PVER="20150503"
+
+DESCRIPTION="The OpenAFS distributed file system"
+HOMEPAGE="http://www.openafs.org/"
+# We always d/l the doc tarball as man pages are not USE=doc material
+[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE=""
+SRC_URI="
+ http://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2
+ http://openafs.org/dl/openafs/${MY_PV}/${MY_P}-doc.tar.bz2
+ http://dev.gentoo.org/~bircoph/patches/${PN}-patches-${PVER}.tar.xz
+"
+
+LICENSE="IBM BSD openafs-krb5-a APSL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~amd64-linux ~sparc ~x86 ~x86-linux"
+
+IUSE="doc kerberos +modules pam"
+
+CDEPEND="
+ sys-libs/ncurses
+ pam? ( sys-libs/pam )
+ kerberos? ( virtual/krb5 )"
+
+DEPEND="${CDEPEND}
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ )"
+
+RDEPEND="${CDEPEND}
+ modules? ( ~net-fs/openafs-kernel-${PV} )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ EPATCH_EXCLUDE="050_all_job_server.patch" \
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/gentoo/patches
+ epatch_user
+
+ # fixing 2-nd level makefiles to honor flags
+ sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \
+ src/*/Makefile.in || die '*/Makefile.in sed failed'
+
+ # packaging is f-ed up, so we can't run eautoreconf
+ # run autotools commands based on what is listed in regen.sh
+ eaclocal -I src/cf
+ eautoconf
+ eautoconf -o configure-libafs configure-libafs.ac
+ eautoheader
+ einfo "Deleting autom4te.cache directory"
+ rm -rf autom4te.cache
+}
+
+src_configure() {
+ AFS_SYSKVERS=26 \
+ econf \
+ --disable-kernel-module \
+ --disable-strip-binaries \
+ --enable-supergroups \
+ $(use_enable pam) \
+ $(use_with doc html-xsl /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl) \
+ $(use_with kerberos krb5)
+}
+
+src_compile() {
+ emake all_nolibafs
+ local d
+ if use doc; then
+ for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
+ emake -C "${d}" html;
+ done
+ fi
+}
+
+src_install() {
+ local OPENRCDIR="${WORKDIR}/gentoo/openrc"
+ local SYSTEMDDIR="${WORKDIR}/gentoo/systemd"
+
+ emake DESTDIR="${ED}" install_nolibafs
+
+ insinto /etc/openafs
+ doins src/afsd/CellServDB
+ echo "/afs:/var/cache/openafs:200000" > "${ED}"/etc/openafs/cacheinfo
+ echo "openafs.org" > "${ED}"/etc/openafs/ThisCell
+
+ # pam_afs and pam_afs.krb have been installed in irregular locations, fix
+ if use pam ; then
+ dopammod "${ED}"/usr/$(get_libdir)/pam_afs*
+ fi
+ rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die
+
+ # remove kdump stuff provided by kexec-tools #222455
+ rm -rf "${ED}"/usr/sbin/kdump*
+
+ # avoid collision with mit_krb5's version of kpasswd
+ mv "${ED}"/usr/bin/kpasswd{,_afs} || die
+ mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die
+
+ # move lwp stuff around #200674 #330061
+ mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die
+ mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die
+ # update paths to the relocated lwp headers
+ sed -ri \
+ -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \
+ "${ED}"/usr/include/*.h \
+ "${ED}"/usr/include/*/*.h \
+ || die
+
+ # minimal documentation
+ use pam && doman src/pam/pam_afs.5
+ dodoc "${WORKDIR}/gentoo/README" src/afsd/CellServDB
+
+ # documentation package
+ if use doc ; then
+ dodoc -r doc/{arch,examples,protocol,txt}
+ dohtml -r doc/xml/*
+ fi
+
+ # Gentoo related scripts
+ newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client
+ newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client
+ newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server
+ newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server
+ systemd_dotmpfilesd "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf
+ systemd_dounit "${SYSTEMDDIR}"/openafs-client.service
+ systemd_dounit "${SYSTEMDDIR}"/openafs-server.service
+
+ # used directories: client
+ keepdir /etc/openafs
+ keepdir /var/cache/openafs
+
+ # used directories: server
+ keepdir /etc/openafs/server
+ diropts -m0700
+ keepdir /var/lib/openafs
+ keepdir /var/lib/openafs/db
+ diropts -m0755
+ keepdir /var/lib/openafs/logs
+
+ # link logfiles to /var/log
+ dosym ../lib/openafs/logs /var/log/openafs
+}
+
+pkg_preinst() {
+ ## Somewhat intelligently install default configuration files
+ ## (when they are not present)
+ local x
+ for x in cacheinfo CellServDB ThisCell ; do
+ if [ -e "${EROOT}"/etc/openafs/${x} ] ; then
+ cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/
+ fi
+ done
+}
+
+pkg_postinst() {
+ elog "This installation should work out of the box (at least the"
+ elog "client part doing global afs-cell browsing, unless you had"
+ elog "a previous and different configuration). If you want to"
+ elog "set up your own cell or modify the standard config,"
+ elog "please have a look at the Gentoo OpenAFS documentation"
+ elog "(warning: it is not yet up to date wrt the new file locations)"
+ elog
+ elog "The documentation can be found at:"
+ elog " https://wiki.gentoo.org/wiki/OpenAFS"
+}
diff --git a/net-fs/openafs/openafs-1.6.11.ebuild b/net-fs/openafs/openafs-1.6.11.ebuild
new file mode 100644
index 00000000000..193afc1c102
--- /dev/null
+++ b/net-fs/openafs/openafs-1.6.11.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic multilib pam systemd toolchain-funcs versionator
+
+MY_PV=$(delete_version_separator '_')
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="The OpenAFS distributed file system"
+HOMEPAGE="http://www.openafs.org/"
+# We always d/l the doc tarball as man pages are not USE=doc material
+[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE=""
+SRC_URI="
+ http://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2
+ http://openafs.org/dl/openafs/${MY_PV}/${MY_P}-doc.tar.bz2
+ http://dev.gentoo.org/~bircoph/patches/${P}-patches.tar.xz
+"
+
+LICENSE="IBM BSD openafs-krb5-a APSL-2"
+SLOT="0"
+KEYWORDS="amd64 sparc x86 ~amd64-linux ~x86-linux"
+
+IUSE="doc kerberos +modules pam"
+
+CDEPEND="
+ sys-libs/ncurses
+ pam? ( sys-libs/pam )
+ kerberos? ( virtual/krb5 )"
+
+DEPEND="${CDEPEND}
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ )"
+
+RDEPEND="${CDEPEND}
+ modules? ( ~net-fs/openafs-kernel-${PV} )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ EPATCH_EXCLUDE="050_all_job_server.patch" \
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/gentoo/patches
+ epatch_user
+
+ # fixing 2-nd level makefiles to honor flags
+ sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \
+ src/*/Makefile.in || die '*/Makefile.in sed failed'
+
+ # packaging is f-ed up, so we can't run eautoreconf
+ # run autotools commands based on what is listed in regen.sh
+ eaclocal -I src/cf
+ eautoconf
+ eautoconf -o configure-libafs configure-libafs.ac
+ eautoheader
+ einfo "Deleting autom4te.cache directory"
+ rm -rf autom4te.cache
+}
+
+src_configure() {
+ AFS_SYSKVERS=26 \
+ econf \
+ --disable-kernel-module \
+ --disable-strip-binaries \
+ --enable-supergroups \
+ $(use_enable pam) \
+ $(use_with doc html-xsl /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl) \
+ $(use_with kerberos krb5)
+}
+
+src_compile() {
+ emake all_nolibafs
+ local d
+ if use doc; then
+ for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
+ emake -C "${d}" html;
+ done
+ fi
+}
+
+src_install() {
+ local OPENRCDIR="${WORKDIR}/gentoo/openrc"
+ local SYSTEMDDIR="${WORKDIR}/gentoo/systemd"
+
+ emake DESTDIR="${ED}" install_nolibafs
+
+ insinto /etc/openafs
+ doins src/afsd/CellServDB
+ echo "/afs:/var/cache/openafs:200000" > "${ED}"/etc/openafs/cacheinfo
+ echo "openafs.org" > "${ED}"/etc/openafs/ThisCell
+
+ # pam_afs and pam_afs.krb have been installed in irregular locations, fix
+ if use pam ; then
+ dopammod "${ED}"/usr/$(get_libdir)/pam_afs*
+ fi
+ rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die
+
+ # remove kdump stuff provided by kexec-tools #222455
+ rm -rf "${ED}"/usr/sbin/kdump*
+
+ # avoid collision with mit_krb5's version of kpasswd
+ mv "${ED}"/usr/bin/kpasswd{,_afs} || die
+ mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die
+
+ # move lwp stuff around #200674 #330061
+ mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die
+ mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die
+ # update paths to the relocated lwp headers
+ sed -ri \
+ -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \
+ "${ED}"/usr/include/*.h \
+ "${ED}"/usr/include/*/*.h \
+ || die
+
+ # minimal documentation
+ use pam && doman src/pam/pam_afs.5
+ dodoc "${WORKDIR}/gentoo/README" src/afsd/CellServDB
+
+ # documentation package
+ if use doc ; then
+ dodoc -r doc/{arch,examples,protocol,txt}
+ dohtml -r doc/xml/*
+ fi
+
+ # Gentoo related scripts
+ newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client
+ newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client
+ newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server
+ newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server
+ systemd_dotmpfilesd "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf
+ systemd_dounit "${SYSTEMDDIR}"/openafs-client.service
+ systemd_dounit "${SYSTEMDDIR}"/openafs-server.service
+
+ # used directories: client
+ keepdir /etc/openafs
+ keepdir /var/cache/openafs
+
+ # used directories: server
+ keepdir /etc/openafs/server
+ diropts -m0700
+ keepdir /var/lib/openafs
+ keepdir /var/lib/openafs/db
+ diropts -m0755
+ keepdir /var/lib/openafs/logs
+
+ # link logfiles to /var/log
+ dosym ../lib/openafs/logs /var/log/openafs
+}
+
+pkg_preinst() {
+ ## Somewhat intelligently install default configuration files
+ ## (when they are not present)
+ local x
+ for x in cacheinfo CellServDB ThisCell ; do
+ if [ -e "${EROOT}"/etc/openafs/${x} ] ; then
+ cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/
+ fi
+ done
+}
+
+pkg_postinst() {
+ elog "This installation should work out of the box (at least the"
+ elog "client part doing global afs-cell browsing, unless you had"
+ elog "a previous and different configuration). If you want to"
+ elog "set up your own cell or modify the standard config,"
+ elog "please have a look at the Gentoo OpenAFS documentation"
+ elog "(warning: it is not yet up to date wrt the new file locations)"
+ elog
+ elog "The documentation can be found at:"
+ elog " https://wiki.gentoo.org/wiki/OpenAFS"
+}
diff --git a/net-fs/openafs/openafs-1.6.12.ebuild b/net-fs/openafs/openafs-1.6.12.ebuild
new file mode 100644
index 00000000000..85faaeeffe4
--- /dev/null
+++ b/net-fs/openafs/openafs-1.6.12.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic multilib pam systemd toolchain-funcs versionator
+
+MY_PV=$(delete_version_separator '_')
+MY_P="${PN}-${MY_PV}"
+PVER="20150626"
+
+DESCRIPTION="The OpenAFS distributed file system"
+HOMEPAGE="http://www.openafs.org/"
+# We always d/l the doc tarball as man pages are not USE=doc material
+[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE=""
+SRC_URI="
+ http://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2
+ http://openafs.org/dl/openafs/${MY_PV}/${MY_P}-doc.tar.bz2
+ http://dev.gentoo.org/~bircoph/afs/${PN}-patches-${PVER}.tar.xz
+"
+
+LICENSE="IBM BSD openafs-krb5-a APSL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~amd64-linux ~sparc ~x86 ~x86-linux"
+
+IUSE="doc kerberos +modules pam"
+
+CDEPEND="
+ sys-libs/ncurses
+ pam? ( virtual/pam )
+ kerberos? ( virtual/krb5 )"
+
+DEPEND="${CDEPEND}
+ doc? (
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ )"
+
+RDEPEND="${CDEPEND}
+ modules? ( ~net-fs/openafs-kernel-${PV} )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ EPATCH_EXCLUDE="050_all_job_server.patch" \
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/gentoo/patches
+ epatch_user
+
+ # fixing 2-nd level makefiles to honor flags
+ sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \
+ src/*/Makefile.in || die '*/Makefile.in sed failed'
+
+ # packaging is f-ed up, so we can't run eautoreconf
+ # run autotools commands based on what is listed in regen.sh
+ eaclocal -I src/cf
+ eautoconf
+ eautoconf -o configure-libafs configure-libafs.ac
+ eautoheader
+ einfo "Deleting autom4te.cache directory"
+ rm -rf autom4te.cache
+}
+
+src_configure() {
+ AFS_SYSKVERS=26 \
+ econf \
+ --disable-kernel-module \
+ --disable-strip-binaries \
+ --enable-supergroups \
+ $(use_enable pam) \
+ $(use_with doc html-xsl /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl) \
+ $(use_with kerberos krb5)
+}
+
+src_compile() {
+ emake all_nolibafs
+ local d
+ if use doc; then
+ for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
+ emake -C "${d}" html;
+ done
+ fi
+}
+
+src_install() {
+ local OPENRCDIR="${WORKDIR}/gentoo/openrc"
+ local SYSTEMDDIR="${WORKDIR}/gentoo/systemd"
+
+ emake DESTDIR="${ED}" install_nolibafs
+
+ insinto /etc/openafs
+ doins src/afsd/CellServDB
+ echo "/afs:/var/cache/openafs:200000" > "${ED}"/etc/openafs/cacheinfo
+ echo "openafs.org" > "${ED}"/etc/openafs/ThisCell
+
+ # pam_afs and pam_afs.krb have been installed in irregular locations, fix
+ if use pam ; then
+ dopammod "${ED}"/usr/$(get_libdir)/pam_afs*
+ fi
+ rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die
+
+ # remove kdump stuff provided by kexec-tools #222455
+ rm -rf "${ED}"/usr/sbin/kdump*
+
+ # avoid collision with mit_krb5's version of kpasswd
+ mv "${ED}"/usr/bin/kpasswd{,_afs} || die
+ mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die
+
+ # move lwp stuff around #200674 #330061
+ mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die
+ mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die
+ # update paths to the relocated lwp headers
+ sed -ri \
+ -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \
+ "${ED}"/usr/include/*.h \
+ "${ED}"/usr/include/*/*.h \
+ || die
+
+ # minimal documentation
+ use pam && doman src/pam/pam_afs.5
+ dodoc "${WORKDIR}/gentoo/README" src/afsd/CellServDB
+
+ # documentation package
+ if use doc ; then
+ dodoc -r doc/{arch,examples,protocol,txt}
+ dohtml -r doc/xml/*
+ fi
+
+ # Gentoo related scripts
+ newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client
+ newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client
+ newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server
+ newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server
+ systemd_dotmpfilesd "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf
+ systemd_dounit "${SYSTEMDDIR}"/openafs-client.service
+ systemd_dounit "${SYSTEMDDIR}"/openafs-server.service
+
+ # used directories: client
+ keepdir /etc/openafs
+
+ # used directories: server
+ keepdir /etc/openafs/server
+ diropts -m0700
+ keepdir /var/lib/openafs
+ keepdir /var/lib/openafs/db
+ diropts -m0755
+ keepdir /var/lib/openafs/logs
+
+ # link logfiles to /var/log
+ dosym ../lib/openafs/logs /var/log/openafs
+}
+
+pkg_preinst() {
+ ## Somewhat intelligently install default configuration files
+ ## (when they are not present)
+ local x
+ for x in cacheinfo CellServDB ThisCell ; do
+ if [ -e "${EROOT}"/etc/openafs/${x} ] ; then
+ cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/
+ fi
+ done
+}
+
+pkg_postinst() {
+ elog "This installation should work out of the box (at least the"
+ elog "client part doing global afs-cell browsing, unless you had"
+ elog "a previous and different configuration). If you want to"
+ elog "set up your own cell or modify the standard config,"
+ elog "please have a look at the Gentoo OpenAFS documentation"
+ elog "(warning: it is not yet up to date wrt the new file locations)"
+ elog
+ elog "The documentation can be found at:"
+ elog " https://wiki.gentoo.org/wiki/OpenAFS"
+}
diff --git a/net-fs/samba/Manifest b/net-fs/samba/Manifest
new file mode 100644
index 00000000000..5b09dc41587
--- /dev/null
+++ b/net-fs/samba/Manifest
@@ -0,0 +1,8 @@
+DIST samba-3.5.21.tar.gz 35377315 SHA256 fd9a66056b1ba9496762394efff41fcaa0e58f2e50e71910e6d202b8a59a1c10 SHA512 e6d52530094b2f8284f8536f97411c3944a83e9f1a808836acdca19fe4aee3cc47e136cc2a2eab96ba89526fe289ec1a3d22fb836bd261bf7c8ddfbccd1cf975 WHIRLPOOL a476ea24841cfdec0f640880e0362173a3f6b957afd2d2448f7b4a8b7c927ef558fd22e7fe20b05bd8aecf1169d8e488b87830a99ddfddcbc8be0c9a414966ad
+DIST samba-3.5.22.tar.gz 35385144 SHA256 b4c98f77f5634478da109063334acd9b6ad7bcb38151a5b1cac6dc5feb6679dc SHA512 0e1b4816d921ca82f0426a254cf103066634cc54e28d707a62da951118413f7f5ca5f87d60688cab802a58b0af87f797fbbe12f4e1284d5d7f545a98aba97616 WHIRLPOOL 6e59655dd7a537f0c7c889c43ddf5afb8060706e1ec79b3835698181c5c7478059f91c93eefbde50b03e0154a686eda35eabf807bb7ae01dd2b9b39648a009ae
+DIST samba-3.6.25.tar.gz 34121828 SHA256 8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751 SHA512 25a5c56dae4517e82e196b59fa301b661ec75db57effbb0ede35fb23b018f78cdea6513e8760966caf58abc43335fcebda77fe5bf5bb9d4b27fd3ca6e5a3b626 WHIRLPOOL 68c4a335b3912bf3c6baecae337b1131127515191052366ca9a04ec6d919f2fb69c912aefb087e2578134f3a9bde7b496ea880f2197a8dbf8221058dd1e8444d
+DIST samba-4.0.26.tar.gz 22155521 SHA256 ce2441992c6d18950d752edb2d1274b3f7e056b2e2e8516fc42e408e4a25894a SHA512 0df6f5961b2b6af1a4356540299acae52473f9d4342762d1556c859a36a63a7b8706c94f835581e96ecbf47a2d7fb09b67f93aa3869812215e9661dda7ee1906 WHIRLPOOL fda98da46719e6f4cefa58aef56f4d75120c4386b5e398e9b2ac3aa693255a6bce9606b1bf5646708d96e4f3c8982586501ccdae7c11f223b629ab128d33ae59
+DIST samba-4.1.18.tar.gz 19550894 SHA256 5bd302355c82195271de41d4f1e0c6353bde652a23886940b310b7734256f156 SHA512 1798fc23bfa282f4e0cc047e8da6fc553f4e56a19ec1f82877a7381b7ba2d97b4687de0d499a094e725e420303e2e07038a63b9cc463f97131b91c29c0919dec WHIRLPOOL fce4c07255c882c742429a91b6faeeb079a4c85a227b803c6e2e6b7531402746f57d02099bf5104c8c7db0190ff9ca9cc69797bf30000412aecbe90906a66100
+DIST samba-4.1.19.tar.gz 19558250 SHA256 62f23dffacd4faf8ac557f9cf01a1595e39db0bbdd959c4c1890f46155c9f936 SHA512 116f022cfd55506028a14363e084080eeb93257d216958c70991b11f4f8f01195e7174371edcdd2c72cadcb7544c0b0b979d638a7a37600d7bbd0610020f028e WHIRLPOOL dd672fc7cb659f8a80177b6d19187e2557847e802db9b3cd5fd2b708dc78b9a31c675cac80afd3a36789d562a8582155c7ffcbad26b810b621cda08b0395e6c9
+DIST samba-4.2.3.tar.gz 20721283 SHA256 b6dfa5ae4818d891ee2fcff04a5912f4a4fb2394b4f5e66a2a15b428da094c7c SHA512 33fd4deb3a9bb6ee7656fb716116f2ff3c65303ce7c13bdf2c4c618ce67e61f1d1fa77c7c29504e4bb4d6c5a094dcc54dc41999864e52ebd521d89a93666383a WHIRLPOOL 0684eae6fa815f3af99646721fd414e57e26966cc30b8c0e12bd8a1e651ac7984855521044b83becfd2beb70c5820d49d3dd1e702bb78109b34ec188b0e43191
+DIST smb_traffic_analyzer_v2.diff.bz2 12226 SHA256 1bae7eafbe8ac2382313d5ab9d43d73ba64b63a714f0f588516952d476fb868d SHA512 aa0e457a0dd282e61e6dfcd5705c29b319832dca9711b1b5baf8373e2f079991399c3537c050219ccb861a93f86353ebff677a5c625d2e3f1f3a13ee5c4087d0 WHIRLPOOL 85ee72a360f67ebe71be5cd400ecd635280a0d7c64ebb8b94656a5ef1a94f74a987de86408af00ce1b81cc8363b1b3cf14726860d29b72ee610d4bab73d6b139
diff --git a/net-fs/samba/files/3.5/lmhosts b/net-fs/samba/files/3.5/lmhosts
new file mode 100644
index 00000000000..fe7b466eb16
--- /dev/null
+++ b/net-fs/samba/files/3.5/lmhosts
@@ -0,0 +1,2 @@
+# $Id$
+127.0.0.1 localhost
diff --git a/net-fs/samba/files/3.5/nsswitch.conf-winbind b/net-fs/samba/files/3.5/nsswitch.conf-winbind
new file mode 100644
index 00000000000..32d9b98b850
--- /dev/null
+++ b/net-fs/samba/files/3.5/nsswitch.conf-winbind
@@ -0,0 +1,17 @@
+# $Id$
+passwd: files winbind
+group: files winbind
+
+hosts: files dns
+networks: files dns
+
+services: db files
+protocols: db files
+rpc: db files
+ethers: db files
+netmasks: files
+netgroup: files
+bootparams: files
+
+automount: files
+aliases: files
diff --git a/net-fs/samba/files/3.5/nsswitch.conf-wins b/net-fs/samba/files/3.5/nsswitch.conf-wins
new file mode 100644
index 00000000000..44c01aed955
--- /dev/null
+++ b/net-fs/samba/files/3.5/nsswitch.conf-wins
@@ -0,0 +1,17 @@
+# $Id$
+passwd: files
+group: files
+
+hosts: files dns wins
+networks: files dns
+
+services: db files
+protocols: db files
+rpc: db files
+ethers: db files
+netmasks: files
+netgroup: files
+bootparams: files
+
+automount: files
+aliases: files
diff --git a/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch b/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch
new file mode 100644
index 00000000000..ef76afff7ef
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba-3.5.6-kerberos-dummy.patch
@@ -0,0 +1,30 @@
+diff -NrU5 samba-3.5.6.original/source3/include/krb5_protos.h samba-3.5.6/source3/include/krb5_protos.h
+--- samba-3.5.6.original/source3/include/krb5_protos.h 2010-10-07 10:41:16.000000000 -0600
++++ samba-3.5.6/source3/include/krb5_protos.h 2010-12-23 11:01:09.000000000 -0600
+@@ -86,15 +86,10 @@
+ const char *name,
+ krb5_principal *principal);
+ bool smb_krb5_principal_compare_any_realm(krb5_context context,
+ krb5_const_principal princ1,
+ krb5_const_principal princ2);
+-int cli_krb5_get_ticket(const char *principal, time_t time_offset,
+- DATA_BLOB *ticket, DATA_BLOB *session_key_krb5,
+- uint32 extra_ap_opts, const char *ccname,
+- time_t *tgs_expire,
+- const char *impersonate_princ_s);
+ krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *expire_time);
+ krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code);
+ krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr);
+ krb5_error_code smb_krb5_free_addresses(krb5_context context, smb_krb5_addresses *addr);
+ NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error);
+@@ -144,5 +139,10 @@
+ krb5_creds **creds_p);
+ char *smb_krb5_principal_get_realm(krb5_context context,
+ krb5_principal principal);
+ #endif /* HAVE_KRB5 */
+
++int cli_krb5_get_ticket(const char *principal, time_t time_offset,
++ DATA_BLOB *ticket, DATA_BLOB *session_key_krb5,
++ uint32 extra_ap_opts, const char *ccname,
++ time_t *tgs_expire,
++ const char *impersonate_princ_s);
diff --git a/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch b/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch
new file mode 100644
index 00000000000..905b06a5db1
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba-3.5.8-uclib-build.patch
@@ -0,0 +1,58 @@
+From a5bfd634ecd0e81eb92b065da311ee4cf6f08757 Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@samba.org>
+Date: Mon, 5 Jul 2010 08:39:45 -0400
+Subject: [PATCH] mount.cifs: switch to using _PATH_MNTTAB and paths.h
+
+The code currently uses fstab.h and _PATH_FSTAB, but uClibc apparently
+doesn't have that header. It does have paths.h and _PATH_MNTTAB however
+and so does glibc, so use that instead.
+
+Reported-by: Armin Kuster <linux@kama-aina.net>
+Signed-off-by: Jeff Layton <jlayton@samba.org>
+---
+diff -NrU5 samba-3.5.8.original/client/mount.cifs.c samba-3.5.8/client/mount.cifs.c
+--- samba-3.5.8.original/client/mount.cifs.c 2011-03-06 12:48:05.000000000 -0600
++++ samba-3.5.8/client/mount.cifs.c 2011-05-04 08:51:42.000000000 -0600
+@@ -37,11 +37,11 @@
+ #include <netdb.h>
+ #include <string.h>
+ #include <mntent.h>
+ #include <fcntl.h>
+ #include <limits.h>
+-#include <fstab.h>
++#include <paths.h>
+ #include "mount.h"
+
+ #define MOUNT_CIFS_VERSION_MAJOR "1"
+ #define MOUNT_CIFS_VERSION_MINOR "14"
+
+@@ -261,14 +261,14 @@
+ {
+ FILE *fstab;
+ struct mntent *mnt;
+
+ /* make sure this mount is listed in /etc/fstab */
+- fstab = setmntent(_PATH_FSTAB, "r");
++ fstab = setmntent(_PATH_MNTTAB, "r");
+ if (!fstab) {
+ fprintf(stderr, "Couldn't open %s for reading!\n",
+- _PATH_FSTAB);
++ _PATH_MNTTAB);
+ return EX_FILEIO;
+ }
+
+ while((mnt = getmntent(fstab))) {
+ if (!strcmp(mountpoint, mnt->mnt_dir))
+@@ -277,11 +277,11 @@
+ endmntent(fstab);
+
+ if (mnt == NULL || strcmp(mnt->mnt_fsname, devname)) {
+ fprintf(stderr, "%s: permission denied: no match for "
+ "%s found in %s\n", progname, mountpoint,
+- _PATH_FSTAB);
++ _PATH_MNTTAB);
+ return EX_USAGE;
+ }
+
+ /*
+ * 'mount' munges the options from fstab before passing them
diff --git a/net-fs/samba/files/3.5/samba.confd b/net-fs/samba/files/3.5/samba.confd
new file mode 100644
index 00000000000..1b329dae6b1
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba.confd
@@ -0,0 +1,28 @@
+#add "winbind" to the daemon_list if you also want winbind to start
+daemon_list="smbd nmbd"
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+my_service_name="samba"
+my_service_PRE="unset TMP TMPDIR"
+my_service_POST=""
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+smbd_start_options="-D"
+smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}"
+smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd"
+smbd_reload="killall -HUP smbd"
+
+nmbd_start_options="-D"
+nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}"
+nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd"
+nmbd_reload="killall -HUP nmbd"
+
+winbind_start_options=""
+winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}"
+winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd"
+winbind_reload="killall -HUP winbindd"
+
diff --git a/net-fs/samba/files/3.5/samba.initd b/net-fs/samba/files/3.5/samba.initd
new file mode 100644
index 00000000000..0e1802f31f7
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba.initd
@@ -0,0 +1,59 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+
+depend() {
+ after slapd
+ need net
+ use cupsd
+}
+
+DAEMONNAME="${SVCNAME##samba.}"
+[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME}
+
+signal_do() {
+ local signal="$1"
+ [ -z "${signal}" ] && return 0
+
+ local result=0 last_result=0 daemon= cmd_exec=
+ for daemon in ${daemon_list} ; do
+ eval cmd_exec=\$${daemon}_${signal}
+ if [ -n "${cmd_exec}" ]; then
+ ebegin "${my_service_name} -> ${signal}: ${daemon}"
+ #echo ${cmd} '->' ${!cmd}
+ ${cmd_exec} > /dev/null
+ last_result=$?
+ eend ${last_result}
+ fi
+ result=$(( ${result} + ${last_result} ))
+ done
+ return ${result}
+}
+
+mkdir_sambadirs() {
+ [ -d /var/run/samba ] || mkdir -p /var/run/samba
+}
+
+start() {
+ ${my_service_PRE}
+ mkdir_sambadirs
+ signal_do start && return 0
+
+ eerror "Error: starting services (see system logs)"
+ signal_do stop
+ return 1
+}
+stop() {
+ ${my_service_PRE}
+ if signal_do stop ; then
+ ${my_service_POST}
+ return 0
+ fi
+}
+reload() {
+ ${my_service_PRE}
+ signal_do reload
+}
diff --git a/net-fs/samba/files/3.5/samba.pam b/net-fs/samba/files/3.5/samba.pam
new file mode 100644
index 00000000000..91beadd478a
--- /dev/null
+++ b/net-fs/samba/files/3.5/samba.pam
@@ -0,0 +1,8 @@
+#%PAM-1.0
+# * pam_smbpass.so authenticates against the smbpasswd file
+# * changed Redhat's 'pam_stack' with 'include' for *BSD compatibility
+# (Diego "Flameeyes" Petteno'): enable with pam>=0.78 only
+auth required pam_smbpass.so nodelay
+account include system-auth
+session include system-auth
+password required pam_smbpass.so nodelay smbconf=/etc/samba/smb.conf
diff --git a/net-fs/samba/files/3.5/smb.conf.default b/net-fs/samba/files/3.5/smb.conf.default
new file mode 100644
index 00000000000..4c9a4a6d529
--- /dev/null
+++ b/net-fs/samba/files/3.5/smb.conf.default
@@ -0,0 +1,271 @@
+# This is the main Samba configuration file. You should read the
+# smb.conf(5) manual page in order to understand the options listed
+# here. Samba has a huge number of configurable options (perhaps too
+# many!) most of which are not shown in this example
+#
+# For a step to step guide on installing, configuring and using samba,
+# read the Samba-HOWTO-Collection. This may be obtained from:
+# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
+#
+# Many working examples of smb.conf files can be found in the
+# Samba-Guide which is generated daily and can be downloaded from:
+# http://www.samba.org/samba/docs/Samba-Guide.pdf
+#
+# Any line which starts with a ; (semi-colon) or a # (hash)
+# is a comment and is ignored. In this example we will use a #
+# for commentry and a ; for parts of the config file that you
+# may wish to enable
+#
+# NOTE: Whenever you modify this file you should run the command "testparm"
+# to check that you have not made any basic syntactic errors.
+#
+#======================= Global Settings =====================================
+[global]
+
+# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
+ workgroup = MYGROUP
+
+# server string is the equivalent of the NT Description field
+ server string = Samba Server
+
+# Security mode. Defines in which mode Samba will operate. Possible
+# values are share, user, server, domain and ads. Most people will want
+# user level security. See the Samba-HOWTO-Collection for details.
+ security = user
+
+# This option is important for security. It allows you to restrict
+# connections to machines which are on your local network. The
+# following example restricts access to two C class networks and
+# the "loopback" interface. For more examples of the syntax see
+# the smb.conf man page
+; hosts allow = 192.168.1. 192.168.2. 127.
+
+# If you want to automatically load your printer list rather
+# than setting them up individually then you'll need this
+ load printers = yes
+
+# you may wish to override the location of the printcap file
+; printcap name = /etc/printcap
+
+# on SystemV system setting printcap name to lpstat should allow
+# you to automatically obtain a printer list from the SystemV spool
+# system
+; printcap name = lpstat
+
+# It should not be necessary to specify the print system type unless
+# it is non-standard. Currently supported print systems include:
+# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
+; printing = cups
+
+# Uncomment this if you want a guest account, you must add this to /etc/passwd
+# otherwise the user "nobody" is used
+; guest account = pcguest
+
+# this tells Samba to use a separate log file for each machine
+# that connects
+ log file = /var/log/samba/log.%m
+
+# Put a capping on the size of the log files (in Kb).
+ max log size = 50
+
+# Use password server option only with security = server
+# The argument list may include:
+# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
+# or to auto-locate the domain controller/s
+# password server = *
+; password server = <NT-Server-Name>
+
+# Use the realm option only with security = ads
+# Specifies the Active Directory realm the host is part of
+; realm = MY_REALM
+
+# Backend to store user information in. New installations should
+# use either tdbsam or ldapsam. smbpasswd is available for backwards
+# compatibility. tdbsam requires no further configuration.
+; passdb backend = tdbsam
+
+# Using the following line enables you to customise your configuration
+# on a per machine basis. The %m gets replaced with the netbios name
+# of the machine that is connecting.
+# Note: Consider carefully the location in the configuration file of
+# this line. The included file is read at that point.
+; include = /etc/samba/smb.conf.%m
+
+# Configure Samba to use multiple interfaces
+# If you have multiple network interfaces then you must list them
+# here. See the man page for details.
+; interfaces = 192.168.12.2/24 192.168.13.2/24
+
+# Browser Control Options:
+# set local master to no if you don't want Samba to become a master
+# browser on your network. Otherwise the normal election rules apply
+; local master = no
+
+# OS Level determines the precedence of this server in master browser
+# elections. The default value should be reasonable
+; os level = 33
+
+# Domain Master specifies Samba to be the Domain Master Browser. This
+# allows Samba to collate browse lists between subnets. Don't use this
+# if you already have a Windows NT domain controller doing this job
+; domain master = yes
+
+# Preferred Master causes Samba to force a local browser election on startup
+# and gives it a slightly higher chance of winning the election
+; preferred master = yes
+
+# Enable this if you want Samba to be a domain logon server for
+# Windows95 workstations.
+; domain logons = yes
+
+# if you enable domain logons then you may want a per-machine or
+# per user logon script
+# run a specific logon batch file per workstation (machine)
+; logon script = %m.bat
+# run a specific logon batch file per username
+; logon script = %U.bat
+
+# Where to store roving profiles (only for Win95 and WinNT)
+# %L substitutes for this servers netbios name, %U is username
+# You must uncomment the [Profiles] share below
+; logon path = \\%L\Profiles\%U
+
+# Windows Internet Name Serving Support Section:
+# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
+; wins support = yes
+
+# WINS Server - Tells the NMBD components of Samba to be a WINS Client
+# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
+; wins server = w.x.y.z
+
+# WINS Proxy - Tells Samba to answer name resolution queries on
+# behalf of a non WINS capable client, for this to work there must be
+# at least one WINS Server on the network. The default is NO.
+; wins proxy = yes
+
+# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
+# via DNS nslookups. The default is NO.
+ dns proxy = no
+
+# These scripts are used on a domain controller or stand-alone
+# machine to add or delete corresponding unix accounts
+; add user script = /usr/sbin/useradd %u
+; add group script = /usr/sbin/groupadd %g
+; add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
+; delete user script = /usr/sbin/userdel %u
+; delete user from group script = /usr/sbin/deluser %u %g
+; delete group script = /usr/sbin/groupdel %g
+
+
+#============================ Share Definitions ==============================
+[homes]
+ comment = Home Directories
+ browseable = no
+ writable = yes
+
+# Un-comment the following and create the netlogon directory for Domain Logons
+; [netlogon]
+; comment = Network Logon Service
+; path = /var/lib/samba/netlogon
+; guest ok = yes
+; writable = no
+; share modes = no
+
+
+# Un-comment the following to provide a specific roving profile share
+# the default is to use the user's home directory
+;[Profiles]
+; path = /var/lib/samba/profiles
+; browseable = no
+; guest ok = yes
+
+
+# NOTE: If you have a BSD-style print system there is no need to
+# specifically define each individual printer
+[printers]
+ comment = All Printers
+ path = /var/spool/samba
+ browseable = no
+# Set public = yes to allow user 'guest account' to print
+ guest ok = no
+ writable = no
+ printable = yes
+
+# This one is useful for people to share files
+;[tmp]
+; comment = Temporary file space
+; path = /tmp
+; read only = no
+; public = yes
+
+# A publicly accessible directory, but read only, except for people in
+# the "staff" group
+;[public]
+; comment = Public Stuff
+; path = /home/samba
+; public = yes
+; writable = yes
+; printable = no
+; write list = @staff
+
+# Other examples.
+#
+# A private printer, usable only by fred. Spool data will be placed in fred's
+# home directory. Note that fred must have write access to the spool directory,
+# wherever it is.
+;[fredsprn]
+; comment = Fred's Printer
+; valid users = fred
+; path = /homes/fred
+; printer = freds_printer
+; public = no
+; writable = no
+; printable = yes
+
+# A private directory, usable only by fred. Note that fred requires write
+# access to the directory.
+;[fredsdir]
+; comment = Fred's Service
+; path = /usr/somewhere/private
+; valid users = fred
+; public = no
+; writable = yes
+; printable = no
+
+# a service which has a different directory for each machine that connects
+# this allows you to tailor configurations to incoming machines. You could
+# also use the %U option to tailor it by user name.
+# The %m gets replaced with the machine name that is connecting.
+;[pchome]
+; comment = PC Directories
+; path = /usr/pc/%m
+; public = no
+; writable = yes
+
+# A publicly accessible directory, read/write to all users. Note that all files
+# created in the directory by users will be owned by the default user, so
+# any user with access can delete any other user's files. Obviously this
+# directory must be writable by the default user. Another user could of course
+# be specified, in which case all files would be owned by that user instead.
+;[public]
+; path = /usr/somewhere/else/public
+; public = yes
+; only guest = yes
+; writable = yes
+; printable = no
+
+# The following two entries demonstrate how to share a directory so that two
+# users can place files there that will be owned by the specific users. In this
+# setup, the directory should be writable by both users and should have the
+# sticky bit set on it to prevent abuse. Obviously this could be extended to
+# as many users as required.
+;[myshare]
+; comment = Mary's and Fred's stuff
+; path = /usr/somewhere/shared
+; valid users = mary fred
+; public = no
+; writable = yes
+; printable = no
+; create mask = 0765
+
+
diff --git a/net-fs/samba/files/3.5/smb.conf.default.patch b/net-fs/samba/files/3.5/smb.conf.default.patch
new file mode 100644
index 00000000000..e9d62db164f
--- /dev/null
+++ b/net-fs/samba/files/3.5/smb.conf.default.patch
@@ -0,0 +1,86 @@
+--- samba-3.5.9/examples/smb.conf.default 2011-06-14 05:17:28.000000000 -0600
++++ /etc/samba/smb.conf.default 2011-06-29 10:12:13.000000000 -0600
+@@ -61,11 +61,11 @@
+ # otherwise the user "nobody" is used
+ ; guest account = pcguest
+
+ # this tells Samba to use a separate log file for each machine
+ # that connects
+- log file = /usr/local/samba/var/log.%m
++ log file = /var/log/samba/log.%m
+
+ # Put a capping on the size of the log files (in Kb).
+ max log size = 50
+
+ # Use password server option only with security = server
+@@ -79,19 +79,22 @@
+ # Specifies the Active Directory realm the host is part of
+ ; realm = MY_REALM
+
+ # Backend to store user information in. New installations should
+ # use either tdbsam or ldapsam. smbpasswd is available for backwards
+-# compatibility. tdbsam requires no further configuration.
++# compatibility. tdbsam requires no further configuration. If you're
++# migrating from < samba 3.4, you'll have to convert your old user
++# passwords to the new backend with the command:
++# pdbedit -i smbpasswd:/var/lib/samba/private/smbpasswd -e
+ ; passdb backend = tdbsam
+
+ # Using the following line enables you to customise your configuration
+ # on a per machine basis. The %m gets replaced with the netbios name
+ # of the machine that is connecting.
+ # Note: Consider carefully the location in the configuration file of
+ # this line. The included file is read at that point.
+-; include = /usr/local/samba/lib/smb.conf.%m
++; include = /etc/samba/smb.conf.%m
+
+ # Configure Samba to use multiple interfaces
+ # If you have multiple network interfaces then you must list them
+ # here. See the man page for details.
+ ; interfaces = 192.168.12.2/24 192.168.13.2/24
+@@ -164,29 +167,29 @@
+ writable = yes
+
+ # Un-comment the following and create the netlogon directory for Domain Logons
+ ; [netlogon]
+ ; comment = Network Logon Service
+-; path = /usr/local/samba/lib/netlogon
++; path = /var/lib/samba/netlogon
+ ; guest ok = yes
+ ; writable = no
+ ; share modes = no
+
+
+ # Un-comment the following to provide a specific roving profile share
+ # the default is to use the user's home directory
+ ;[Profiles]
+-; path = /usr/local/samba/profiles
++; path = /var/lib/samba/profiles
+ ; browseable = no
+ ; guest ok = yes
+
+
+ # NOTE: If you have a BSD-style print system there is no need to
+ # specifically define each individual printer
+ [printers]
+ comment = All Printers
+- path = /usr/spool/samba
++ path = /var/spool/samba
+ browseable = no
+ # Set public = yes to allow user 'guest account' to print
+ guest ok = no
+ writable = no
+ printable = yes
+@@ -202,11 +205,11 @@
+ # the "staff" group
+ ;[public]
+ ; comment = Public Stuff
+ ; path = /home/samba
+ ; public = yes
+-; writable = no
++; writable = yes
+ ; printable = no
+ ; write list = @staff
+
+ # Other examples.
+ #
diff --git a/net-fs/samba/files/3.5/smbusers b/net-fs/samba/files/3.5/smbusers
new file mode 100644
index 00000000000..7acb6dc817a
--- /dev/null
+++ b/net-fs/samba/files/3.5/smbusers
@@ -0,0 +1,7 @@
+# $Id$
+
+# Syntax:
+# Unix_name = SMB_name1 SMB_name2 ...
+
+root = Administrator admin
+nobody = guest pcguest smbguest
diff --git a/net-fs/samba/files/3.5/swat.xinetd b/net-fs/samba/files/3.5/swat.xinetd
new file mode 100644
index 00000000000..45e977df11a
--- /dev/null
+++ b/net-fs/samba/files/3.5/swat.xinetd
@@ -0,0 +1,17 @@
+# default: off
+# description: SWAT is the Samba Web Admin Tool. Use swat \
+# to configure your Samba server. To use SWAT, \
+# connect to port 901 with your favorite web browser.
+# $Id$
+
+service swat
+{
+ port = 901
+ socket_type = stream
+ wait = no
+ only_from = localhost
+ user = root
+ server = /usr/sbin/swat
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/net-fs/samba/files/3.5/system-auth-winbind.pam b/net-fs/samba/files/3.5/system-auth-winbind.pam
new file mode 100644
index 00000000000..8d6746b7aeb
--- /dev/null
+++ b/net-fs/samba/files/3.5/system-auth-winbind.pam
@@ -0,0 +1,18 @@
+#%PAM-1.0
+# $Id$
+
+auth required pam_env.so
+auth sufficient pam_winbind.so
+auth sufficient pam_unix.so likeauth nullok use_first_pass
+auth required pam_deny.so
+
+account sufficient pam_winbind.so
+account required pam_unix.so
+
+password required pam_cracklib.so retry=3
+password sufficient pam_unix.so nullok use_authtok md5 shadow
+password required pam_deny.so
+
+session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
+session required pam_limits.so
+session required pam_unix.so
diff --git a/net-fs/samba/files/3.6/lmhosts b/net-fs/samba/files/3.6/lmhosts
new file mode 100644
index 00000000000..fe7b466eb16
--- /dev/null
+++ b/net-fs/samba/files/3.6/lmhosts
@@ -0,0 +1,2 @@
+# $Id$
+127.0.0.1 localhost
diff --git a/net-fs/samba/files/3.6/samba.confd b/net-fs/samba/files/3.6/samba.confd
new file mode 100644
index 00000000000..1b329dae6b1
--- /dev/null
+++ b/net-fs/samba/files/3.6/samba.confd
@@ -0,0 +1,28 @@
+#add "winbind" to the daemon_list if you also want winbind to start
+daemon_list="smbd nmbd"
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+my_service_name="samba"
+my_service_PRE="unset TMP TMPDIR"
+my_service_POST=""
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+smbd_start_options="-D"
+smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}"
+smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd"
+smbd_reload="killall -HUP smbd"
+
+nmbd_start_options="-D"
+nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}"
+nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd"
+nmbd_reload="killall -HUP nmbd"
+
+winbind_start_options=""
+winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}"
+winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd"
+winbind_reload="killall -HUP winbindd"
+
diff --git a/net-fs/samba/files/3.6/samba.initd b/net-fs/samba/files/3.6/samba.initd
new file mode 100644
index 00000000000..1ebd2e72b92
--- /dev/null
+++ b/net-fs/samba/files/3.6/samba.initd
@@ -0,0 +1,60 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/var/run/samba"
+
+depend() {
+ after slapd
+ need net
+ use cupsd
+}
+
+DAEMONNAME="${SVCNAME##samba.}"
+[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME}
+
+signal_do() {
+ local signal="$1"
+ [ -z "${signal}" ] && return 0
+
+ local result=0 last_result=0 daemon= cmd_exec=
+ for daemon in ${daemon_list} ; do
+ eval cmd_exec=\$${daemon}_${signal}
+ if [ -n "${cmd_exec}" ]; then
+ ebegin "${my_service_name} -> ${signal}: ${daemon}"
+ #echo ${cmd} '->' ${!cmd}
+ ${cmd_exec} > /dev/null
+ last_result=$?
+ eend ${last_result}
+ fi
+ result=$(( ${result} + ${last_result} ))
+ done
+ return ${result}
+}
+
+mkdir_sambadirs() {
+ [ -d "${piddir}" ] || mkdir -p ${piddir}
+}
+
+start() {
+ ${my_service_PRE}
+ mkdir_sambadirs
+ signal_do start && return 0
+
+ eerror "Error: starting services (see system logs)"
+ signal_do stop
+ return 1
+}
+stop() {
+ ${my_service_PRE}
+ if signal_do stop ; then
+ ${my_service_POST}
+ return 0
+ fi
+}
+reload() {
+ ${my_service_PRE}
+ signal_do reload
+}
diff --git a/net-fs/samba/files/3.6/samba.pam b/net-fs/samba/files/3.6/samba.pam
new file mode 100644
index 00000000000..91beadd478a
--- /dev/null
+++ b/net-fs/samba/files/3.6/samba.pam
@@ -0,0 +1,8 @@
+#%PAM-1.0
+# * pam_smbpass.so authenticates against the smbpasswd file
+# * changed Redhat's 'pam_stack' with 'include' for *BSD compatibility
+# (Diego "Flameeyes" Petteno'): enable with pam>=0.78 only
+auth required pam_smbpass.so nodelay
+account include system-auth
+session include system-auth
+password required pam_smbpass.so nodelay smbconf=/etc/samba/smb.conf
diff --git a/net-fs/samba/files/3.6/smb.conf.default.patch b/net-fs/samba/files/3.6/smb.conf.default.patch
new file mode 100644
index 00000000000..c2a9a72ceda
--- /dev/null
+++ b/net-fs/samba/files/3.6/smb.conf.default.patch
@@ -0,0 +1,68 @@
+--- samba-3.6.0rc2/examples/smb.conf.default~ 2011-06-07 19:13:47.000000000 +0100
++++ samba-3.6.0rc2/examples/smb.conf.default 2011-06-30 16:12:42.388102480 +0100
+@@ -63,7 +63,7 @@
+
+ # this tells Samba to use a separate log file for each machine
+ # that connects
+- log file = /usr/local/samba/var/log.%m
++ log file = /var/log/samba/log.%m
+
+ # Put a capping on the size of the log files (in Kb).
+ max log size = 50
+@@ -81,7 +81,10 @@
+
+ # Backend to store user information in. New installations should
+ # use either tdbsam or ldapsam. smbpasswd is available for backwards
+-# compatibility. tdbsam requires no further configuration.
++# compatibility. tdbsam requires no further configuration. If you're
++# migrating from < samba 3.4, you'll have to convert your old user
++# passwords to the new backend with the command:
++# pdbedit -i smbpasswd:/var/lib/samba/private/smbpasswd -e
+ ; passdb backend = tdbsam
+
+ # Using the following line enables you to customise your configuration
+@@ -89,7 +92,7 @@
+ # of the machine that is connecting.
+ # Note: Consider carefully the location in the configuration file of
+ # this line. The included file is read at that point.
+-; include = /usr/local/samba/lib/smb.conf.%m
++; include = /etc/samba/smb.conf.%m
+
+ # Configure Samba to use multiple interfaces
+ # If you have multiple network interfaces then you must list them
+@@ -166,7 +169,7 @@
+ # Un-comment the following and create the netlogon directory for Domain Logons
+ ; [netlogon]
+ ; comment = Network Logon Service
+-; path = /usr/local/samba/lib/netlogon
++; path = /var/lib/samba/netlogon
+ ; guest ok = yes
+ ; writable = no
+ ; share modes = no
+@@ -175,7 +178,7 @@
+ # Un-comment the following to provide a specific roving profile share
+ # the default is to use the user's home directory
+ ;[Profiles]
+-; path = /usr/local/samba/profiles
++; path = /var/lib/samba/profiles
+ ; browseable = no
+ ; guest ok = yes
+
+@@ -184,7 +187,7 @@
+ # specifically define each individual printer
+ [printers]
+ comment = All Printers
+- path = /usr/spool/samba
++ path = /var/spool/samba
+ browseable = no
+ # Set public = yes to allow user 'guest account' to print
+ guest ok = no
+@@ -204,7 +207,7 @@
+ ; comment = Public Stuff
+ ; path = /home/samba
+ ; public = yes
+-; writable = no
++; writable = yes
+ ; printable = no
+ ; write list = @staff
+
diff --git a/net-fs/samba/files/3.6/smbusers b/net-fs/samba/files/3.6/smbusers
new file mode 100644
index 00000000000..7acb6dc817a
--- /dev/null
+++ b/net-fs/samba/files/3.6/smbusers
@@ -0,0 +1,7 @@
+# $Id$
+
+# Syntax:
+# Unix_name = SMB_name1 SMB_name2 ...
+
+root = Administrator admin
+nobody = guest pcguest smbguest
diff --git a/net-fs/samba/files/3.6/swat.xinetd b/net-fs/samba/files/3.6/swat.xinetd
new file mode 100644
index 00000000000..45e977df11a
--- /dev/null
+++ b/net-fs/samba/files/3.6/swat.xinetd
@@ -0,0 +1,17 @@
+# default: off
+# description: SWAT is the Samba Web Admin Tool. Use swat \
+# to configure your Samba server. To use SWAT, \
+# connect to port 901 with your favorite web browser.
+# $Id$
+
+service swat
+{
+ port = 901
+ socket_type = stream
+ wait = no
+ only_from = localhost
+ user = root
+ server = /usr/sbin/swat
+ log_on_failure += USERID
+ disable = yes
+}
diff --git a/net-fs/samba/files/3.6/system-auth-winbind.pam b/net-fs/samba/files/3.6/system-auth-winbind.pam
new file mode 100644
index 00000000000..8d6746b7aeb
--- /dev/null
+++ b/net-fs/samba/files/3.6/system-auth-winbind.pam
@@ -0,0 +1,18 @@
+#%PAM-1.0
+# $Id$
+
+auth required pam_env.so
+auth sufficient pam_winbind.so
+auth sufficient pam_unix.so likeauth nullok use_first_pass
+auth required pam_deny.so
+
+account sufficient pam_winbind.so
+account required pam_unix.so
+
+password required pam_cracklib.so retry=3
+password sufficient pam_unix.so nullok use_authtok md5 shadow
+password required pam_deny.so
+
+session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
+session required pam_limits.so
+session required pam_unix.so
diff --git a/net-fs/samba/files/4.0/com_err.patch b/net-fs/samba/files/4.0/com_err.patch
new file mode 100644
index 00000000000..2c9ad88f01d
--- /dev/null
+++ b/net-fs/samba/files/4.0/com_err.patch
@@ -0,0 +1,35 @@
+From 2f34bfbc1941127d17a7a91c6598d6a6c35620e2 Mon Sep 17 00:00:00 2001
+From: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
+Date: Thu, 6 Oct 2011 00:19:01 +0200
+Subject: [PATCH] Add missing com_err dependencies
+
+---
+ auth/kerberos/wscript_build | 2 +-
+ nsswitch/wscript_build | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/auth/kerberos/wscript_build b/auth/kerberos/wscript_build
+index 1070770..2421b16 100644
+--- a/auth/kerberos/wscript_build
++++ b/auth/kerberos/wscript_build
+@@ -1,3 +1,3 @@
+ bld.SAMBA_SUBSYSTEM('KRB5_PAC',
+ source='gssapi_pac.c kerberos_pac.c',
+- deps='gssapi_krb5 krb5 ndr-krb5pac')
++ deps='gssapi_krb5 krb5 ndr-krb5pac com_err')
+diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build
+index 298da06..4e353d3 100644
+--- a/nsswitch/wscript_build
++++ b/nsswitch/wscript_build
+@@ -33,7 +33,7 @@ if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):
+ if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
+ bld.SAMBA_LIBRARY('winbind_krb5_locator',
+ source='winbind_krb5_locator.c',
+- deps='wbclient krb5',
++ deps='wbclient krb5 com_err',
+ realname='winbind_krb5_locator.so')
+
+ bld.SAMBA_SUBSYSTEM('WB_REQTRANS',
+--
+1.7.3.4
+
diff --git a/net-fs/samba/files/4.0/samba4.confd b/net-fs/samba/files/4.0/samba4.confd
new file mode 100644
index 00000000000..58b2c7827bd
--- /dev/null
+++ b/net-fs/samba/files/4.0/samba4.confd
@@ -0,0 +1,38 @@
+# Add "winbind" to the daemon_list if you also want winbind to start.
+# Replace "smbd nmbd" by "samba4" if you want the active directory domain controller part or the ntvfs
+# file server part or the rpc proxy to start.
+# Note that samba4 controls 'smbd' by itself, thus it can't be started manually. You can, however,
+# tweak the behaviour of a samba4-controlled smbd by modifying your '/etc/samba/smb.conf' file
+# accordingly.
+daemon_list="smbd nmbd"
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+my_service_name="samba"
+my_service_PRE="unset TMP TMPDIR"
+my_service_POST=""
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+smbd_start_options="-D"
+smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}"
+smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd"
+smbd_reload="killall -HUP smbd"
+
+nmbd_start_options="-D"
+nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}"
+nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd"
+nmbd_reload="killall -HUP nmbd"
+
+samba4_start_options=""
+samba4_start="start-stop-daemon --start --exec /usr/sbin/samba -- ${samba4_start_options}"
+samba4_stop="start-stop-daemon --stop --exec /usr/sbin/samba"
+samba4_reload="killall -HUP samba"
+
+winbind_start_options=""
+winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}"
+winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd"
+winbind_reload="killall -HUP winbindd"
+
diff --git a/net-fs/samba/files/4.0/samba4.initd-r1 b/net-fs/samba/files/4.0/samba4.initd-r1
new file mode 100644
index 00000000000..012e19edc92
--- /dev/null
+++ b/net-fs/samba/files/4.0/samba4.initd-r1
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/var/run/samba"
+
+depend() {
+ after slapd
+ need net
+ use cupsd
+}
+
+DAEMONNAME="${SVCNAME##samba.}"
+[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME}
+
+signal_do() {
+ local signal="$1"
+ [ -z "${signal}" ] && return 0
+
+ local result=0 last_result=0 daemon= cmd_exec=
+ for daemon in ${daemon_list} ; do
+ eval cmd_exec=\$${daemon}_${signal}
+ if [ -n "${cmd_exec}" ]; then
+ ebegin "${my_service_name} -> ${signal}: ${daemon}"
+ #echo ${cmd} '->' ${!cmd}
+ ${cmd_exec} > /dev/null
+ last_result=$?
+ eend ${last_result}
+ fi
+ result=$(( ${result} + ${last_result} ))
+ done
+ return ${result}
+}
+
+start() {
+ ${my_service_PRE}
+ [ -d "${piddir}" ] || mkdir -p "${piddir}"
+ signal_do start && return 0
+
+ eerror "Error: starting services (see system logs)"
+ signal_do stop
+ return 1
+}
+stop() {
+ ${my_service_PRE}
+ if signal_do stop ; then
+ ${my_service_POST}
+ return 0
+ fi
+}
+reload() {
+ ${my_service_PRE}
+ signal_do reload
+}
diff --git a/net-fs/samba/files/4.1/com_err.patch b/net-fs/samba/files/4.1/com_err.patch
new file mode 100644
index 00000000000..2c9ad88f01d
--- /dev/null
+++ b/net-fs/samba/files/4.1/com_err.patch
@@ -0,0 +1,35 @@
+From 2f34bfbc1941127d17a7a91c6598d6a6c35620e2 Mon Sep 17 00:00:00 2001
+From: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
+Date: Thu, 6 Oct 2011 00:19:01 +0200
+Subject: [PATCH] Add missing com_err dependencies
+
+---
+ auth/kerberos/wscript_build | 2 +-
+ nsswitch/wscript_build | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/auth/kerberos/wscript_build b/auth/kerberos/wscript_build
+index 1070770..2421b16 100644
+--- a/auth/kerberos/wscript_build
++++ b/auth/kerberos/wscript_build
+@@ -1,3 +1,3 @@
+ bld.SAMBA_SUBSYSTEM('KRB5_PAC',
+ source='gssapi_pac.c kerberos_pac.c',
+- deps='gssapi_krb5 krb5 ndr-krb5pac')
++ deps='gssapi_krb5 krb5 ndr-krb5pac com_err')
+diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build
+index 298da06..4e353d3 100644
+--- a/nsswitch/wscript_build
++++ b/nsswitch/wscript_build
+@@ -33,7 +33,7 @@ if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):
+ if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
+ bld.SAMBA_LIBRARY('winbind_krb5_locator',
+ source='winbind_krb5_locator.c',
+- deps='wbclient krb5',
++ deps='wbclient krb5 com_err',
+ realname='winbind_krb5_locator.so')
+
+ bld.SAMBA_SUBSYSTEM('WB_REQTRANS',
+--
+1.7.3.4
+
diff --git a/net-fs/samba/files/4.1/samba4.confd b/net-fs/samba/files/4.1/samba4.confd
new file mode 100644
index 00000000000..58b2c7827bd
--- /dev/null
+++ b/net-fs/samba/files/4.1/samba4.confd
@@ -0,0 +1,38 @@
+# Add "winbind" to the daemon_list if you also want winbind to start.
+# Replace "smbd nmbd" by "samba4" if you want the active directory domain controller part or the ntvfs
+# file server part or the rpc proxy to start.
+# Note that samba4 controls 'smbd' by itself, thus it can't be started manually. You can, however,
+# tweak the behaviour of a samba4-controlled smbd by modifying your '/etc/samba/smb.conf' file
+# accordingly.
+daemon_list="smbd nmbd"
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+my_service_name="samba"
+my_service_PRE="unset TMP TMPDIR"
+my_service_POST=""
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+smbd_start_options="-D"
+smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}"
+smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd"
+smbd_reload="killall -HUP smbd"
+
+nmbd_start_options="-D"
+nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}"
+nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd"
+nmbd_reload="killall -HUP nmbd"
+
+samba4_start_options=""
+samba4_start="start-stop-daemon --start --exec /usr/sbin/samba -- ${samba4_start_options}"
+samba4_stop="start-stop-daemon --stop --exec /usr/sbin/samba"
+samba4_reload="killall -HUP samba"
+
+winbind_start_options=""
+winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}"
+winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd"
+winbind_reload="killall -HUP winbindd"
+
diff --git a/net-fs/samba/files/4.1/samba4.initd-r1 b/net-fs/samba/files/4.1/samba4.initd-r1
new file mode 100644
index 00000000000..012e19edc92
--- /dev/null
+++ b/net-fs/samba/files/4.1/samba4.initd-r1
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/var/run/samba"
+
+depend() {
+ after slapd
+ need net
+ use cupsd
+}
+
+DAEMONNAME="${SVCNAME##samba.}"
+[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME}
+
+signal_do() {
+ local signal="$1"
+ [ -z "${signal}" ] && return 0
+
+ local result=0 last_result=0 daemon= cmd_exec=
+ for daemon in ${daemon_list} ; do
+ eval cmd_exec=\$${daemon}_${signal}
+ if [ -n "${cmd_exec}" ]; then
+ ebegin "${my_service_name} -> ${signal}: ${daemon}"
+ #echo ${cmd} '->' ${!cmd}
+ ${cmd_exec} > /dev/null
+ last_result=$?
+ eend ${last_result}
+ fi
+ result=$(( ${result} + ${last_result} ))
+ done
+ return ${result}
+}
+
+start() {
+ ${my_service_PRE}
+ [ -d "${piddir}" ] || mkdir -p "${piddir}"
+ signal_do start && return 0
+
+ eerror "Error: starting services (see system logs)"
+ signal_do stop
+ return 1
+}
+stop() {
+ ${my_service_PRE}
+ if signal_do stop ; then
+ ${my_service_POST}
+ return 0
+ fi
+}
+reload() {
+ ${my_service_PRE}
+ signal_do reload
+}
diff --git a/net-fs/samba/files/4.2/samba4.confd b/net-fs/samba/files/4.2/samba4.confd
new file mode 100644
index 00000000000..58b2c7827bd
--- /dev/null
+++ b/net-fs/samba/files/4.2/samba4.confd
@@ -0,0 +1,38 @@
+# Add "winbind" to the daemon_list if you also want winbind to start.
+# Replace "smbd nmbd" by "samba4" if you want the active directory domain controller part or the ntvfs
+# file server part or the rpc proxy to start.
+# Note that samba4 controls 'smbd' by itself, thus it can't be started manually. You can, however,
+# tweak the behaviour of a samba4-controlled smbd by modifying your '/etc/samba/smb.conf' file
+# accordingly.
+daemon_list="smbd nmbd"
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+my_service_name="samba"
+my_service_PRE="unset TMP TMPDIR"
+my_service_POST=""
+
+#----------------------------------------------------------------------------
+# Daemons calls: <daemon_name>_<command_option>
+#----------------------------------------------------------------------------
+smbd_start_options="-D"
+smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}"
+smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd"
+smbd_reload="killall -HUP smbd"
+
+nmbd_start_options="-D"
+nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}"
+nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd"
+nmbd_reload="killall -HUP nmbd"
+
+samba4_start_options=""
+samba4_start="start-stop-daemon --start --exec /usr/sbin/samba -- ${samba4_start_options}"
+samba4_stop="start-stop-daemon --stop --exec /usr/sbin/samba"
+samba4_reload="killall -HUP samba"
+
+winbind_start_options=""
+winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}"
+winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd"
+winbind_reload="killall -HUP winbindd"
+
diff --git a/net-fs/samba/files/4.2/samba4.initd-r1 b/net-fs/samba/files/4.2/samba4.initd-r1
new file mode 100644
index 00000000000..ff42552e5d4
--- /dev/null
+++ b/net-fs/samba/files/4.2/samba4.initd-r1
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+piddir="/var/run/samba"
+
+depend() {
+ after slapd
+ need net
+ use cupsd
+}
+
+DAEMONNAME="${SVCNAME##samba.}"
+[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME}
+
+signal_do() {
+ local signal="$1"
+ [ -z "${signal}" ] && return 0
+
+ local result=0 last_result=0 daemon= cmd_exec=
+ for daemon in ${daemon_list} ; do
+ eval cmd_exec=\$${daemon}_${signal}
+ if [ -n "${cmd_exec}" ]; then
+ ebegin "${my_service_name} -> ${signal}: ${daemon}"
+ #echo ${cmd} '->' ${!cmd}
+ ${cmd_exec} > /dev/null
+ last_result=$?
+ eend ${last_result}
+ fi
+ result=$(( ${result} + ${last_result} ))
+ done
+ return ${result}
+}
+
+start() {
+ ${my_service_PRE}
+ [ -d "${piddir}" ] || mkdir -p "${piddir}"
+ signal_do start && return 0
+
+ eerror "Error: starting services (see system logs)"
+ signal_do stop
+ return 1
+}
+stop() {
+ ${my_service_PRE}
+ if signal_do stop ; then
+ ${my_service_POST}
+ return 0
+ fi
+}
+reload() {
+ ${my_service_PRE}
+ signal_do reload
+}
diff --git a/net-fs/samba/files/named.conf.dlz.patch b/net-fs/samba/files/named.conf.dlz.patch
new file mode 100644
index 00000000000..ad8486ce1c6
--- /dev/null
+++ b/net-fs/samba/files/named.conf.dlz.patch
@@ -0,0 +1,15 @@
+diff --git a/source4/setup/named.conf.dlz b/source4/setup/named.conf.dlz
+index be20a57..d86f766 100644
+--- a/source4/setup/named.conf.dlz
++++ b/source4/setup/named.conf.dlz
+@@ -11,9 +11,9 @@
+ #
+ dlz "AD DNS Zone" {
+ # For BIND 9.8.0
+- database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
++ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
+
+ # For BIND 9.9.0
+- # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
++ database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
+ };
diff --git a/net-fs/samba/files/nmbd.service b/net-fs/samba/files/nmbd.service
new file mode 100644
index 00000000000..44b4ffba1f7
--- /dev/null
+++ b/net-fs/samba/files/nmbd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba NetBIOS name server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/nmbd.pid
+ExecStart=/usr/sbin/nmbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk b/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk
new file mode 100644
index 00000000000..3a0375580be
--- /dev/null
+++ b/net-fs/samba/files/samba-3.4.2-lib.tevent.python.mk
@@ -0,0 +1,6 @@
+[PYTHON::pytevent]
+LIBRARY_REALNAME = tevent.$(SHLIBEXT)
+PRIVATE_DEPENDENCIES = LIBTEVENT PYTALLOC LIBSAMBA-UTIL LIBREPLACE
+
+pytevent_OBJ_FILES = $(libteventsrcdir)/pytevent.o
+
diff --git a/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch b/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch
new file mode 100644
index 00000000000..ec351db7a2d
--- /dev/null
+++ b/net-fs/samba/files/samba-4.0.19-automagic_aio_fix.patch
@@ -0,0 +1,57 @@
+https://bugzilla.samba.org/show_bug.cgi?id=10370
+
+--- samba-4.0.19/source3/wscript
++++ samba-4.0.19/source3/wscript
+@@ -507,9 +507,10 @@
+ else:
+ conf.DEFINE('HAVE_NO_AIO', '1')
+
+- if host_os.rfind('linux') > -1:
+- conf.CHECK_FUNCS_IN('io_submit', 'aio')
+- conf.CHECK_CODE('''
++ if Options.options.with_aio_support != False:
++ if host_os.rfind('linux') > -1:
++ conf.CHECK_FUNCS_IN('io_submit', 'aio')
++ conf.CHECK_CODE('''
+ struct io_event ioev;
+ struct iocb *ioc;
+ io_context_t ctx;
+@@ -526,11 +527,11 @@
+ io_getevents(ctx, 1, 1, &ioev, &ts);
+ ''',
+ 'HAVE_LINUX_KERNEL_AIO',
+- msg='Checking for linux kernel asynchronous io support',
+- headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h',
+- lib='aio')
++ msg='Checking for linux kernel asynchronous io support',
++ headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h',
++ lib='aio')
+
+- conf.CHECK_CODE('''
++ conf.CHECK_CODE('''
+ struct msghdr msg;
+ union {
+ struct cmsghdr cm;
+@@ -540,17 +541,17 @@
+ msg.msg_controllen = sizeof(control_un.control);
+ ''',
+ 'HAVE_MSGHDR_MSG_CONTROL',
+- msg='Checking if we can use msg_control for passing file descriptors',
+- headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
+- conf.CHECK_CODE('''
++ msg='Checking if we can use msg_control for passing file descriptors',
++ headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
++ conf.CHECK_CODE('''
+ struct msghdr msg;
+ int fd;
+ msg.msg_acctrights = (caddr_t) &fd;
+ msg.msg_acctrightslen = sizeof(fd);
+ ''',
+ 'HAVE_MSGHDR_MSG_ACCTRIGHTS',
+- msg='Checking if we can use msg_acctrights for passing file descriptors',
+- headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
++ msg='Checking if we can use msg_acctrights for passing file descriptors',
++ headers='sys/types.h stdlib.h stddef.h sys/socket.h sys/un.h')
+
+ if Options.options.with_winbind:
+ conf.env.build_winbind = True
diff --git a/net-fs/samba/files/samba-4.1.14-libsystemd.patch b/net-fs/samba/files/samba-4.1.14-libsystemd.patch
new file mode 100644
index 00000000000..94b30c00e16
--- /dev/null
+++ b/net-fs/samba/files/samba-4.1.14-libsystemd.patch
@@ -0,0 +1,51 @@
+From 0f9b06ade820ce165015526220569db81e00150b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 3 Jan 2015 18:59:48 +0100
+Subject: [PATCH] Support libsystemd, renamed from libsystemd-daemon
+
+---
+ lib/util/wscript_build | 2 +-
+ wscript | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/util/wscript_build b/lib/util/wscript_build
+index f161f96..6b6b511 100755
+--- a/lib/util/wscript_build
++++ b/lib/util/wscript_build
+@@ -10,7 +10,7 @@ bld.SAMBA_LIBRARY('samba-util',
+ server_id.c dprintf.c parmlist.c bitmap.c pidfile.c
+ tevent_debug.c util_process.c memcache.c''',
+ deps='DYNCONFIG',
+- public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd-daemon',
++ public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd systemd-daemon',
+ public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h',
+ header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
+ local_include=False,
+diff --git a/wscript b/wscript
+index f389f90..3c4fa21 100644
+--- a/wscript
++++ b/wscript
+@@ -183,9 +183,12 @@ def configure(conf):
+ conf.env['ENABLE_PIE'] = True
+
+ if Options.options.enable_systemd != False:
++ conf.check_cfg(package='libsystemd', args='--cflags --libs',
++ msg='Checking for libsystemd', uselib_store="SYSTEMD")
+ conf.check_cfg(package='libsystemd-daemon', args='--cflags --libs',
+ msg='Checking for libsystemd-daemon', uselib_store="SYSTEMD-DAEMON")
+ conf.CHECK_HEADERS('systemd/sd-daemon.h', lib='systemd-daemon')
++ conf.CHECK_LIB('systemd', shlib=True)
+ conf.CHECK_LIB('systemd-daemon', shlib=True)
+
+ if conf.CONFIG_SET('HAVE_SYSTEMD_SD_DAEMON_H'):
+@@ -193,6 +196,7 @@ def configure(conf):
+ conf.env['ENABLE_SYSTEMD'] = True
+ else:
+ conf.SET_TARGET_TYPE('systemd-daemon', 'EMPTY')
++ conf.SET_TARGET_TYPE('systemd', 'EMPTY')
+ conf.undefine('HAVE_SYSTEMD')
+
+ conf.SAMBA_CONFIG_H('include/config.h')
+--
+2.2.1
+
diff --git a/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch b/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch
new file mode 100644
index 00000000000..9f1ebb81990
--- /dev/null
+++ b/net-fs/samba/files/samba-4.1.14-named.conf.dlz.patch
@@ -0,0 +1,15 @@
+--- samba-4.1.14/source4/setup/named.conf.dlz
++++ samba-4.1.14/source4/setup/named.conf.dlz
+@@ -11,10 +11,10 @@
+ #
+ dlz "AD DNS Zone" {
+ # For BIND 9.8.x
+- database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
++ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9.so";
+
+ # For BIND 9.9.x
+- # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
++ database "dlopen ${MODULESDIR}/bind9/dlz_bind9_9.so";
+
+ # For BIND 9.10.x
+ # database "dlopen ${MODULESDIR}/bind9/dlz_bind9_10.so";
diff --git a/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch b/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch
new file mode 100644
index 00000000000..c6f50073317
--- /dev/null
+++ b/net-fs/samba/files/samba-4.2.3-heimdal_compilefix.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/542638
+
+From: Stephan Wolf <stephan@letzte-bankreihe.de>
+
+Samba uses the build in implementation of heimdal from year 2011.
+The ebuild uses the portage version of heimdal.
+I got it fixed to patch samba kdc_init function.
+
+--- samba-4.2.3/source4/kdc/kdc.c
++++ samba-4.2.3/source4/kdc/kdc.c
+@@ -967,9 +967,9 @@
+ * The old behavior in the _kdc_get_preferred_key()
+ * function is use_strongest_server_key=TRUE.
+ */
+- kdc->config->as_use_strongest_session_key = false;
++ kdc->config->tgt_use_strongest_session_key = false;
+ kdc->config->preauth_use_strongest_session_key = false;
+- kdc->config->tgs_use_strongest_session_key = false;
++ kdc->config->svc_use_strongest_session_key = false;
+ kdc->config->use_strongest_server_key = true;
+
+ /* Register hdb-samba4 hooks for use as a keytab */
diff --git a/net-fs/samba/files/samba.conf b/net-fs/samba/files/samba.conf
new file mode 100644
index 00000000000..fce6812e639
--- /dev/null
+++ b/net-fs/samba/files/samba.conf
@@ -0,0 +1 @@
+D /var/run/samba 0755 root root
diff --git a/net-fs/samba/files/samba.service b/net-fs/samba/files/samba.service
new file mode 100644
index 00000000000..8214ff86318
--- /dev/null
+++ b/net-fs/samba/files/samba.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Samba AD server
+After=network.target winbindd.service
+Conflicts=nmbd.service smbd.service
+
+[Service]
+ExecStart=/usr/sbin/samba --interactive
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/smbd.service b/net-fs/samba/files/smbd.service
new file mode 100644
index 00000000000..5c006a44edb
--- /dev/null
+++ b/net-fs/samba/files/smbd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba SMB/CIFS server
+After=network.target nmbd.service winbindd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/smbd.pid
+ExecStart=/usr/sbin/smbd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/files/smbd.socket b/net-fs/samba/files/smbd.socket
new file mode 100644
index 00000000000..833bf438832
--- /dev/null
+++ b/net-fs/samba/files/smbd.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=Samba SMB/CIFS server socket
+
+[Socket]
+ListenStream=445
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/net-fs/samba/files/smbd_at.service b/net-fs/samba/files/smbd_at.service
new file mode 100644
index 00000000000..e1f71be3f7f
--- /dev/null
+++ b/net-fs/samba/files/smbd_at.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Samba SMB/CIFS server instance
+
+[Service]
+ExecStart=/usr/sbin/smbd -F
+ExecReload=/bin/kill -HUP $MAINPID
+StandardInput=socket
diff --git a/net-fs/samba/files/winbindd.service b/net-fs/samba/files/winbindd.service
new file mode 100644
index 00000000000..67a778fc76c
--- /dev/null
+++ b/net-fs/samba/files/winbindd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Samba Winbind daemon
+After=network.target nmbd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/samba/winbindd.pid
+ExecStart=/usr/sbin/winbindd -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-fs/samba/metadata.xml b/net-fs/samba/metadata.xml
new file mode 100644
index 00000000000..d0c82d3de21
--- /dev/null
+++ b/net-fs/samba/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>samba</herd>
+<maintainer>
+ <email>samba@gentoo.org</email>
+ <name>Samba Team</name>
+</maintainer>
+<longdescription>
+Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Integration with various accounting and antivirus backends. License: GNU General Public License.
+</longdescription>
+<use>
+ <flag name="ads">Enable Active Directory support</flag>
+ <flag name="swat">Enables support for swat configuration gui</flag>
+ <flag name="winbind">Enables support for the winbind auth daemon</flag>
+ <flag name="client">Enables the client part</flag>
+ <flag name="server">Enables the server part</flag>
+ <flag name="netapi">Enable building of netapi bits</flag>
+ <flag name="addns">Enable AD DNS integration</flag>
+ <flag name="aio">Enable asynchronous IO support</flag>
+ <flag name="cluster">Enable support for clustering</flag>
+ <flag name="dmapi">Enable support for DMAPI. This currently works only in combination with XFS.</flag>
+ <flag name="ldb">Enable the ldb tools</flag>
+ <flag name="quota">Enables support for user quotas</flag>
+ <flag name="smbclient">Enable smbclient tool</flag>
+ <flag name="smbsharemodes">Enable special smb share modes (?) </flag>
+ <flag name="smbtav2">Enable Samba Traffic Analyzer version 2 </flag>
+ <flag name="iprint">Enabling iPrint technology by Novell</flag>
+</use>
+</pkgmetadata>
diff --git a/net-fs/samba/samba-3.5.21.ebuild b/net-fs/samba/samba-3.5.21.ebuild
new file mode 100644
index 00000000000..fcf0c959829
--- /dev/null
+++ b/net-fs/samba/samba-3.5.21.ebuild
@@ -0,0 +1,453 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit pam versionator multilib eutils flag-o-matic
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/stable/${P}.tar.gz
+ http://dev.gentoo.org/~dagger/files/smb_traffic_analyzer_v2.diff.bz2"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="acl addns ads +aio avahi caps +client cluster debug doc examples fam
+ ldap ldb +netapi pam quota +readline selinux +server +smbclient smbsharemodes smbtav2
+ swat syslog winbind"
+
+DEPEND="dev-libs/popt
+ !net-fs/samba-client
+ !net-fs/samba-libs
+ !net-fs/samba-server
+ !net-fs/cifs-utils
+ sys-libs/talloc
+ sys-libs/tdb
+ virtual/libiconv
+ ads? ( virtual/krb5 sys-fs/e2fsprogs
+ client? ( sys-apps/keyutils ) )
+ avahi? ( net-dns/avahi[dbus] )
+ caps? ( sys-libs/libcap )
+ client? ( !net-fs/mount-cifs
+ dev-libs/iniparser )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ fam? ( virtual/fam )
+ ldap? ( net-nds/openldap )
+ pam? ( virtual/pam
+ winbind? ( dev-libs/iniparser )
+ )
+ readline? ( >=sys-libs/readline-5.2 )
+ selinux? ( sec-policy/selinux-samba )
+ syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+ ads? ( ldap )
+ swat? ( server )
+"
+
+pkg_setup() {
+ if use server ; then
+ SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+ BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+ bin/profiles bin/sharesec bin/eventlogadm"
+
+ use smbtav2 && BINPROGS="${BINPROGS} bin/smbta-util"
+ use swat && SBINPROGS="${SBINPROGS} bin/swat"
+ use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+ use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+ fi
+
+ if use client ; then
+ BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+ bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+ bin/ntlm_auth"
+
+ use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall"
+ fi
+
+ use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+ if use winbind ; then
+ BINPROGS="${BINPROGS} bin/wbinfo"
+ SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+ use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+ use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+ fi
+
+ if use winbind &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+ then
+ eerror "It is a known issue that ${P} will not build with "
+ eerror "winbind use flag enabled when using gcc < 4.3 ."
+ eerror "Please use at least the latest stable gcc version."
+ die "Using sys-devel/gcc < 4.3 with winbind use flag."
+ fi
+}
+
+src_prepare() {
+ cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+ # ensure that winbind has correct ldflags (QA notice)
+ sed -i \
+ -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+ configure || die "sed failed"
+
+ epatch "${CONFDIR}"/${PN}-3.5.6-kerberos-dummy.patch
+ use smbtav2 && cd "${WORKDIR}/${P}" && epatch "${WORKDIR}"/smb_traffic_analyzer_v2.diff
+ cd "${WORKDIR}/${MY_P}" && epatch "${CONFDIR}"/${PN}-3.5.8-uclib-build.patch
+ epatch "${CONFDIR}"/smb.conf.default.patch
+}
+
+src_configure() {
+ local myconf
+
+ # Filter out -fPIE
+ [[ ${CHOST} == *-*bsd* ]] && myconf+=" --disable-pie"
+
+ #Allowing alpha/s390/sh to build
+ if use alpha || use s390 || use sh; then
+ replace-flags -O? -O1
+ fi
+
+ # Upstream refuses to make this configurable
+ use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+ # use_with doesn't accept 2 USE-flags
+ if use client && use ads ; then
+ myconf+=" --with-cifsupcall"
+ else
+ myconf+=" --without-cifsupcall"
+ fi
+
+ if use client && use kernel_linux ; then
+ myconf+=" --with-cifsmount --with-cifsumount"
+ else
+ myconf+=" --without-cifsmount --without-cifsumount"
+ fi
+
+ #bug #399141 wrap newer iniparser version
+ has_version ">=dev-libs/iniparser-3.0.0" && \
+ export CPPFLAGS+=" -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\)"
+
+ # Notes:
+ # - automount is only needed in conjunction with NIS and we don't have that
+ # anymore => LDAP?
+ # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+ econf ${myconf} \
+ --with-piddir=/var/run/samba \
+ --sysconfdir=/etc/samba \
+ --localstatedir=/var \
+ $(use_enable debug developer) \
+ --enable-largefile \
+ --enable-socket-wrapper \
+ --enable-nss-wrapper \
+ $(use_enable swat) \
+ --disable-cups \
+ --disable-iprint \
+ $(use_enable fam) \
+ --enable-shared-libs \
+ --disable-dnssd \
+ $(use_enable avahi) \
+ --with-fhs \
+ --with-privatedir=/var/lib/samba/private \
+ --with-rootsbindir=/var/cache/samba \
+ --with-lockdir=/var/cache/samba \
+ --with-swatdir=/usr/share/doc/${PF}/swat \
+ --with-configdir=/etc/samba \
+ --with-logfilebase=/var/log/samba \
+ --with-pammodulesdir=$(getpam_mod_dir) \
+ --without-afs \
+ --without-fake-kaserver \
+ --without-vfs-afsacl \
+ $(use_with ldap) \
+ $(use_with ads) \
+ $(use_with ads krb5 /usr) \
+ $(use_with ads dnsupdate) \
+ --without-automount \
+ $(use_with pam) \
+ $(use_with pam pam_smbpass) \
+ $(use_with syslog) \
+ $(use_with quota quotas) \
+ $(use_with quota sys-quotas) \
+ --without-utmp \
+ --without-lib{talloc,tdb} \
+ $(use_with netapi libnetapi) \
+ $(use_with smbclient libsmbclient) \
+ $(use_with smbsharemodes libsmbsharemodes) \
+ $(use_with addns libaddns) \
+ $(use_with cluster ctdb /usr) \
+ $(use_with cluster cluster-support) \
+ $(use_with acl acl-support) \
+ $(use_with aio aio-support) \
+ --with-sendfile-support \
+ $(use_with winbind) \
+ --with-shared-modules=${SHAREDMODS} \
+ --without-included-popt \
+ --without-included-iniparser
+}
+
+src_compile() {
+ # compile libs
+ if use addns ; then
+ einfo "make addns library"
+ emake libaddns
+ fi
+ if use netapi ; then
+ einfo "make netapi library"
+ emake libnetapi
+ fi
+ if use smbclient ; then
+ einfo "make smbclient library"
+ emake libsmbclient
+ fi
+ if use smbsharemodes ; then
+ einfo "make smbsharemodes library"
+ emake libsmbsharemodes
+ fi
+
+ # compile modules
+ emake modules
+
+ # compile pam moudles
+ if use pam ; then
+ einfo "make pam modules"
+ emake pam_modules
+ fi
+
+ # compile winbind nss modules
+ if use winbind ; then
+ einfo "make nss modules"
+ emake nss_modules
+ fi
+
+ # compile utilities
+ if [ -n "${BINPROGS}" ] ; then
+ einfo "make binprogs"
+ emake ${BINPROGS}
+ fi
+ if [ -n "${SBINPROGS}" ] ; then
+ einfo "make sbinprogs"
+ emake ${SBINPROGS}
+ fi
+
+ if [ -n "${KRBPLUGIN}" ] ; then
+ einfo "make krbplugin"
+ emake ${KRBPLUGIN}${PLUGINEXT}
+ fi
+
+ if use client && use kernel_linux; then
+ einfo "make {,u}mount.cifs"
+ emake bin/{,u}mount.cifs
+ fi
+}
+
+src_install() {
+ # install libs
+ if use addns ; then
+ einfo "install addns library"
+ emake installlibaddns DESTDIR="${D}"
+ fi
+ if use netapi ; then
+ einfo "install netapi library"
+ emake installlibnetapi DESTDIR="${D}"
+ fi
+ if use smbclient ; then
+ einfo "install smbclient library"
+ emake installlibsmbclient DESTDIR="${D}"
+ fi
+ if use smbsharemodes ; then
+ einfo "install smbsharemodes library"
+ emake installlibsmbsharemodes DESTDIR="${D}"
+ fi
+
+ # install modules
+ emake installmodules DESTDIR="${D}"
+
+ if use pam ; then
+ einfo "install pam modules"
+ emake installpammodules DESTDIR="${D}"
+
+ if use winbind ; then
+ newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+ doman ../docs/manpages/pam_winbind.8
+ # bug #376853
+ insinto /etc/security
+ doins ../examples/pam_winbind/pam_winbind.conf || die
+ fi
+
+ newpamd "${CONFDIR}/samba.pam" samba
+ dodoc pam_smbpass/README
+ fi
+
+ # Nsswitch extensions. Make link for wins and winbind resolvers
+ if use winbind ; then
+ einfo "install libwbclient"
+ emake installlibwbclient DESTDIR="${D}"
+ dolib.so ../nsswitch/libnss_wins.so
+ dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+ dolib.so ../nsswitch/libnss_winbind.so
+ dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+ einfo "install libwbclient related manpages"
+ doman ../docs/manpages/idmap_rid.8
+ doman ../docs/manpages/idmap_hash.8
+ if use ldap ; then
+ doman ../docs/manpages/idmap_adex.8
+ doman ../docs/manpages/idmap_ldap.8
+ fi
+ if use ads ; then
+ doman ../docs/manpages/idmap_ad.8
+ fi
+ fi
+
+ # install binaries
+ insinto /usr
+ for prog in ${SBINPROGS} ; do
+ dosbin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ for prog in ${BINPROGS} ; do
+ dobin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ # install krbplugin
+ if [ -n "${KRBPLUGIN}" ] ; then
+ if has_version app-crypt/mit-krb5 ; then
+ insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ elif has_version app-crypt/heimdal ; then
+ insinto /usr/$(get_libdir)/plugin/krb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ fi
+ insinto /usr
+ for prog in ${KRBPLUGIN} ; do
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+ fi
+
+ # install server components
+ if use server ; then
+ doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+ diropts -m0700
+ keepdir /var/lib/samba/private
+
+ diropts -m1777
+ keepdir /var/spool/samba
+
+ diropts -m0755
+ keepdir /var/{cache,log}/samba
+ keepdir /var/lib/samba/{netlogon,profiles}
+ keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+ keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+ newconfd "${CONFDIR}/samba.confd" samba
+ newinitd "${CONFDIR}/samba.initd" samba
+
+ insinto /etc/samba
+ doins "${CONFDIR}"/{smbusers,lmhosts}
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins ../examples/LDAP/samba.schema
+ fi
+
+ if use swat ; then
+ insinto /etc/xinetd.d
+ newins "${CONFDIR}/swat.xinetd" swat
+ script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
+ fi
+
+ dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+ fi
+
+ # install client files ({u,}mount.cifs into /)
+ if use client && use kernel_linux ; then
+ into /
+ dosbin bin/{u,}mount.cifs
+ doman ../docs/manpages/{u,}mount.cifs.8
+ fi
+
+ # install misc files
+ insinto /etc/samba
+ doins ../examples/smb.conf.default
+ doman ../docs/manpages/smb.conf.5
+
+ insinto /usr/"$(get_libdir)"/samba
+ doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+ # install docs
+ if use doc ; then
+ dohtml -r ../docs/htmldocs/*
+ dodoc ../docs/*.pdf
+ fi
+
+ # install examples
+ if use examples ; then
+ insinto /usr/share/doc/${PF}/examples
+
+ if use smbclient ; then
+ doins -r ../examples/libsmbclient
+ fi
+
+ if use winbind ; then
+ doins -r ../examples/pam_winbind ../examples/nss
+ fi
+
+ if use server ; then
+ cd ../examples
+ doins -r auth autofs dce-dfs LDAP logon misc pdb \
+ perfcounter printer-accounting printing scripts tridge \
+ validchars VFS
+ fi
+ fi
+
+ # Remove empty installation directories
+ rmdir --ignore-fail-on-non-empty \
+ "${D}/usr/$(get_libdir)/samba" \
+ "${D}/usr"/{sbin,bin} \
+ "${D}/usr/share"/{man,locale,} \
+ "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+ # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+ elog "The default value of 'wide links' has been changed to 'no' in samba 3.5"
+ elog "to avoid an insecure default configuration"
+ elog "('wide links = yes' and 'unix extensions = yes'). For more details,"
+ elog "please see http://www.samba.org/samba/news/symlink_attack.html ."
+ elog ""
+ elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added."
+ elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new "
+ elog "implementation of the SMB protocol used by Windows Vista and higher"
+ elog ""
+ elog "For further information make sure to read the release notes at"
+ elog "http://samba.org/samba/history/${P}.html and "
+ elog "http://samba.org/samba/history/${PN}-3.5.0.html"
+}
diff --git a/net-fs/samba/samba-3.5.22.ebuild b/net-fs/samba/samba-3.5.22.ebuild
new file mode 100644
index 00000000000..18f5cf43753
--- /dev/null
+++ b/net-fs/samba/samba-3.5.22.ebuild
@@ -0,0 +1,453 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit pam versionator multilib eutils flag-o-matic
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/stable/${P}.tar.gz
+ http://dev.gentoo.org/~dagger/files/smb_traffic_analyzer_v2.diff.bz2"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ~ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
+IUSE="acl addns ads +aio avahi caps +client cluster debug doc examples fam
+ ldap ldb +netapi pam quota +readline selinux +server +smbclient smbsharemodes smbtav2
+ swat syslog winbind"
+
+DEPEND="dev-libs/popt
+ !net-fs/samba-client
+ !net-fs/samba-libs
+ !net-fs/samba-server
+ !net-fs/cifs-utils
+ sys-libs/talloc
+ sys-libs/tdb
+ virtual/libiconv
+ ads? ( virtual/krb5 sys-fs/e2fsprogs
+ client? ( sys-apps/keyutils ) )
+ avahi? ( net-dns/avahi[dbus] )
+ caps? ( sys-libs/libcap )
+ client? ( !net-fs/mount-cifs
+ dev-libs/iniparser )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ fam? ( virtual/fam )
+ ldap? ( net-nds/openldap )
+ pam? ( virtual/pam
+ winbind? ( dev-libs/iniparser )
+ )
+ readline? ( >=sys-libs/readline-5.2 )
+ selinux? ( sec-policy/selinux-samba )
+ syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+ ads? ( ldap )
+ swat? ( server )
+"
+
+pkg_setup() {
+ if use server ; then
+ SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+ BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+ bin/profiles bin/sharesec bin/eventlogadm"
+
+ use smbtav2 && BINPROGS="${BINPROGS} bin/smbta-util"
+ use swat && SBINPROGS="${SBINPROGS} bin/swat"
+ use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+ use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+ fi
+
+ if use client ; then
+ BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+ bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+ bin/ntlm_auth"
+
+ use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall"
+ fi
+
+ use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+ if use winbind ; then
+ BINPROGS="${BINPROGS} bin/wbinfo"
+ SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+ use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+ use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+ fi
+
+ if use winbind &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+ then
+ eerror "It is a known issue that ${P} will not build with "
+ eerror "winbind use flag enabled when using gcc < 4.3 ."
+ eerror "Please use at least the latest stable gcc version."
+ die "Using sys-devel/gcc < 4.3 with winbind use flag."
+ fi
+}
+
+src_prepare() {
+ cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+ # ensure that winbind has correct ldflags (QA notice)
+ sed -i \
+ -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+ configure || die "sed failed"
+
+ epatch "${CONFDIR}"/${PN}-3.5.6-kerberos-dummy.patch
+ use smbtav2 && cd "${WORKDIR}/${P}" && epatch "${WORKDIR}"/smb_traffic_analyzer_v2.diff
+ cd "${WORKDIR}/${MY_P}" && epatch "${CONFDIR}"/${PN}-3.5.8-uclib-build.patch
+ epatch "${CONFDIR}"/smb.conf.default.patch
+}
+
+src_configure() {
+ local myconf
+
+ # Filter out -fPIE
+ [[ ${CHOST} == *-*bsd* ]] && myconf+=" --disable-pie"
+
+ #Allowing alpha/s390/sh to build
+ if use alpha || use s390 || use sh; then
+ replace-flags -O? -O1
+ fi
+
+ # Upstream refuses to make this configurable
+ use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+ # use_with doesn't accept 2 USE-flags
+ if use client && use ads ; then
+ myconf+=" --with-cifsupcall"
+ else
+ myconf+=" --without-cifsupcall"
+ fi
+
+ if use client && use kernel_linux ; then
+ myconf+=" --with-cifsmount --with-cifsumount"
+ else
+ myconf+=" --without-cifsmount --without-cifsumount"
+ fi
+
+ #bug #399141 wrap newer iniparser version
+ has_version ">=dev-libs/iniparser-3.0.0" && \
+ export CPPFLAGS+=" -Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\)"
+
+ # Notes:
+ # - automount is only needed in conjunction with NIS and we don't have that
+ # anymore => LDAP?
+ # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+ econf ${myconf} \
+ --with-piddir=/var/run/samba \
+ --sysconfdir=/etc/samba \
+ --localstatedir=/var \
+ $(use_enable debug developer) \
+ --enable-largefile \
+ --enable-socket-wrapper \
+ --enable-nss-wrapper \
+ $(use_enable swat) \
+ --disable-cups \
+ --disable-iprint \
+ $(use_enable fam) \
+ --enable-shared-libs \
+ --disable-dnssd \
+ $(use_enable avahi) \
+ --with-fhs \
+ --with-privatedir=/var/lib/samba/private \
+ --with-rootsbindir=/var/cache/samba \
+ --with-lockdir=/var/cache/samba \
+ --with-swatdir=/usr/share/doc/${PF}/swat \
+ --with-configdir=/etc/samba \
+ --with-logfilebase=/var/log/samba \
+ --with-pammodulesdir=$(getpam_mod_dir) \
+ --without-afs \
+ --without-fake-kaserver \
+ --without-vfs-afsacl \
+ $(use_with ldap) \
+ $(use_with ads) \
+ $(use_with ads krb5 /usr) \
+ $(use_with ads dnsupdate) \
+ --without-automount \
+ $(use_with pam) \
+ $(use_with pam pam_smbpass) \
+ $(use_with syslog) \
+ $(use_with quota quotas) \
+ $(use_with quota sys-quotas) \
+ --without-utmp \
+ --without-lib{talloc,tdb} \
+ $(use_with netapi libnetapi) \
+ $(use_with smbclient libsmbclient) \
+ $(use_with smbsharemodes libsmbsharemodes) \
+ $(use_with addns libaddns) \
+ $(use_with cluster ctdb /usr) \
+ $(use_with cluster cluster-support) \
+ $(use_with acl acl-support) \
+ $(use_with aio aio-support) \
+ --with-sendfile-support \
+ $(use_with winbind) \
+ --with-shared-modules=${SHAREDMODS} \
+ --without-included-popt \
+ --without-included-iniparser
+}
+
+src_compile() {
+ # compile libs
+ if use addns ; then
+ einfo "make addns library"
+ emake libaddns
+ fi
+ if use netapi ; then
+ einfo "make netapi library"
+ emake libnetapi
+ fi
+ if use smbclient ; then
+ einfo "make smbclient library"
+ emake libsmbclient
+ fi
+ if use smbsharemodes ; then
+ einfo "make smbsharemodes library"
+ emake libsmbsharemodes
+ fi
+
+ # compile modules
+ emake modules
+
+ # compile pam moudles
+ if use pam ; then
+ einfo "make pam modules"
+ emake pam_modules
+ fi
+
+ # compile winbind nss modules
+ if use winbind ; then
+ einfo "make nss modules"
+ emake nss_modules
+ fi
+
+ # compile utilities
+ if [ -n "${BINPROGS}" ] ; then
+ einfo "make binprogs"
+ emake ${BINPROGS}
+ fi
+ if [ -n "${SBINPROGS}" ] ; then
+ einfo "make sbinprogs"
+ emake ${SBINPROGS}
+ fi
+
+ if [ -n "${KRBPLUGIN}" ] ; then
+ einfo "make krbplugin"
+ emake ${KRBPLUGIN}${PLUGINEXT}
+ fi
+
+ if use client && use kernel_linux; then
+ einfo "make {,u}mount.cifs"
+ emake bin/{,u}mount.cifs
+ fi
+}
+
+src_install() {
+ # install libs
+ if use addns ; then
+ einfo "install addns library"
+ emake installlibaddns DESTDIR="${D}"
+ fi
+ if use netapi ; then
+ einfo "install netapi library"
+ emake installlibnetapi DESTDIR="${D}"
+ fi
+ if use smbclient ; then
+ einfo "install smbclient library"
+ emake installlibsmbclient DESTDIR="${D}"
+ fi
+ if use smbsharemodes ; then
+ einfo "install smbsharemodes library"
+ emake installlibsmbsharemodes DESTDIR="${D}"
+ fi
+
+ # install modules
+ emake installmodules DESTDIR="${D}"
+
+ if use pam ; then
+ einfo "install pam modules"
+ emake installpammodules DESTDIR="${D}"
+
+ if use winbind ; then
+ newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+ doman ../docs/manpages/pam_winbind.8
+ # bug #376853
+ insinto /etc/security
+ doins ../examples/pam_winbind/pam_winbind.conf || die
+ fi
+
+ newpamd "${CONFDIR}/samba.pam" samba
+ dodoc pam_smbpass/README
+ fi
+
+ # Nsswitch extensions. Make link for wins and winbind resolvers
+ if use winbind ; then
+ einfo "install libwbclient"
+ emake installlibwbclient DESTDIR="${D}"
+ dolib.so ../nsswitch/libnss_wins.so
+ dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+ dolib.so ../nsswitch/libnss_winbind.so
+ dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+ einfo "install libwbclient related manpages"
+ doman ../docs/manpages/idmap_rid.8
+ doman ../docs/manpages/idmap_hash.8
+ if use ldap ; then
+ doman ../docs/manpages/idmap_adex.8
+ doman ../docs/manpages/idmap_ldap.8
+ fi
+ if use ads ; then
+ doman ../docs/manpages/idmap_ad.8
+ fi
+ fi
+
+ # install binaries
+ insinto /usr
+ for prog in ${SBINPROGS} ; do
+ dosbin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ for prog in ${BINPROGS} ; do
+ dobin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ # install krbplugin
+ if [ -n "${KRBPLUGIN}" ] ; then
+ if has_version app-crypt/mit-krb5 ; then
+ insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ elif has_version app-crypt/heimdal ; then
+ insinto /usr/$(get_libdir)/plugin/krb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ fi
+ insinto /usr
+ for prog in ${KRBPLUGIN} ; do
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+ fi
+
+ # install server components
+ if use server ; then
+ doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+ diropts -m0700
+ keepdir /var/lib/samba/private
+
+ diropts -m1777
+ keepdir /var/spool/samba
+
+ diropts -m0755
+ keepdir /var/{cache,log}/samba
+ keepdir /var/lib/samba/{netlogon,profiles}
+ keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+ keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+ newconfd "${CONFDIR}/samba.confd" samba
+ newinitd "${CONFDIR}/samba.initd" samba
+
+ insinto /etc/samba
+ doins "${CONFDIR}"/{smbusers,lmhosts}
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins ../examples/LDAP/samba.schema
+ fi
+
+ if use swat ; then
+ insinto /etc/xinetd.d
+ newins "${CONFDIR}/swat.xinetd" swat
+ script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
+ fi
+
+ dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+ fi
+
+ # install client files ({u,}mount.cifs into /)
+ if use client && use kernel_linux ; then
+ into /
+ dosbin bin/{u,}mount.cifs
+ doman ../docs/manpages/{u,}mount.cifs.8
+ fi
+
+ # install misc files
+ insinto /etc/samba
+ doins ../examples/smb.conf.default
+ doman ../docs/manpages/smb.conf.5
+
+ insinto /usr/"$(get_libdir)"/samba
+ doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+ # install docs
+ if use doc ; then
+ dohtml -r ../docs/htmldocs/*
+ dodoc ../docs/*.pdf
+ fi
+
+ # install examples
+ if use examples ; then
+ insinto /usr/share/doc/${PF}/examples
+
+ if use smbclient ; then
+ doins -r ../examples/libsmbclient
+ fi
+
+ if use winbind ; then
+ doins -r ../examples/pam_winbind ../examples/nss
+ fi
+
+ if use server ; then
+ cd ../examples
+ doins -r auth autofs dce-dfs LDAP logon misc pdb \
+ perfcounter printer-accounting printing scripts tridge \
+ validchars VFS
+ fi
+ fi
+
+ # Remove empty installation directories
+ rmdir --ignore-fail-on-non-empty \
+ "${D}/usr/$(get_libdir)/samba" \
+ "${D}/usr"/{sbin,bin} \
+ "${D}/usr/share"/{man,locale,} \
+ "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+ # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+ elog "The default value of 'wide links' has been changed to 'no' in samba 3.5"
+ elog "to avoid an insecure default configuration"
+ elog "('wide links = yes' and 'unix extensions = yes'). For more details,"
+ elog "please see http://www.samba.org/samba/news/symlink_attack.html ."
+ elog ""
+ elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added."
+ elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new "
+ elog "implementation of the SMB protocol used by Windows Vista and higher"
+ elog ""
+ elog "For further information make sure to read the release notes at"
+ elog "http://samba.org/samba/history/${P}.html and "
+ elog "http://samba.org/samba/history/${PN}-3.5.0.html"
+}
diff --git a/net-fs/samba/samba-3.6.25.ebuild b/net-fs/samba/samba-3.6.25.ebuild
new file mode 100644
index 00000000000..5536c514acf
--- /dev/null
+++ b/net-fs/samba/samba-3.6.25.ebuild
@@ -0,0 +1,483 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit pam versionator multilib multilib-minimal eutils flag-o-matic systemd
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/stable/${MY_P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="acl addns ads +aio avahi caps +client cluster cups debug dmapi doc examples fam
+ ldap ldb +netapi pam quota +readline selinux +server +smbclient smbsharemodes
+ swat syslog +winbind"
+
+DEPEND="dev-libs/popt
+ >=sys-libs/talloc-2.0.8-r1[${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.2.13[${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.19[${MULTILIB_USEDEP}]
+ >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
+ ads? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] sys-fs/e2fsprogs
+ client? ( sys-apps/keyutils ) )
+ avahi? ( net-dns/avahi[dbus] )
+ caps? ( >=sys-libs/libcap-2.22-r2[${MULTILIB_USEDEP}] )
+ client? ( !net-fs/mount-cifs
+ >=dev-libs/iniparser-3.1-r1[${MULTILIB_USEDEP}] )
+ cluster? ( >=dev-db/ctdb-1.13 )
+ cups? ( net-print/cups )
+ debug? ( dev-libs/dmalloc )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] )
+ ldap? ( >=net-nds/openldap-2.4.38-r1[${MULTILIB_USEDEP}] )
+ ldb? ( sys-libs/ldb )
+ pam? ( >=virtual/pam-0-r1[${MULTILIB_USEDEP}]
+ winbind? ( >=dev-libs/iniparser-3.1-r1[${MULTILIB_USEDEP}] )
+ )
+ readline? ( >=sys-libs/readline-5.2:= )
+ syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}
+ kernel_linux? ( ads? ( net-fs/cifs-utils[ads] )
+ client? ( net-fs/cifs-utils ) )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S=${WORKDIR}/${MY_P}
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+ ads? ( ldap )
+ swat? ( server )
+"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if use winbind &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+ then
+ eerror "It is a known issue that ${P} will not build with "
+ eerror "winbind use flag enabled when using gcc < 4.3 ."
+ eerror "Please use at least the latest stable gcc version."
+ die "Using sys-devel/gcc < 4.3 with winbind use flag."
+ fi
+ fi
+}
+
+pkg_setup() {
+ if use server ; then
+ SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+ BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+ bin/profiles bin/sharesec bin/eventlogadm bin/smbta-util
+ $(usex client "" "bin/smbclient")"
+
+ use swat && SBINPROGS="${SBINPROGS} bin/swat"
+ use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+ use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+ fi
+
+ if use client ; then
+ BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+ bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+ bin/ntlm_auth"
+
+ fi
+
+ use cups && BINPROGS="${BINPROGS} bin/smbspool"
+# use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+ if use winbind ; then
+ BINPROGS="${BINPROGS} bin/wbinfo"
+ SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+ use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+ use cluster && SHAREDMODS="${SHAREDMODS},idmap_tdb2"
+ use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+ fi
+}
+
+src_prepare() {
+ cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "lib/tevent/python.mk"
+
+ # ensure that winbind has correct ldflags (QA notice)
+ sed -i \
+ -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+ source3/configure || die "sed failed"
+ epatch "${CONFDIR}"/smb.conf.default.patch
+
+ #bug #399141 wrap newer iniparser version
+ has_version ">=dev-libs/iniparser-3.0.0" && \
+ append-cppflags "-Diniparser_getstr\(d,i\)=iniparser_getstring\(d,i,NULL\)"
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=()
+
+ # we can't alter S since build system writes to '../' and therefore
+ # we need to duplicate the whole structure
+ cd source3 || die
+
+ # Filter out -fPIE
+ [[ ${CHOST} == *-*bsd* ]] && myconf+=( --disable-pie )
+
+ #Allowing alpha/s390/sh to build
+ if use alpha || [[ ${ABI} == s390 ]] || use sh ; then
+ local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
+ replace-flags -O? -O1
+ fi
+
+ # http://wiki.samba.org/index.php/CTDB_Setup
+ use cluster && myconf+=( --disable-pie )
+
+ # Upstream refuses to make this configurable
+ myconf+=( ac_cv_header_sys_capability_h=$(usex caps) )
+
+ # Notes:
+ # - automount is only needed in conjunction with NIS and we don't have that
+ # anymore => LDAP?
+ # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+ econf "${myconf[@]}" \
+ --with-piddir="${EPREFIX}"/var/run/samba \
+ --sysconfdir="${EPREFIX}"/etc/samba \
+ --localstatedir="${EPREFIX}"/var \
+ $(multilib_native_use_enable debug developer) \
+ --enable-largefile \
+ --enable-socket-wrapper \
+ --enable-nss-wrapper \
+ $(multilib_native_use_enable swat) \
+ $(multilib_native_use_enable debug dmalloc) \
+ $(multilib_native_use_enable cups) \
+ --disable-iprint \
+ $(use_enable fam) \
+ --enable-shared-libs \
+ --disable-dnssd \
+ $(multilib_native_use_enable avahi) \
+ --with-fhs \
+ --with-privatedir="${EPREFIX}"/var/lib/samba/private \
+ --with-rootsbindir="${EPREFIX}"/var/cache/samba \
+ --with-lockdir="${EPREFIX}"/var/cache/samba \
+ --with-swatdir="${EPREFIX}"/usr/share/doc/${PF}/swat \
+ --with-configdir="${EPREFIX}"/etc/samba \
+ --with-logfilebase="${EPREFIX}"/var/log/samba \
+ --with-pammodulesdir=$(getpam_mod_dir) \
+ $(multilib_native_use_with dmapi) \
+ --without-afs \
+ --without-fake-kaserver \
+ --without-vfs-afsacl \
+ $(use_with ldap) \
+ $(use_with ads) \
+ $(use_with ads krb5 "${EPREFIX}"/usr) \
+ $(use_with ads dnsupdate) \
+ --without-automount \
+ $(use_with pam) \
+ $(use_with pam pam_smbpass) \
+ $(use_with syslog) \
+ $(use_with quota quotas) \
+ $(use_with quota sys-quotas) \
+ --without-utmp \
+ --without-lib{talloc,tdb} \
+ $(use_with netapi libnetapi) \
+ $(use_with smbclient libsmbclient) \
+ $(use_with smbsharemodes libsmbsharemodes) \
+ $(use_with addns libaddns) \
+ $(use_with cluster ctdb "${EPREFIX}"/usr) \
+ $(use_with cluster cluster-support) \
+ $(multilib_native_use_with acl acl-support) \
+ $(use_with aio aio-support) \
+ --with-sendfile-support \
+ $(use_with winbind) \
+ --with-shared-modules=${SHAREDMODS} \
+ --without-included-popt \
+ --without-included-iniparser
+}
+
+multilib_src_compile() {
+ cd source3 || die
+
+ # compile libs
+ if use addns ; then
+ einfo "make addns library"
+ emake libaddns
+ fi
+ if use netapi ; then
+ einfo "make netapi library"
+ emake libnetapi
+ fi
+ if use smbclient ; then
+ einfo "make smbclient library"
+ emake libsmbclient
+ fi
+ if use smbsharemodes ; then
+ einfo "make smbsharemodes library"
+ emake libsmbsharemodes
+ fi
+
+ # compile modules
+ emake modules
+
+ # compile pam moudles
+ if use pam ; then
+ einfo "make pam modules"
+ emake pam_modules
+ fi
+
+ # compile winbind nss modules
+ if use winbind ; then
+ einfo "make nss modules"
+ emake nss_modules
+ fi
+
+ # compile utilities
+ if multilib_is_native_abi; then
+ if [ -n "${BINPROGS}" ] ; then
+ einfo "make binprogs"
+ emake ${BINPROGS}
+ fi
+ if [ -n "${SBINPROGS}" ] ; then
+ einfo "make sbinprogs"
+ emake ${SBINPROGS}
+ fi
+ fi
+
+ if [ -n "${KRBPLUGIN}" ] ; then
+ einfo "make krbplugin"
+ emake ${KRBPLUGIN}${PLUGINEXT}
+ fi
+}
+
+multilib_src_install() {
+ cd source3 || die
+
+ # pkgconfig files installation needed, bug #464818
+ local pkgconfigdir=/usr/$(get_libdir)/pkgconfig
+
+ # install libs
+ if use addns ; then
+ einfo "install addns library"
+ emake installlibaddns DESTDIR="${D}"
+ fi
+ if use netapi ; then
+ einfo "install netapi library"
+ emake installlibnetapi DESTDIR="${D}"
+ insinto $pkgconfigdir
+ doins pkgconfig/netapi.pc
+ fi
+ if use smbclient ; then
+ einfo "install smbclient library"
+ emake installlibsmbclient DESTDIR="${D}"
+ insinto $pkgconfigdir
+ doins pkgconfig/smbclient.pc
+ fi
+ if use smbsharemodes ; then
+ einfo "install smbsharemodes library"
+ emake installlibsmbsharemodes DESTDIR="${D}"
+ insinto $pkgconfigdir
+ doins pkgconfig/smbsharemodes.pc
+ fi
+
+ # install modules
+ emake installmodules DESTDIR="${D}"
+
+ if use pam ; then
+ einfo "install pam modules"
+ emake installpammodules DESTDIR="${D}"
+
+ if use winbind ; then
+ newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+ doman ../docs/manpages/pam_winbind.8
+ # bug #376853
+ insinto /etc/security
+ doins ../examples/pam_winbind/pam_winbind.conf || die
+ fi
+
+ newpamd "${CONFDIR}/samba.pam" samba
+ dodoc pam_smbpass/README
+ fi
+
+ # Nsswitch extensions. Make link for wins and winbind resolvers
+ if use winbind ; then
+ einfo "install libwbclient"
+ emake installlibwbclient DESTDIR="${D}"
+ dolib.so ../nsswitch/libnss_wins.so
+ dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+ dolib.so ../nsswitch/libnss_winbind.so
+ dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+ insinto $pkgconfigdir
+ doins pkgconfig/wbclient.pc
+ einfo "install libwbclient related manpages"
+ doman ../docs/manpages/idmap_rid.8
+ doman ../docs/manpages/idmap_hash.8
+ if use ldap ; then
+ doman ../docs/manpages/idmap_adex.8
+ doman ../docs/manpages/idmap_ldap.8
+ fi
+ if use ads ; then
+ doman ../docs/manpages/idmap_ad.8
+ fi
+ fi
+
+ # install binaries
+ if multilib_is_native_abi; then
+ insinto /usr
+ for prog in ${SBINPROGS} ; do
+ dosbin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ for prog in ${BINPROGS} ; do
+ dobin ${prog}
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+
+ # install scripts
+ if use client ; then
+ dobin script/findsmb
+ doman ../docs/manpages/findsmb.1
+ fi
+ fi
+
+ # install krbplugin
+ if [ -n "${KRBPLUGIN}" ] ; then
+ if has_version app-crypt/mit-krb5 ; then
+ insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ elif has_version app-crypt/heimdal ; then
+ insinto /usr/$(get_libdir)/plugin/krb5
+ doins ${KRBPLUGIN}${PLUGINEXT}
+ fi
+ insinto /usr
+ for prog in ${KRBPLUGIN} ; do
+ doman ../docs/manpages/${prog/bin\/}*
+ done
+ fi
+}
+
+multilib_src_install_all() {
+ # install server components
+ if use server ; then
+ doman docs/manpages/vfs* docs/manpages/samba.7
+
+ diropts -m0700
+ keepdir /var/lib/samba/private
+
+ diropts -m1777
+ keepdir /var/spool/samba
+
+ diropts -m0755
+ keepdir /var/{cache,log}/samba
+ keepdir /var/lib/samba/{netlogon,profiles}
+ keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+ keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+ newconfd "${CONFDIR}/samba.confd" samba
+ newinitd "${CONFDIR}/samba.initd" samba
+
+ insinto /etc/samba
+ doins "${CONFDIR}"/{smbusers,lmhosts}
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ if use swat ; then
+ insinto /etc/xinetd.d
+ newins "${CONFDIR}/swat.xinetd" swat
+ script/installswat.sh "${ED}" "${EROOT}/usr/share/doc/${PF}/swat" "${S}"
+ fi
+
+ dodoc MAINTAINERS.txt README* Roadmap WHATSNEW.txt docs/THANKS
+ fi
+
+ # install the spooler to cups
+ if use cups ; then
+ dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
+ fi
+
+ # install misc files
+ insinto /etc/samba
+ doins examples/smb.conf.default
+ doman docs/manpages/smb.conf.5
+
+ insinto /usr/"$(get_libdir)"/samba
+ doins codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+ # install docs
+ if use doc ; then
+ dohtml -r docs/htmldocs/.
+ dodoc docs/*.pdf
+ fi
+
+ # install examples
+ if use examples ; then
+ insinto /usr/share/doc/${PF}/examples
+
+ if use smbclient ; then
+ doins -r examples/libsmbclient
+ fi
+
+ if use winbind ; then
+ doins -r examples/pam_winbind examples/nss
+ fi
+
+ if use server ; then
+ cd examples || die
+ doins -r auth autofs dce-dfs LDAP logon misc pdb \
+ perfcounter printer-accounting printing scripts tridge \
+ validchars VFS
+ fi
+ fi
+
+ # Remove empty installation directories
+ rmdir --ignore-fail-on-non-empty \
+ "${ED}/usr/$(get_libdir)/samba" \
+ "${ED}/usr"/{sbin,bin} \
+ "${ED}/usr/share"/{man,locale,} \
+ "${ED}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+ # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+
+ systemd_dotmpfilesd "${FILESDIR}"/samba.conf
+ systemd_dounit "${FILESDIR}"/nmbd.service
+ systemd_dounit "${FILESDIR}"/smbd.{service,socket}
+ systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
+ systemd_dounit "${FILESDIR}"/winbindd.service
+}
+
+pkg_postinst() {
+ elog "Samba 3.6 has adopted a number of improved security defaults that"
+ elog "will impact on existing users of Samba."
+ elog " client ntlmv2 auth = yes"
+ elog " client use spnego principal = no"
+ elog " send spnego principal = no"
+ elog ""
+ elog "SMB2 protocol support in 3.6.0 is fully functional and can be "
+ elog "enabled by setting 'max protocol = smb2'. SMB2 is a new "
+ elog "implementation of the SMB protocol used by Windows Vista and higher"
+ elog ""
+ elog "For further information make sure to read the release notes at"
+ elog "http://samba.org/samba/history/${P}.html and "
+ elog "http://samba.org/samba/history/${PN}-3.6.0.html"
+}
diff --git a/net-fs/samba/samba-4.0.26.ebuild b/net-fs/samba/samba-4.0.26.ebuild
new file mode 100644
index 00000000000..889c20e6a98
--- /dev/null
+++ b/net-fs/samba/samba-4.0.26.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+)'
+
+inherit python-single-r1 waf-utils multilib linux-info systemd eutils
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+if [ "${PV}" = "4.9999" ]; then
+ EGIT_REPO_URI="git://git.samba.org/samba.git"
+ KEYWORDS=""
+ inherit git-2
+else
+ SRC_URI="mirror://samba/stable/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~hppa ~x86"
+fi
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addns ads aio avahi client cluster cups dmapi fam gnutls iprint
+ldap quota selinux swat syslog test winbind"
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+# sys-libs/pam is an automagic dependency (see bug #489770)
+CDEPEND="${PYTHON_DEPS}
+ >=app-crypt/heimdal-1.5[-ssl]
+ dev-libs/iniparser
+ dev-libs/popt
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP}]
+ sys-apps/attr
+ sys-libs/libcap
+ >=sys-libs/ldb-1.1.16
+ >=sys-libs/tdb-1.2.11[python,${PYTHON_USEDEP}]
+ >=sys-libs/talloc-2.0.8[python,${PYTHON_USEDEP}]
+ >=sys-libs/tevent-0.9.18
+ sys-libs/zlib
+ virtual/pam
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ aio? ( dev-libs/libaio )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ cups? ( net-print/cups )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( virtual/fam )
+ gnutls? ( dev-libs/libgcrypt:0
+ >=net-libs/gnutls-1.4.0 )
+ ldap? ( net-nds/openldap )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+REQUIRED_USE="ads? ( acl ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+# sys-apps/dmapi is an automagic dependency (see bug #474492)
+PATCHES=(
+ "${FILESDIR}/named.conf.dlz.patch"
+ "${FILESDIR}/${PN}-4.0.19-automagic_aio_fix.patch"
+)
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use aio; then
+ if ! linux_config_exists || ! linux_chkconfig_present AIO; then
+ ewarn "You must enable AIO support in your kernel config, "
+ ewarn "to be able to support asynchronous I/O. "
+ ewarn "You can find it at"
+ ewarn
+ ewarn "General Support"
+ ewarn " Enable AIO support "
+ ewarn
+ ewarn "and recompile your kernel..."
+ fi
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ use "cluster" && myconf+=" --with-ctdb-dir=/usr"
+ use "test" && myconf+=" --enable-selftest"
+ myconf="${myconf} \
+ --enable-fhs \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-modulesdir=/usr/$(get_libdir)/samba \
+ --with-pammodulesdir=/$(get_libdir)/security \
+ --with-piddir=/var/run/${PN} \
+ --disable-rpath \
+ --disable-rpath-install \
+ --nopyc \
+ --nopyo \
+ --disable-ntdb \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(use_with addns dnsupdate) \
+ $(use_with acl acl-support) \
+ $(use_with ads) \
+ $(use_with aio aio-support) \
+ $(use_enable avahi) \
+ $(use_with cluster cluster-support) \
+ $(use_enable cups) \
+ $(use_with dmapi) \
+ $(use_with fam) \
+ $(use_enable gnutls) \
+ $(use_enable iprint) \
+ $(use_with ldap) \
+ --with-pam \
+ --with-pam_smbpass \
+ $(use_with quota quotas) \
+ $(use_with syslog) \
+ $(use_with swat) \
+ $(use_with winbind)
+ "
+ use "ads" && myconf+=" --with-shared-modules=idmap_ad"
+
+ CPPFLAGS="-I${SYSROOT}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ # Install init script and conf.d file
+ newinitd "${CONFDIR}/samba4.initd-r1" samba
+ newconfd "${CONFDIR}/samba4.confd" samba
+
+ systemd_dotmpfilesd "${FILESDIR}"/samba.conf
+ systemd_dounit "${FILESDIR}"/nmbd.service
+ systemd_dounit "${FILESDIR}"/smbd.{service,socket}
+ systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
+ systemd_dounit "${FILESDIR}"/winbindd.service
+}
+
+src_test() {
+ "${WAF_BINARY}" test || die "test failed"
+}
+
+pkg_postinst() {
+ elog "This is is the first stable release of Samba 4.0"
+
+ ewarn "Be aware the this release contains the best of all of Samba's"
+ ewarn "technology parts, both a file server (that you can reasonably expect"
+ ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
+ ewarn "controller work previously known as 'samba4'."
+
+ elog "For further information and migration steps make sure to read "
+ elog "http://samba.org/samba/history/${P}.html "
+ elog "http://samba.org/samba/history/${PN}-4.0.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/net-fs/samba/samba-4.1.18.ebuild b/net-fs/samba/samba-4.1.18.ebuild
new file mode 100644
index 00000000000..b79e8610297
--- /dev/null
+++ b/net-fs/samba/samba-4.1.18.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+)'
+
+inherit python-single-r1 waf-utils multilib linux-info systemd base
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+SRC_URI="mirror://samba/stable/${MY_P}.tar.gz"
+KEYWORDS="~amd64 ~arm64 ~hppa ~x86"
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addns ads aio avahi client cluster cups dmapi fam gnutls iprint
+ldap quota selinux syslog systemd test winbind"
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+# sys-libs/pam is an automagic dependency (see bug #489770)
+CDEPEND="${PYTHON_DEPS}
+ >=app-crypt/heimdal-1.5[-ssl,-threads]
+ dev-libs/iniparser
+ dev-libs/popt
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP}]
+ sys-apps/attr
+ sys-libs/libcap
+ >=sys-libs/ntdb-1.0[python,${PYTHON_USEDEP}]
+ >=sys-libs/ldb-1.1.17
+ >=sys-libs/tdb-1.2.12[python,${PYTHON_USEDEP}]
+ >=sys-libs/talloc-2.1.2[python,${PYTHON_USEDEP}]
+ >=sys-libs/tevent-0.9.18
+ sys-libs/zlib
+ virtual/pam
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ aio? ( dev-libs/libaio )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ cups? ( net-print/cups )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( virtual/fam )
+ gnutls? ( dev-libs/libgcrypt:0
+ >=net-libs/gnutls-1.4.0 )
+ ldap? ( net-nds/openldap )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+REQUIRED_USE="ads? ( acl ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.1.14-named.conf.dlz.patch"
+ "${FILESDIR}/${PN}-4.0.19-automagic_aio_fix.patch"
+ # support libsystemd (instead of libsystemd-daemon), bug #526362
+ "${FILESDIR}/${PN}-4.1.14-libsystemd.patch"
+)
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use aio; then
+ if ! linux_config_exists || ! linux_chkconfig_present AIO; then
+ ewarn "You must enable AIO support in your kernel config, "
+ ewarn "to be able to support asynchronous I/O. "
+ ewarn "You can find it at"
+ ewarn
+ ewarn "General Support"
+ ewarn " Enable AIO support "
+ ewarn
+ ewarn "and recompile your kernel..."
+ fi
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ use "cluster" && myconf+=" --with-ctdb-dir=/usr"
+ use "test" && myconf+=" --enable-selftest"
+ myconf="${myconf} \
+ --enable-fhs \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-modulesdir=/usr/$(get_libdir)/samba \
+ --with-pammodulesdir=/$(get_libdir)/security \
+ --with-piddir=/var/run/${PN} \
+ --disable-rpath \
+ --disable-rpath-install \
+ --nopyc \
+ --nopyo \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(use_with addns dnsupdate) \
+ $(use_with acl acl-support) \
+ $(use_with ads) \
+ $(use_with aio aio-support) \
+ $(use_enable avahi) \
+ $(use_with cluster cluster-support) \
+ $(use_enable cups) \
+ $(use_with dmapi) \
+ $(use_with fam) \
+ $(use_enable gnutls) \
+ $(use_enable iprint) \
+ $(use_with ldap) \
+ --with-pam \
+ --with-pam_smbpass \
+ $(use_with quota quotas) \
+ $(use_with syslog) \
+ $(use_with systemd) \
+ $(use_with winbind)
+ "
+ use "ads" && myconf+=" --with-shared-modules=idmap_ad"
+
+ CPPFLAGS="-I${SYSROOT}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ # Install init script and conf.d file
+ newinitd "${CONFDIR}/samba4.initd-r1" samba
+ newconfd "${CONFDIR}/samba4.confd" samba
+
+ systemd_dotmpfilesd "${FILESDIR}"/samba.conf
+ systemd_dounit "${FILESDIR}"/nmbd.service
+ systemd_dounit "${FILESDIR}"/smbd.{service,socket}
+ systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
+ systemd_dounit "${FILESDIR}"/winbindd.service
+ systemd_dounit "${FILESDIR}"/samba.service
+}
+
+src_test() {
+ "${WAF_BINARY}" test || die "test failed"
+}
+
+pkg_postinst() {
+ ewarn "Be aware the this release contains the best of all of Samba's"
+ ewarn "technology parts, both a file server (that you can reasonably expect"
+ ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
+ ewarn "controller work previously known as 'samba4'."
+
+ elog "For further information and migration steps make sure to read "
+ elog "http://samba.org/samba/history/${P}.html "
+ elog "http://samba.org/samba/history/${PN}-4.0.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/net-fs/samba/samba-4.1.19.ebuild b/net-fs/samba/samba-4.1.19.ebuild
new file mode 100644
index 00000000000..b79e8610297
--- /dev/null
+++ b/net-fs/samba/samba-4.1.19.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+)'
+
+inherit python-single-r1 waf-utils multilib linux-info systemd base
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+SRC_URI="mirror://samba/stable/${MY_P}.tar.gz"
+KEYWORDS="~amd64 ~arm64 ~hppa ~x86"
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addns ads aio avahi client cluster cups dmapi fam gnutls iprint
+ldap quota selinux syslog systemd test winbind"
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+# sys-libs/pam is an automagic dependency (see bug #489770)
+CDEPEND="${PYTHON_DEPS}
+ >=app-crypt/heimdal-1.5[-ssl,-threads]
+ dev-libs/iniparser
+ dev-libs/popt
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP}]
+ sys-apps/attr
+ sys-libs/libcap
+ >=sys-libs/ntdb-1.0[python,${PYTHON_USEDEP}]
+ >=sys-libs/ldb-1.1.17
+ >=sys-libs/tdb-1.2.12[python,${PYTHON_USEDEP}]
+ >=sys-libs/talloc-2.1.2[python,${PYTHON_USEDEP}]
+ >=sys-libs/tevent-0.9.18
+ sys-libs/zlib
+ virtual/pam
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ aio? ( dev-libs/libaio )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ cups? ( net-print/cups )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( virtual/fam )
+ gnutls? ( dev-libs/libgcrypt:0
+ >=net-libs/gnutls-1.4.0 )
+ ldap? ( net-nds/openldap )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+REQUIRED_USE="ads? ( acl ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.1.14-named.conf.dlz.patch"
+ "${FILESDIR}/${PN}-4.0.19-automagic_aio_fix.patch"
+ # support libsystemd (instead of libsystemd-daemon), bug #526362
+ "${FILESDIR}/${PN}-4.1.14-libsystemd.patch"
+)
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use aio; then
+ if ! linux_config_exists || ! linux_chkconfig_present AIO; then
+ ewarn "You must enable AIO support in your kernel config, "
+ ewarn "to be able to support asynchronous I/O. "
+ ewarn "You can find it at"
+ ewarn
+ ewarn "General Support"
+ ewarn " Enable AIO support "
+ ewarn
+ ewarn "and recompile your kernel..."
+ fi
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ use "cluster" && myconf+=" --with-ctdb-dir=/usr"
+ use "test" && myconf+=" --enable-selftest"
+ myconf="${myconf} \
+ --enable-fhs \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-modulesdir=/usr/$(get_libdir)/samba \
+ --with-pammodulesdir=/$(get_libdir)/security \
+ --with-piddir=/var/run/${PN} \
+ --disable-rpath \
+ --disable-rpath-install \
+ --nopyc \
+ --nopyo \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(use_with addns dnsupdate) \
+ $(use_with acl acl-support) \
+ $(use_with ads) \
+ $(use_with aio aio-support) \
+ $(use_enable avahi) \
+ $(use_with cluster cluster-support) \
+ $(use_enable cups) \
+ $(use_with dmapi) \
+ $(use_with fam) \
+ $(use_enable gnutls) \
+ $(use_enable iprint) \
+ $(use_with ldap) \
+ --with-pam \
+ --with-pam_smbpass \
+ $(use_with quota quotas) \
+ $(use_with syslog) \
+ $(use_with systemd) \
+ $(use_with winbind)
+ "
+ use "ads" && myconf+=" --with-shared-modules=idmap_ad"
+
+ CPPFLAGS="-I${SYSROOT}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ # Install init script and conf.d file
+ newinitd "${CONFDIR}/samba4.initd-r1" samba
+ newconfd "${CONFDIR}/samba4.confd" samba
+
+ systemd_dotmpfilesd "${FILESDIR}"/samba.conf
+ systemd_dounit "${FILESDIR}"/nmbd.service
+ systemd_dounit "${FILESDIR}"/smbd.{service,socket}
+ systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
+ systemd_dounit "${FILESDIR}"/winbindd.service
+ systemd_dounit "${FILESDIR}"/samba.service
+}
+
+src_test() {
+ "${WAF_BINARY}" test || die "test failed"
+}
+
+pkg_postinst() {
+ ewarn "Be aware the this release contains the best of all of Samba's"
+ ewarn "technology parts, both a file server (that you can reasonably expect"
+ ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
+ ewarn "controller work previously known as 'samba4'."
+
+ elog "For further information and migration steps make sure to read "
+ elog "http://samba.org/samba/history/${P}.html "
+ elog "http://samba.org/samba/history/${PN}-4.0.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/net-fs/samba/samba-4.2.3.ebuild b/net-fs/samba/samba-4.2.3.ebuild
new file mode 100644
index 00000000000..de4d61db5c1
--- /dev/null
+++ b/net-fs/samba/samba-4.2.3.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+)'
+
+inherit python-single-r1 waf-utils multilib linux-info systemd eutils
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+SRC_PATH="stable"
+[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
+
+SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz"
+KEYWORDS="~amd64 ~hppa ~x86"
+[[ ${PV} = *_rc* ]] && KEYWORDS=""
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addns ads aio avahi client cluster cups dmapi fam gnutls iprint
+ldap quota selinux syslog systemd test winbind"
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+# sys-libs/pam is an automagic dependency (see bug #489770)
+CDEPEND="${PYTHON_DEPS}
+ >=app-crypt/heimdal-1.5[-ssl]
+ dev-libs/iniparser
+ dev-libs/popt
+ sys-libs/readline:=
+ virtual/libiconv
+ dev-python/subunit[${PYTHON_USEDEP}]
+ >=net-libs/socket_wrapper-1.1.2
+ sys-apps/attr
+ sys-libs/libcap
+ >=sys-libs/ldb-1.1.20
+ >=sys-libs/nss_wrapper-1.0.2
+ >=sys-libs/ntdb-1.0[python,${PYTHON_USEDEP}]
+ >=sys-libs/talloc-2.1.2[python,${PYTHON_USEDEP}]
+ >=sys-libs/tdb-1.3.6[python,${PYTHON_USEDEP}]
+ >=sys-libs/tevent-0.9.25
+ >=sys-libs/uid_wrapper-1.0.1
+ sys-libs/zlib
+ virtual/pam
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ aio? ( dev-libs/libaio )
+ cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+ cups? ( net-print/cups )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( virtual/fam )
+ gnutls? ( dev-libs/libgcrypt:0
+ >=net-libs/gnutls-1.4.0 )
+ ldap? ( net-nds/openldap )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+"
+
+REQUIRED_USE="ads? ( acl gnutls ldap )
+ ${PYTHON_REQUIRED_USE}"
+
+RESTRICT="mirror"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=( "${FILESDIR}/${PN}-4.2.3-heimdal_compilefix.patch" )
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use aio; then
+ if ! linux_config_exists || ! linux_chkconfig_present AIO; then
+ ewarn "You must enable AIO support in your kernel config, "
+ ewarn "to be able to support asynchronous I/O. "
+ ewarn "You can find it at"
+ ewarn
+ ewarn "General Support"
+ ewarn " Enable AIO support "
+ ewarn
+ ewarn "and recompile your kernel..."
+ fi
+ fi
+}
+
+src_prepare() {
+ epatch ${PATCHES[@]}
+}
+
+src_configure() {
+ local myconf=''
+ use "cluster" && myconf+=" --with-ctdb-dir=/usr"
+ use "test" && myconf+=" --enable-selftest"
+ myconf="${myconf} \
+ --enable-fhs \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-modulesdir=/usr/$(get_libdir)/samba \
+ --with-pammodulesdir=/$(get_libdir)/security \
+ --with-piddir=/var/run/${PN} \
+ --disable-rpath \
+ --disable-rpath-install \
+ --nopyc \
+ --nopyo \
+ --bundled-libraries=NONE \
+ --builtin-libraries=NONE \
+ $(use_with addns dnsupdate) \
+ $(use_with acl acl-support) \
+ $(use_with ads) \
+ $(use_with aio aio-support) \
+ $(use_enable avahi) \
+ $(use_with cluster cluster-support) \
+ $(use_enable cups) \
+ $(use_with dmapi) \
+ $(use_with fam) \
+ $(use_enable gnutls) \
+ $(use_enable iprint) \
+ $(use_with ldap) \
+ --with-pam \
+ --with-pam_smbpass \
+ $(use_with quota quotas) \
+ $(use_with syslog) \
+ $(use_with systemd) \
+ $(use_with winbind)
+ "
+ use "ads" && myconf+=" --with-shared-modules=idmap_ad"
+
+ CPPFLAGS="-I${SYSROOT}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ # Install init script and conf.d file
+ newinitd "${CONFDIR}/samba4.initd-r1" samba
+ newconfd "${CONFDIR}/samba4.confd" samba
+
+ systemd_dotmpfilesd "${FILESDIR}"/samba.conf
+ systemd_dounit "${FILESDIR}"/nmbd.service
+ systemd_dounit "${FILESDIR}"/smbd.{service,socket}
+ systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
+ systemd_dounit "${FILESDIR}"/winbindd.service
+ systemd_dounit "${FILESDIR}"/samba.service
+}
+
+src_test() {
+ "${WAF_BINARY}" test || die "test failed"
+}
+
+pkg_postinst() {
+ ewarn "Be aware the this release contains the best of all of Samba's"
+ ewarn "technology parts, both a file server (that you can reasonably expect"
+ ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
+ ewarn "controller work previously known as 'samba4'."
+
+ elog "For further information and migration steps make sure to read "
+ elog "http://samba.org/samba/history/${P}.html "
+ elog "http://samba.org/samba/history/${PN}-4.0.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/net-fs/smbnetfs/Manifest b/net-fs/smbnetfs/Manifest
new file mode 100644
index 00000000000..799a8c70ca2
--- /dev/null
+++ b/net-fs/smbnetfs/Manifest
@@ -0,0 +1,2 @@
+DIST smbnetfs-0.5.3b.tar.bz2 167258 SHA256 28743ac394927ea0f03561c572a47f4c5ff31c3c0c0786b225bb7a0227182bc9 SHA512 a4ab92147c45481534915eb3610d49fdf0ba74b743fac31ece3030dac77a31c9a8956dcb97a02a6170e0a24557d4bc7d5ae882fe09fb8b7a2b3887224356f2f8 WHIRLPOOL b4cba3f6c368e2a87001d1780d06b9230da8c56f628735c1ab8840b7e2194703d6dbd308098e0d451c29da29b576fea62a5ba8d16730ebe8caf828be97130685
+DIST smbnetfs-0.6.0.tar.bz2 147946 SHA256 6dd20bf01201f8be4b5d20cfbfba627f6825bcb60fe71f54d8c8de18509e519b SHA512 5bc5327b1087d051cbedda40ea1183c2515e3a42b2027812c6528bbbcb736b7f92f95b3c7b9cc53da99c2138c945ceb517042359029cbe0ab8cd887839711ced WHIRLPOOL d6cce90507de276169bdbb1ce9c3579bc08713dd0df1020a58cbced0989a115124988f05317a7907aab98b391fd78f8d3aea3861960db7e4f5db4e4ae76894df
diff --git a/net-fs/smbnetfs/metadata.xml b/net-fs/smbnetfs/metadata.xml
new file mode 100644
index 00000000000..e66bb8abaa1
--- /dev/null
+++ b/net-fs/smbnetfs/metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ <description>Primary Maintainer</description>
+ </maintainer>
+ <longdescription>
+ SMBNetFS is a Linux/FreeBSD FUSE filesystem that allow you to use samba/microsoft network.
+
+ Features:
+ - Linux-2.6 and FreeBSD &gt;= 6.0 are supported (Linux-2.4 is not tested)
+ - you can use Samba/Microsoft network as a regular unix filesystem
+ - workgroup/computer/share entries are dynamically created
+ - windows domain supported
+ - user defined workgroup/link/hosts are supported
+ - national character supported
+ - in config files you can specify different user/password to access different
+ network shares
+ - command "cd mountpoint/username:password@computer_or_ip" allows you to
+ access "computer_or_ip" as user "username" with password "password"
+ (this is insecure, but usefull)
+ - the program is multithreaded, so simultaneous access to a file/share
+ is possible
+ </longdescription>
+ <use>
+ <flag name="gnome">Use the <pkg>gnome-base/gnome-keyring</pkg> for password management.</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">smbnetfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-fs/smbnetfs/smbnetfs-0.5.3b.ebuild b/net-fs/smbnetfs/smbnetfs-0.5.3b.ebuild
new file mode 100644
index 00000000000..190500dd9e2
--- /dev/null
+++ b/net-fs/smbnetfs/smbnetfs-0.5.3b.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils readme.gentoo
+
+DESCRIPTION="FUSE filesystem for SMB shares"
+HOMEPAGE="http://sourceforge.net/projects/smbnetfs"
+SRC_URI="mirror://sourceforge/smbnetfs/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64 ~arm-linux ~x86-linux"
+IUSE="gnome"
+
+RDEPEND=">=sys-fs/fuse-2.3:=
+ >=net-fs/samba-3.2:=[smbclient]
+ gnome? ( gnome-base/gnome-keyring:= )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/make"
+
+DISABLE_AUTOFORMATTING=yes
+DOC_CONTENTS="
+For quick usage, exec:
+'modprobe fuse'
+'smbnetfs -oallow_other /mnt/samba'
+"
+
+src_configure() {
+ econf $(use_with gnome gnome-keyring)
+}
+
+src_install() {
+ default
+ readme.gentoo_create_doc
+ dodoc AUTHORS ChangeLog
+}
diff --git a/net-fs/smbnetfs/smbnetfs-0.6.0-r1.ebuild b/net-fs/smbnetfs/smbnetfs-0.6.0-r1.ebuild
new file mode 100644
index 00000000000..8def3f231cf
--- /dev/null
+++ b/net-fs/smbnetfs/smbnetfs-0.6.0-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils readme.gentoo
+
+DESCRIPTION="FUSE filesystem for SMB shares"
+HOMEPAGE="http://sourceforge.net/projects/smbnetfs"
+SRC_URI="mirror://sourceforge/smbnetfs/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64 ~arm-linux ~x86-linux"
+IUSE="gnome"
+
+RDEPEND=">=sys-fs/fuse-2.3:=
+ >=net-fs/samba-3.2:=[smbclient(+)]
+ >=dev-libs/glib-2.30:=
+ gnome? ( gnome-base/gnome-keyring:= )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/make"
+
+DISABLE_AUTOFORMATTING=yes
+DOC_CONTENTS="
+For quick usage, exec:
+'modprobe fuse'
+'smbnetfs -oallow_other /mnt/samba'
+"
+
+src_configure() {
+ econf $(use_with gnome gnome-keyring)
+}
+
+src_install() {
+ default
+ readme.gentoo_create_doc
+ dodoc AUTHORS ChangeLog
+}
diff --git a/net-fs/smbnetfs/smbnetfs-0.6.0.ebuild b/net-fs/smbnetfs/smbnetfs-0.6.0.ebuild
new file mode 100644
index 00000000000..0689793a9c9
--- /dev/null
+++ b/net-fs/smbnetfs/smbnetfs-0.6.0.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils readme.gentoo
+
+DESCRIPTION="FUSE filesystem for SMB shares"
+HOMEPAGE="http://sourceforge.net/projects/smbnetfs"
+SRC_URI="mirror://sourceforge/smbnetfs/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64 ~arm-linux ~x86-linux"
+IUSE="gnome"
+
+RDEPEND=">=sys-fs/fuse-2.3:=
+ >=net-fs/samba-3.2:=[smbclient]
+ >=dev-libs/glib-2.30:=
+ gnome? ( gnome-base/gnome-keyring:= )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/make"
+
+DISABLE_AUTOFORMATTING=yes
+DOC_CONTENTS="
+For quick usage, exec:
+'modprobe fuse'
+'smbnetfs -oallow_other /mnt/samba'
+"
+
+src_configure() {
+ econf $(use_with gnome gnome-keyring)
+}
+
+src_install() {
+ default
+ readme.gentoo_create_doc
+ dodoc AUTHORS ChangeLog
+}
diff --git a/net-fs/smbtad/Manifest b/net-fs/smbtad/Manifest
new file mode 100644
index 00000000000..4229f213c49
--- /dev/null
+++ b/net-fs/smbtad/Manifest
@@ -0,0 +1 @@
+DIST smbtad-1.2.6.tar.bz2 82062 SHA256 0f641a7cb9f98d6ea28f52bca5055eebec74fa6d3e5fe32236afa3770ea26d48 SHA512 fd3b370d973a42fb2dee48d2fec08e20af32386893ee67bc407decd001a76c944f3a17b3251e9d8d746feb1e87c69776986d600fd108450113835823f6313e2c WHIRLPOOL 697199a30217e5f1c4dd0ce1754b4542725d9e8aa96c8fd78f354a50324518a8bcb6e03bbfe8a789531b5ef02846cb553527d08a25f8297937a2fa511d80376b
diff --git a/net-fs/smbtad/files/smbtad.rc b/net-fs/smbtad/files/smbtad.rc
new file mode 100755
index 00000000000..cf134b4ad39
--- /dev/null
+++ b/net-fs/smbtad/files/smbtad.rc
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CONFFILE=/etc/conf.d/${SVCNAME}.conf
+PIDFILE=/var/run/${SVCNAME}.pid
+
+depend() {
+ before samba
+ use dns logger
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --quiet \
+ --exec /usr/bin/"${SVCNAME}" \
+ -- -c "${CONFFILE}"
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet --name "${SVCNAME}"
+ eend ${?}
+}
diff --git a/net-fs/smbtad/metadata.xml b/net-fs/smbtad/metadata.xml
new file mode 100644
index 00000000000..f3b584e4d0b
--- /dev/null
+++ b/net-fs/smbtad/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>samba</herd>
+ <maintainer>
+ <email>samba@gentoo.org</email>
+ <name>Samba Team</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">hhetter/smbtad</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-fs/smbtad/smbtad-1.2.6.ebuild b/net-fs/smbtad/smbtad-1.2.6.ebuild
new file mode 100644
index 00000000000..23dc627c394
--- /dev/null
+++ b/net-fs/smbtad/smbtad-1.2.6.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+DESCRIPTION="Data receiver of the SMB Traffic Analyzer project"
+HOMEPAGE="http://github.com/hhetter/smbtad"
+SRC_URI="http://morelias.org/smbta/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+DEPEND="
+ dev-db/libdbi
+ dev-libs/iniparser
+ sys-libs/talloc
+"
+RDEPEND="${DEPEND}
+ || (
+ <net-fs/samba-3.6[smbtav2]
+ >=net-fs/samba-3.6
+ )
+"
+
+DOCS="README AUTHORS"
+
+src_prepare() {
+ sed -i \
+ -e '/CMAKE_C_FLAGS/d' \
+ CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use debug)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ newinitd "${FILESDIR}"/smbtad.rc smbtad
+ newconfd dist/smbtad.conf_example smbtad.conf
+}
diff --git a/net-fs/smbtatools/Manifest b/net-fs/smbtatools/Manifest
new file mode 100644
index 00000000000..f3f194ab938
--- /dev/null
+++ b/net-fs/smbtatools/Manifest
@@ -0,0 +1 @@
+DIST smbtatools-1.2.6.tar.bz2 2235106 SHA256 be03ebb24bed338cd2cc1e38bc112eb52c0b7c9f2154b3c1c9d195fd7245e667 SHA512 0dc25d8eb65151cb7216b2c417054259a0f415af5857e59239ae90aee93a8a3a43a7a74f5f9d8b2200a47e0c6fc92ac6c58308452075020c35ee6ebcb71dbfcf WHIRLPOOL f3f840fcbd54406d5f1e170ff397b723c1ef308413a6b04d029ac63b2689eb4d996ba383cbef4a9e93870e48b66bedd89f4e64edf23b5d7bfd8b192e9c403dc4
diff --git a/net-fs/smbtatools/metadata.xml b/net-fs/smbtatools/metadata.xml
new file mode 100644
index 00000000000..d3af04c2780
--- /dev/null
+++ b/net-fs/smbtatools/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>samba</herd>
+ <maintainer>
+ <email>samba@gentoo.org</email>
+ <name>Samba Team</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">hhetter/smbtatools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-fs/smbtatools/smbtatools-1.2.6.ebuild b/net-fs/smbtatools/smbtatools-1.2.6.ebuild
new file mode 100644
index 00000000000..18b96f08595
--- /dev/null
+++ b/net-fs/smbtatools/smbtatools-1.2.6.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit cmake-utils
+
+DESCRIPTION="Tools for configuration and query of SMB Traffic Analyzer"
+HOMEPAGE="http://github.com/hhetter/smbtatools"
+SRC_URI="http://morelias.org/smbta/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+DEPEND="
+ dev-db/libdbi
+ >=dev-db/sqlite-3.7.0:3
+ net-fs/samba
+ net-misc/curl
+ sys-libs/ncurses
+ sys-libs/talloc
+ x11-libs/cairo
+ x11-libs/pango
+ dev-qt/qtgui:4
+
+"
+RDEPEND="${DEPEND}
+ net-fs/smbtad
+"
+
+DOCS="doc/smbta-guide.html doc/gfx/*.png"
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake-utils_use debug)
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/net-fs/tahoe-lafs/Manifest b/net-fs/tahoe-lafs/Manifest
new file mode 100644
index 00000000000..806bbced439
--- /dev/null
+++ b/net-fs/tahoe-lafs/Manifest
@@ -0,0 +1 @@
+DIST allmydata-tahoe-1.10.0.tar.bz2 1174044 SHA256 9c5516700fe95fdf8c57eca1e2a7b4aebf2de9a4d327d50afd684ebf833ccfe2 SHA512 664e1cbff3061c54f750af97f74a9fd6f1a16d5f6da73db4cb0e80bc01c97a4e18bf17818c9642e0d95b4a0b3669dc8648f800e63c4793ffb9f2f1bd6de2d461 WHIRLPOOL 9f579783cf46374c329f209898ebe34f28bc3e851ed4ec3eabe7cbb5bd2aac4a7b5aad925b1c688a46dec33f218c8e539dd2d464bdda82c67f685887f5aebf18
diff --git a/net-fs/tahoe-lafs/files/tahoe-lafs-1.10.0-ifconfig.patch b/net-fs/tahoe-lafs/files/tahoe-lafs-1.10.0-ifconfig.patch
new file mode 100644
index 00000000000..c760f60e1cc
--- /dev/null
+++ b/net-fs/tahoe-lafs/files/tahoe-lafs-1.10.0-ifconfig.patch
@@ -0,0 +1,20 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Thu Aug 1 14:17:10 UTC 2013
+Subject: don't hardcode ifconfig path
+
+--- allmydata-tahoe-1.10.0/src/allmydata/util/iputil.py
++++ allmydata-tahoe-1.10.0/src/allmydata/util/iputil.py
+@@ -177,11 +177,11 @@
+ _win32_re = re.compile('^\s*\d+\.\d+\.\d+\.\d+\s.+\s(?P<address>\d+\.\d+\.\d+\.\d+)\s+(?P<metric>\d+)\s*$', flags=re.M|re.I|re.S)
+
+ # These work in Redhat 6.x and Debian 2.2 potato
+-_linux_path = '/sbin/ifconfig'
++_linux_path = 'ifconfig'
+ _linux_re = re.compile('^\s*inet [a-zA-Z]*:?(?P<address>\d+\.\d+\.\d+\.\d+)\s.+$', flags=re.M|re.I|re.S)
+
+ # NetBSD 1.4 (submitted by Rhialto), Darwin, Mac OS X
+-_netbsd_path = '/sbin/ifconfig'
++_netbsd_path = 'ifconfig'
+ _netbsd_args = ('-a',)
+ _netbsd_re = re.compile('^\s+inet [a-zA-Z]*:?(?P<address>\d+\.\d+\.\d+\.\d+)\s.+$', flags=re.M|re.I|re.S)
+
diff --git a/net-fs/tahoe-lafs/files/tahoe-lafs-1.10.0-setup.patch b/net-fs/tahoe-lafs/files/tahoe-lafs-1.10.0-setup.patch
new file mode 100644
index 00000000000..6cc7ae9dfd3
--- /dev/null
+++ b/net-fs/tahoe-lafs/files/tahoe-lafs-1.10.0-setup.patch
@@ -0,0 +1,17 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Thu Aug 1 02:58:04 UTC 2013
+Subject: remove bundled setuptools
+
+--- allmydata-tahoe-1.10.0/setup.py
++++ allmydata-tahoe-1.10.0/setup.py
+@@ -70,9 +70,7 @@
+
+ __requires__ = install_requires[:]
+
+-egg = os.path.realpath(glob.glob('setuptools-*.egg')[0])
+-sys.path.insert(0, egg)
+-import setuptools; setuptools.bootstrap_install_from = egg
++import setuptools
+
+ from setuptools import setup
+ from setuptools.command import sdist
diff --git a/net-fs/tahoe-lafs/metadata.xml b/net-fs/tahoe-lafs/metadata.xml
new file mode 100644
index 00000000000..967e7e63749
--- /dev/null
+++ b/net-fs/tahoe-lafs/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ Tahoe-LAFS is a Free and Open cloud storage system. It
+ distributes your data across multiple servers. Even if some
+ of the servers fail or are taken over by an attacker, the
+ entire filesystem continues to function correctly, preserving
+ your privacy and security.
+ </longdescription>
+ <upstream>
+ <bugs-to>
+ https://tahoe-lafs.org/trac/tahoe-lafs/wiki/ViewTickets
+ </bugs-to>
+ <doc lang="en">
+ https://tahoe-lafs.org/trac/tahoe-lafs/wiki/Doc
+ </doc>
+ <remote-id type="github">tahoe-lafs/tahoe-lafs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-fs/tahoe-lafs/tahoe-lafs-1.10.0-r2.ebuild b/net-fs/tahoe-lafs/tahoe-lafs-1.10.0-r2.ebuild
new file mode 100644
index 00000000000..868f2b9db18
--- /dev/null
+++ b/net-fs/tahoe-lafs/tahoe-lafs-1.10.0-r2.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit distutils-r1
+
+MY_PN="allmydata-tahoe"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Secure, decentralized, data store"
+HOMEPAGE="http://tahoe-lafs.org/trac/tahoe-lafs"
+SRC_URI="http://tahoe-lafs.org/source/tahoe-lafs/releases/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc"
+
+RDEPEND="
+ >=dev-python/foolscap-0.6.1[${PYTHON_USEDEP}]
+ dev-python/nevow[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/pyasn1[${PYTHON_USEDEP}]
+ dev-python/pycrypto[${PYTHON_USEDEP}]
+ dev-python/pycryptopp[${PYTHON_USEDEP}]
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/pyutil[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ >=dev-python/twisted-core-9.0.0-r1[${PYTHON_USEDEP}]
+ dev-python/zbase32[${PYTHON_USEDEP}]
+ dev-python/zfec[${PYTHON_USEDEP}]
+ dev-python/zope-interface[${PYTHON_USEDEP}]"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=( "${FILESDIR}"/${P}-{setup,ifconfig}.patch )
+
+src_prepare() {
+ rm -r setuptools* setup.cfg || die
+ distutils-r1_src_prepare
+}
+
+src_install() {
+ distutils-r1_src_install
+ use doc && dodoc -r docs/*
+}
+
+pkg_postinst() {
+ elog
+ elog "optional dependencies:"
+ elog " dev-python/twisted-conch (for sftp access)"
+ elog
+}
diff --git a/net-fs/wdfs/Manifest b/net-fs/wdfs/Manifest
new file mode 100644
index 00000000000..d71114c141b
--- /dev/null
+++ b/net-fs/wdfs/Manifest
@@ -0,0 +1 @@
+DIST wdfs-1.4.2.tar.gz 109315 SHA256 fcf2e1584568b07c7f3683a983a9be26fae6534b8109e09167e5dff9114ba2e5 SHA512 da7e16ed86cbe4746fabe5fce44c83b1d0cd0fbc19994eefe0ce2a75f3d8c77c3c341a76409150a3509be08f8c0d28b8a9650037edcbbf2aa60f4c8ea5407004 WHIRLPOOL 0306bc45e174a627bf9b728a631e3e34135ccd2773b22ff0f9fde1342a03b724bdcc97b5c60ff55ed47337df0099ff62083d90828583e27519af96ebbd2efc1a
diff --git a/net-fs/wdfs/files/wdfs-1.4.2-fix-Waddress.patch b/net-fs/wdfs/files/wdfs-1.4.2-fix-Waddress.patch
new file mode 100644
index 00000000000..0f35776bdeb
--- /dev/null
+++ b/net-fs/wdfs/files/wdfs-1.4.2-fix-Waddress.patch
@@ -0,0 +1,40 @@
+diff --git a/src/wdfs-main.c b/src/wdfs-main.c
+index 9bd5244..a9917b7 100644
+--- a/src/wdfs-main.c
++++ b/src/wdfs-main.c
+@@ -697,7 +697,7 @@ static int wdfs_open(const char *localpath, struct fuse_file_info *fi)
+ ">> %s() by PID %d\n", __func__, fuse_get_context()->pid);
+ }
+
+- assert(localpath && &fi);
++ assert(localpath && fi);
+
+ struct open_file *file = g_new0(struct open_file, 1);
+ file->modified = false;
+@@ -763,7 +763,7 @@ static int wdfs_read(
+ if (wdfs.debug == true)
+ print_debug_infos(__func__, localpath);
+
+- assert(localpath && buf && &fi);
++ assert(localpath && buf && fi);
+
+ struct open_file *file = (struct open_file*)(uintptr_t)fi->fh;
+
+@@ -785,7 +785,7 @@ static int wdfs_write(
+ if (wdfs.debug == true)
+ print_debug_infos(__func__, localpath);
+
+- assert(localpath && buf && &fi);
++ assert(localpath && buf && fi);
+
+ /* data below svn_basedir is read-only */
+ if (wdfs.svn_mode == true && g_str_has_prefix(localpath, svn_basedir))
+@@ -961,7 +961,7 @@ static int wdfs_ftruncate(
+ if (wdfs.debug == true)
+ print_debug_infos(__func__, localpath);
+
+- assert(localpath && &fi);
++ assert(localpath && fi);
+
+ /* data below svn_basedir is read-only */
+ if (wdfs.svn_mode == true && g_str_has_prefix(localpath, svn_basedir))
diff --git a/net-fs/wdfs/metadata.xml b/net-fs/wdfs/metadata.xml
new file mode 100644
index 00000000000..19a60cdb275
--- /dev/null
+++ b/net-fs/wdfs/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ wdfs is a webdav filesystem that makes it possible to mount a webdav
+ share under linux, freebsd and apple mac os x. wdfs has some special
+ features for accessing subversion repositories via webdav. it's based on
+ fuse and neon.
+ </longdescription>
+</pkgmetadata>
diff --git a/net-fs/wdfs/wdfs-1.4.2-r1.ebuild b/net-fs/wdfs/wdfs-1.4.2-r1.ebuild
new file mode 100644
index 00000000000..336ba5dcc69
--- /dev/null
+++ b/net-fs/wdfs/wdfs-1.4.2-r1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="WebDAV filesystem with special features for accessing subversion repositories"
+HOMEPAGE="http://noedler.de/projekte/wdfs/"
+SRC_URI="http://noedler.de/projekte/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND=">=net-libs/neon-0.24.7
+ >=sys-fs/fuse-2.5
+ dev-libs/glib:2"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-fix-Waddress.patch"
+}
diff --git a/net-fs/wdfs/wdfs-1.4.2.ebuild b/net-fs/wdfs/wdfs-1.4.2.ebuild
new file mode 100644
index 00000000000..2d8a766b6d4
--- /dev/null
+++ b/net-fs/wdfs/wdfs-1.4.2.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="WebDAV filesystem with special features for accessing subversion repositories"
+HOMEPAGE="http://noedler.de/projekte/wdfs/"
+SRC_URI="http://noedler.de/projekte/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND=">=net-libs/neon-0.24.7
+ >=sys-fs/fuse-2.5"
+DEPEND="${RDEPEND}"
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc ChangeLog AUTHORS NEWS README
+}