Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-fs/nfs-utils/
Date: Thu, 15 Feb 2018 13:26:10
Message-Id: 1518701154.d26f6ce692d267eae4a0d73a6b96f950ebf23946.polynomial-c@gentoo
1 commit: d26f6ce692d267eae4a0d73a6b96f950ebf23946
2 Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me>
3 AuthorDate: Thu Feb 15 11:51:24 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 15 13:25:54 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d26f6ce6
7
8 net-fs/nfs-utils: pass --with-systemd to configure
9
10 And get rid of systemd_dounit() and removing unneeded unit files
11 afterwards.
12
13 Closes: https://bugs.gentoo.org/550504
14 Closes: https://github.com/gentoo/gentoo/pull/7193
15
16 net-fs/nfs-utils/nfs-utils-2.3.1-r2.ebuild | 185 +++++++++++++++++++++++++++++
17 1 file changed, 185 insertions(+)
18
19 diff --git a/net-fs/nfs-utils/nfs-utils-2.3.1-r2.ebuild b/net-fs/nfs-utils/nfs-utils-2.3.1-r2.ebuild
20 new file mode 100644
21 index 00000000000..0155272e3f3
22 --- /dev/null
23 +++ b/net-fs/nfs-utils/nfs-utils-2.3.1-r2.ebuild
24 @@ -0,0 +1,185 @@
25 +# Copyright 1999-2017 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=6
29 +
30 +inherit autotools flag-o-matic multilib systemd
31 +
32 +DESCRIPTION="NFS client and server daemons"
33 +HOMEPAGE="http://linux-nfs.org/"
34 +
35 +if [[ "${PV}" = *_rc* ]] ; then
36 + inherit versionator
37 + MY_PV="$(replace_all_version_separators -)"
38 + SRC_URI="http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=snapshot;h=refs/tags/${PN}-${MY_PV};sf=tgz -> ${P}.tar.gz"
39 + S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
40 +else
41 + SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2"
42 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
43 +fi
44 +
45 +LICENSE="GPL-2"
46 +SLOT="0"
47 +IUSE="caps ipv6 kerberos ldap +libmount nfsdcld +nfsidmap +nfsv4 nfsv41 selinux tcpd +uuid"
48 +REQUIRED_USE="kerberos? ( nfsv4 )"
49 +RESTRICT="test" #315573
50 +
51 +# kth-krb doesn't provide the right include
52 +# files, and nfs-utils doesn't build against heimdal either,
53 +# so don't depend on virtual/krb.
54 +# (04 Feb 2005 agriffis)
55 +DEPEND_COMMON="
56 + net-libs/libtirpc:=
57 + >=net-nds/rpcbind-0.2.4
58 + sys-libs/e2fsprogs-libs
59 + caps? ( sys-libs/libcap )
60 + ldap? ( net-nds/openldap )
61 + libmount? ( sys-apps/util-linux )
62 + nfsdcld? ( >=dev-db/sqlite-3.3 )
63 + nfsv4? (
64 + dev-libs/libevent:=
65 + >=sys-apps/keyutils-1.5.9
66 + kerberos? (
67 + >=net-libs/libtirpc-0.2.4-r1[kerberos]
68 + app-crypt/mit-krb5
69 + )
70 + )
71 + nfsv41? (
72 + sys-fs/lvm2
73 + )
74 + tcpd? ( sys-apps/tcp-wrappers )
75 + uuid? ( sys-apps/util-linux )"
76 +RDEPEND="${DEPEND_COMMON}
77 + !net-libs/libnfsidmap
78 + !net-nds/portmap
79 + !<sys-apps/openrc-0.13.9
80 + selinux? (
81 + sec-policy/selinux-rpc
82 + sec-policy/selinux-rpcbind
83 + )
84 +"
85 +DEPEND="${DEPEND_COMMON}
86 + virtual/pkgconfig"
87 +
88 +PATCHES=(
89 + "${FILESDIR}"/${PN}-1.1.4-mtab-sym.patch
90 + "${FILESDIR}"/${PN}-1.2.8-cross-build.patch
91 + "${FILESDIR}"/${P}-svcgssd_undefined_reference.patch #641912
92 +)
93 +
94 +src_prepare() {
95 + default
96 +
97 + sed \
98 + -e "/^sbindir/s:= := \"${EPREFIX}\":g" \
99 + -i utils/*/Makefile.am || die
100 +
101 + eautoreconf
102 +}
103 +
104 +src_configure() {
105 + export libsqlite3_cv_is_recent=yes # Our DEPEND forces this.
106 + export ac_cv_header_keyutils_h=$(usex nfsidmap)
107 + local myeconfargs=(
108 + --with-statedir="${EPREFIX}"/var/lib/nfs
109 + --enable-tirpc
110 + --with-tirpcinclude="${EPREFIX}"/usr/include/tirpc/
111 + --with-pluginpath="${EPREFIX}"/usr/$(get_libdir)/libnfsidmap
112 + --with-systemd="$(systemd_get_systemunitdir)"
113 + $(use_enable libmount libmount-mount)
114 + $(use_with tcpd tcp-wrappers)
115 + $(use_enable nfsdcld nfsdcltrack)
116 + $(use_enable nfsv4)
117 + $(use_enable nfsv41)
118 + $(use_enable ipv6)
119 + $(use_enable caps)
120 + $(use_enable uuid)
121 + $(use_enable kerberos gss)
122 + $(use_enable kerberos svcgss)
123 + --without-gssglue
124 + )
125 + econf "${myeconfargs[@]}"
126 +}
127 +
128 +src_compile(){
129 + # remove compiled files bundled in the tarball
130 + emake clean
131 + default
132 +}
133 +
134 +src_install() {
135 + default
136 + rm linux-nfs/Makefile* || die
137 + dodoc -r linux-nfs README
138 +
139 + # Don't overwrite existing xtab/etab, install the original
140 + # versions somewhere safe... more info in pkg_postinst
141 + keepdir /var/lib/nfs/{,sm,sm.bak}
142 + mv "${ED%/}"/var/lib "${ED%/}"/usr/$(get_libdir) || die
143 +
144 + # Install some client-side binaries in /sbin
145 + dodir /sbin
146 + mv "${ED%/}"/usr/sbin/rpc.statd "${ED%/}"/sbin/ || die
147 +
148 + if use nfsv4 && use nfsidmap ; then
149 + # Install a config file for idmappers in newer kernels. #415625
150 + insinto /etc/request-key.d
151 + echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf
152 + doins id_resolver.conf
153 + fi
154 +
155 + insinto /etc
156 + doins "${FILESDIR}"/exports
157 + keepdir /etc/exports.d
158 +
159 + local f list=() opt_need=""
160 + if use nfsv4 ; then
161 + opt_need="rpc.idmapd"
162 + list+=( rpc.idmapd rpc.pipefs )
163 + use kerberos && list+=( rpc.gssd rpc.svcgssd )
164 + fi
165 + for f in nfs nfsclient rpc.statd "${list[@]}" ; do
166 + newinitd "${FILESDIR}"/${f}.initd ${f}
167 + done
168 + newinitd "${FILESDIR}"/nfsmount.initd-1.3.1 nfsmount # Nuke after 2015/08/01
169 + for f in nfs nfsclient ; do
170 + newconfd "${FILESDIR}"/${f}.confd ${f}
171 + done
172 + sed -i \
173 + -e "/^NFS_NEEDED_SERVICES=/s:=.*:=\"${opt_need}\":" \
174 + "${ED%/}"/etc/conf.d/nfs || die #234132
175 +
176 + local systemd_systemunitdir="$(systemd_get_systemunitdir)"
177 + sed -i \
178 + -e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \
179 + "${ED%/}${systemd_systemunitdir}"/* || die
180 +
181 + keepdir /var/lib/nfs #368505
182 + keepdir /var/lib/nfs/v4recovery #603628
183 +
184 +}
185 +
186 +pkg_postinst() {
187 + # Install default xtab and friends if there's none existing. In
188 + # src_install we put them in /usr/lib/nfs for safe-keeping, but
189 + # the daemons actually use the files in /var/lib/nfs. #30486
190 + local f
191 + for f in "${EROOT%/}"/usr/$(get_libdir)/nfs/*; do
192 + [[ -e ${EROOT%/}/var/lib/nfs/${f##*/} ]] && continue
193 + einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs"
194 + cp -pPR "${f}" "${EROOT%/}"/var/lib/nfs/
195 + done
196 +
197 + if systemd_is_booted; then
198 + if [[ ${REPLACING_VERSIONS} < 1.3.0 ]]; then
199 + ewarn "We have switched to upstream systemd unit files. Since"
200 + ewarn "they got renamed, you should probably enable the new ones."
201 + ewarn "You can run 'equery files nfs-utils | grep systemd'"
202 + ewarn "to know what services you need to enable now."
203 + fi
204 + else
205 + ewarn "If you use OpenRC, the nfsmount service has been replaced with nfsclient."
206 + ewarn "If you were using nfsmount, please add nfsclient and netmount to the"
207 + ewarn "same runlevel as nfsmount."
208 + fi
209 +}