# ChangeLog for net-fs/nfs-utils
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/ChangeLog,v 1.270 2015/02/02 13:47:41 radhermit Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/ChangeLog,v 1.271 2015/02/02 17:45:44 robbat2 Exp $
+
+*nfs-utils-1.3.2-r3 (02 Feb 2015)
+*nfs-utils-1.3.1-r2 (02 Feb 2015)
+
+ 02 Feb 2015; Robin H. Johnson <robbat2@gentoo.org>
+ +files/nfsmount.initd-1.3.1, +nfs-utils-1.3.1-r2.ebuild,
+ +nfs-utils-1.3.2-r3.ebuild:
+ Avoid breaking anybody with nfsmount in their runlevels; but they should
+ really read the news item and update their systems; migration hand-holding
+ script will be removed not sooner than August 1st; reviewed by radhermit,
+ williamh, zero_chaos.
*nfs-utils-1.3.2-r2 (02 Feb 2015)
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
AUX exports 66 SHA256 5d6356df546682e2f1a87131d1bb67de9b1f9a34d3a5742343dc64e890cf71d5 SHA512 fd8052dc8e17eccb0bb1443f341c97ec7c9dac5824294cadf486d91475bc728d4bb69300034b528a690707520590f6675ee371f92e9838afc8ed88092ee0f220 WHIRLPOOL 7cc6b59c1f7013a0ad98518623b03d1cba784ecaf6d6a085b85282192c6f41ac1c649a39dc6e1b42ff38a571c00a85aed6e04ea57d6339a072cc4f2c41d5d74e
AUX nfs-utils-1.1.4-mtab-sym.patch 1020 SHA256 0232799d085151649a1eb1f31644105de7e5cfba888794354005499a0db277c3 SHA512 1cd916028a8515772f05ef63832d73a09e9720055aedc9e2e4ce3a08ce1820948700a4f00ca9c4ee684880f18e67aca888dd857fc7931d923021ba50964be998 WHIRLPOOL c16ecee3228ad4522cf4ede1d05ca50cece3910955314c96eb88a61cfe07b7f6a95c42bb15a7f7f9fd211fa62cdcbb02925e68702d5066338b4543baf56fb2df
AUX nfs-utils-1.2.8-cross-build.patch 1323 SHA256 281ae4f2af4d28adc936be961c2ab4aa4f77c4fb74ba08f2cef1038c6e03b30e SHA512 42a41411d0de384b66a2875fa9ea15e4b854150b5f75ba2db54ad7785fd147ee329eb8867d24a26b2b1d9ef89bd887caeaf0b5a59cdda15f5a11c47888882b9a WHIRLPOOL 52f5704ec8b88eeb3fab37e4aa9a7ca64ca76f0665c66347ab663624cb3b70309a262d86b21882dc5f687741c73974dc6efbc01d6c386e3ea607bbdb89619edb
AUX nfsd.service-r1 294 SHA256 b98575ae9803d0e75159a32f8bed61f6666f8ae130bb93069de13e76943f2577 SHA512 256c78317e5af15cca7f10e247d086d1a0b04ca34d93e8afe4f940d841c93a95ddc119c80aba287d777fe87830dfc8b52f9b558a3663de0ee5e05aa64fbbadbb WHIRLPOOL 8f492d40a44658ab8bbee760c29f738c531ea361081cb18ab7ed85d28d3e9736c2d8e040fe91554a19e8f49e1d26d064d73370f2b6e3ad2cd0927597ab09618d
AUX nfsmount.confd 326 SHA256 b9389e143c2c4f95c11f97a8a379e007f140559016f60011c9d2ff0935758bcb SHA512 6e23897885cc33c49d9c7353b456585a1e0c7300822edba81bc48ba4ccc18297adce137260cc0aa9487aa5ef0aab3eecf931532cfa5bd40fd03bc9e0ddacfb28 WHIRLPOOL 97939b074a9b5717184512088388c9c22a31f37009996b69137023a0f8a97ce6eb41f7cb0a25843ea088f00d37cb45f6b3bd1ba0f801de7cb8f6dc2e5d374dfb
AUX nfsmount.initd 1126 SHA256 b57637c7eb8e40b5cc1655e8afa69dc0aaecbd3186bdca3301586d1e9b797357 SHA512 e2c4d2bf9690b092d7062d95f4242e2591e3ed0aa8b9b36eae977d5d0350b0d90d339f7e75bdcc794abef27cf1541642a8a6dbbaed90e58cc823db4c92af9336 WHIRLPOOL 54a2bdb24015a6d8184fdde3351b152c5625cb6e4ff17876d592a1600fedec1724081b4ff233711ad9d290ea761827067c40ba8ae21121fc6066ba7ed230e483
+AUX nfsmount.initd-1.3.1 876 SHA256 01351509c6c6cf7337e1f0fcfc9d9305ae44f9168ae16555f2cd7d71d22aba02 SHA512 fab297c834ea0e8c04ed91a76e34c76653424880cc54297bcb9e5c49d79ef17e4d9f7fb4cbf9882a22a198098fa5472a2e7372f6174a0f99a7e11281f806a3e7 WHIRLPOOL 8aee33f1acedb557af14d49a369fd1bd4502b00c901f00d6d97f4c96f90b1416cc9195cb73f38539b13c390bcd6ddb60ebca89197b7b8025bf55e54d4ff0d772
AUX proc-fs-nfsd.mount 123 SHA256 39ca215bd3ff124a5872d3535f7cfd403455469350a9495f0ac1f6fb169264c2 SHA512 cd129a6cb7286c175d1dde512bb7cf51c5e56648870cb0082ffeb4068636c78c58c8f3935ebf0c8f177943a4a69b4d02eef80851f88415ad0dffffadaee3dd1b WHIRLPOOL 273581c5e30f4495b12ed5fd35c1cdaaf38351d6a30a17ee45b79406d9c3185c835a2e15c5c1887f1c1bfd98c4669179c7492a9ae7961a2c30ee81bb8f8cb14d
AUX rpc-gssd.service 289 SHA256 1a322ed002c4e3c1e9166f169b8a8467c51bab51897459982cfe73d19c7e7bc6 SHA512 84e8a043b62b6f371dfc19670bd95cf81aef624482072b06e5a1877be23466102775898605ceace0823feb53e0c066c156ab7d16f41fb23833f32d6e06739aa3 WHIRLPOOL 5f1307780deadf454229c1a5a337c4d99e8a4a121d90e37eeadc3981e4bee75a80db36f816f4934fe09f760f504ae1382d29997cbc033a3bab0a0045224b02d3
AUX rpc-idmapd.service 269 SHA256 996c02401f0a5f2516650bd205e993987ca0781b6040a6fbcd6736d6eedf2b62 SHA512 973b0aa83c42f4f22a982680669a0d4109db498362c9c8cbf4da445c04c7be059cb89fe67f839892b53f44c0fd1b4e767f8d8a834ac3d3180c62c83267c5fab1 WHIRLPOOL 4ed69ec063368a0064fe999eb685c113c3aa63d6b6484dd3747722134018e8d774a6803d7617d7b670b938683b8f3de2b46480a5be75c10df86156daed307766
EBUILD nfs-utils-1.2.9-r3.ebuild 4446 SHA256 bfdf40524e42edb4714b33e7edc21c77a316fed63616c2ba21eecb7f9b0aa40e SHA512 8770ccf5cac0348f0513413691c211c88731e964c85dd50eab18b5c0bd9e1196b77213351b0ce01939242c61cde4d4c04bfa79ecfbf1a399afed24bd6dfb4349 WHIRLPOOL 66f9068cbdaaf9998049c99854174cc37bee1e40fdc2a4c9f83761662e4a1997e5a00a15ba654b4a1077364c4561ad6d8855213452113e18533506ca32f64a3f
EBUILD nfs-utils-1.3.0-r1.ebuild 4849 SHA256 1793141abbe923bfbf6077d90b5da3ac84347c0eed82209f3f71c133b67423e0 SHA512 486e1e0eb287755606ce47595eb2d427f0d24f40abdb5723cd55404e7de6b11fc74c8e7592bd76afd068cb9a0339b4cc9fefec1a8b17b0b30e7fd5bc3654876c WHIRLPOOL 418b1a3d5372198008f94874becc2e92ee4d19d2226e4c94f011cead89acbfe274d4cb71340bcd9006d8116ee86400ea69f2aae1f3e9e6d6dc1283690ca860bf
EBUILD nfs-utils-1.3.1-r1.ebuild 5031 SHA256 98f9598d85a9689ac15ea8a422ee3f58d747b664388c2abbb80ad10c303794c7 SHA512 a590b2934e214461aacf15087f424e3208ad88ffb6f513a08bf0746f7f41ebbfbd16a91f4166197ede426562bc93ab72c2050c96ab84f2b120d4065daad98634 WHIRLPOOL 72cdc0168b4a9fba3a856e2a98e579e84647d031882e4e452c245b80221f010c0b3c9fbf08675c9701539ed1b7420edad0ed081cc3a1fd215b627c2ecd62f8e6
+EBUILD nfs-utils-1.3.1-r2.ebuild 5098 SHA256 eae54cbefdb020bcc2e01a65fe0d07dd10495e21c5266eb4fa1d6bb298f4909c SHA512 70d6260021a54ad808a7485fc029bec9bdb4393058a52f4bb8409ad8ed480ed0eeb6b276ef0c79f4d7b786510c66d6477e1835487a9365e0f8b234d79571768a WHIRLPOOL 4d8be2e7f7e74a4e5b67202b86c7f3f273b3125b4b2b06ba7d0003cd1fa73ffae75deba393c754f601c05e4e782f3b011133949a428d42d4d7f6a3d8c4ebdcc9
EBUILD nfs-utils-1.3.2-r2.ebuild 5184 SHA256 299e50fb820d0de7d66131993238e597977974915fc3f449bd069f79ab32a88b SHA512 2ca1ac59362120b8ce86c7108c200e97ba251b5ce18a125dbe16a8d46fbe3b230d42d22d6ea613ec9e85aca847239192f649742245b4bba2e73d85bf1583b713 WHIRLPOOL 199cb7b2f05757fd3952040a139aabb25bd46335620687b11d3624962aa718967dcb31385293e81e08426295eacb17694d36f9058add46c5a5580a3cd3fc472c
-MISC ChangeLog 43872 SHA256 37e653421bf9cb6e310447c6293aa0d671d77358f4b730f4e43f392f47c192ab SHA512 ea257c96c16e6574d5b04715e6712195a0fbaa498154039644fbce2329acdf5493a2825436ddf01cbb84361e18e196ae8e1dfe76fbea62fb6ae3168eb071111f WHIRLPOOL 6443c3a4c02a4432e3a6246c48111628f6c05c269b16a08198063e599901465a65fd7a28691475d403b4d48b71d0481232b7144b1dddfd1de39900127f93f2c4
+EBUILD nfs-utils-1.3.2-r3.ebuild 5250 SHA256 4b9640b675fa421f813a1a5e7e5b0addb24085c0e468dd5b755dd10f2f7c4f87 SHA512 ef415929d4e44f2d80f213f834e2b842b01b7337b2607fb11408aa18dfcfab88b0fa8742c05fb3c2aa34ce756ce7695f9023762e1ad3ca4018017dfb58e320c3 WHIRLPOOL 537915815c23a4f3917ac7f94ab730d4fc4551f8d6b85f5281ebaee07f424436c6312ca362fa1ecd6ad271707b2e00a683e3cb54e0442cc92aba774759270e26
+MISC ChangeLog 44334 SHA256 2c41d324ef48df6d8b299dc4711393aca454ef81dbfa05aa4f07896e6cf203b3 SHA512 7585b86a183843a5455468c0969b388844720bf58bacb156257dc986e4963a8d3025de48175f2814f36e835a1e2a5d6e720d5036160e9005ac34800fdc8190d6 WHIRLPOOL a22dd1017512685f862a0c507314b00ac33bf62dda42602f8461e9ca341608731e5df43ea9c4fbc3c3494ebe6c7e5f903a3127de0fe388b2aba63ea31539d7f7
MISC metadata.xml 636 SHA256 ff4402edfb8a218effdadb00641459f21335e52d055a0f12d084934f3d1b76cd SHA512 090c74991f655df4c08fd062993a15ea9ce4721622d55325539d415e7b89e0920cd9ac6d5cc29a57e56e68998f03384386751bbd56c999897d1c84d4983ae2cb WHIRLPOOL 5f2e62843e843c615c5b0621740d55bcf37453399ca9727f1b70ce53f899157bece44801320558cf769ac4388617f03f65a0bb6167ac07f47561bbb002d40bc9
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-
-iQEcBAEBCAAGBQJUz4AFAAoJEEqz6FtPBkyjCgUH/2DBaM5PyjI3jABTn9CouEjM
-AA7pdc5K0q12HhV18ARoMdGJK820g49QXVG6ZfmYiaCIo2xnBx0QNJWeMhzVAfns
-YghKnvybHkfm3OV+Zddq15+BjTEY8vDhvNtaOVRocpTegadImyXjSKKivrmbyFiB
-/6VmFGXNHTaQvJkFeK/s9xdSJgiMlkxLuY/PnWsJv5TVCZA6H5XeojKg6JlzTC/5
-jeb/VydsI8ROWPTBqG/J2fTmWDjuGzIdjOjtpphJyBI6FSY9Vet+qOaWnQYSmP9+
-7wyVO8xwOyE3R6iXV2a7jr3di131qIYL0Dg74mMXM5qF5N4FVuP0bdl4tuPvCq4=
-=b5HL
------END PGP SIGNATURE-----
--- /dev/null
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/files/nfsmount.initd-1.3.1,v 1.1 2015/02/02 17:45:45 robbat2 Exp $
+
+# 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 not sooner than 2015/August/01"
+}
+
+start() {
+ msg
+}
+
+stop() {
+ msg
+}
--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/nfs-utils-1.3.1-r2.ebuild,v 1.1 2015/02/02 17:45:44 robbat2 Exp $
+
+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
+ newinit "${FILESDIR}"/nfsmount.initd-1.3.1 # 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
+}
--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/nfs-utils-1.3.2-r3.ebuild,v 1.1 2015/02/02 17:45:44 robbat2 Exp $
+
+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.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
+ 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
+ newinit "${FILESDIR}"/nfsmount.initd-1.3.1 # 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
+}