Changeset - 32aaf5b62b9c
[Not reviewed]
0 0 30
Chel Sea (chain) - 3 years ago 2021-06-11 19:55:13
chain@rpgfiction.net
add legacy net-fs/nfs-utils versions to tree
30 files changed with 1660 insertions and 0 deletions:
0 comments (0 inline, 0 general)
net-fs/nfs-utils/Manifest
Show inline comments
 
new file 100644
 
AUX exports 66 BLAKE2B 8ddc8e1b7888570cf7ce21ecebf0fb390ab394d25e60f1d914406396b23cb3cbf243a15a199f30608ac7e3c0abde73f48e0ccea605a3dadad654dfd8d6572dcd SHA512 fd8052dc8e17eccb0bb1443f341c97ec7c9dac5824294cadf486d91475bc728d4bb69300034b528a690707520590f6675ee371f92e9838afc8ed88092ee0f220
 
AUX nfs-utils-1.1.4-mtab-sym.patch 1020 BLAKE2B 6f1315a02a6070443fbd8cc943e382a02ac8ee99dbbc78f6b1b6c835548b80a78238ae4f7de18c7f02687df370bc58d628ed2bdbf216a41e80b5b589f1952c3c SHA512 1cd916028a8515772f05ef63832d73a09e9720055aedc9e2e4ce3a08ce1820948700a4f00ca9c4ee684880f18e67aca888dd857fc7931d923021ba50964be998
 
AUX nfs-utils-1.2.8-cross-build.patch 2112 BLAKE2B f1cd8457eeb869c5830b775b65bc2d0bc8bcc4ef832cb4fcc30366f7978271cbb9f9e92c7a25b2a392dd3b11690f10a87db09ce1c4d51d800eb231aeef5bc706 SHA512 d4b5cfa9f3a210aff09749aead376f698c5a8ba1cb7403eea95d52e423f4d5f039e9d6d6f6a1b0bff5439fff5048b7abd2c509a42cd8b977352c840876ccbf3c
 
AUX nfs-utils-2.3.2-junction_libs.patch 1487 BLAKE2B 5ecd4709fdcbc1c0885c91aea134ef5e5e00e6f58ace39d35d31b5de74d73bf05a4c27befc35f2c8a54d72452f63589c3a2912c3ef37752416389dd9537598e8 SHA512 d724ff25b7bbf03fc2c7d122bb338979ef50c59906a433ced5aa50e84030a375b2c268a05ee930c4f64ce58e938de7d30a9d0b5d3b7e660d8894013786d5bb4f
 
AUX nfs-utils-2.3.2-no-werror.patch 1375 BLAKE2B d494d00f81e236fd0531d4629108a4536415e3a6898b655f267b0125c0fd6b87cb567ef5cb7598fc19e68653572c1072566d7ef791fedb9f0c8d9ea663e67565 SHA512 acc3ccd6cf4afa73bbd253f6a1faa0349e6f8d50d57d9316fafa1faeb9f8ed5d5dfa60ec1b0a53339cd71af4d65b32d9595965ec435bc72eadcc86b8d187438b
 
AUX nfs-utils-2.3.4-no-werror.patch 1832 BLAKE2B 6e0f3da6a355c3b828bbaae3135c3a6c8bab29008cf160ca728ff5b72402f108221b4def304e9bf36f98310407bee9c26d828ab833bb7a9619fdaf609e66d06c SHA512 ce76f46c8dcef8b151040b9d198843746b6c20507c23a0dc511b3d3dec7681b3ac65c089de3f09d4e496ffa1bd011c034ce70198def374058a0805daf4ec8292
 
AUX nfs-utils-2.4.1-Fix-include-order-between-config.h-and-stat.h.patch 4020 BLAKE2B 9f9079879be7bbaaf7748d4c2e5711fdeacac8b389fdb48d7fdc1c781191dc283f2dc05c9aded7558eb0cf3801cf7eda7032d091592e45cb8eb47018a0ce5430 SHA512 36b80e0f1ef0826e25ee719980171f4d6215db246392e1dbceef6aab4f1fbe78e4e1222256dfb23232b7da1b5328a23050966f3608a10c8b70b2f75491603f31
 
AUX nfs-utils-2.4.1-gssd-Look-in-lib32-for-gss-libs-aswell.patch 1608 BLAKE2B 761eb16d6556b0df1029556453922925ccac7bdc88c4f769382afdf659dfccdd90aa6a183d317667c638e2d2d4d8fc080cfe49070c5fec5bb5f5dc2f66d2040e SHA512 cc4a7a7dde84854b52f57afe09bbff9e241712a19784febd0992b5b53b4b14905b6daf6620a8e9049fbda1dfe0a1619f322adc0517d9747466d7974d4c3eac06
 
AUX nfs-utils-2.4.1-statx.patch 976 BLAKE2B 22441e3a872603978ea6d397554de76be60addf04e115cc85b0899ed471446759010bcd30e77656082be9553cdb4454e0e384140034b87af1240f810a6f7a94c SHA512 8528282344a036ce8de2173cf370141d9dac93eae4616e39748dd07bb20592464479b53ac89e02159d65f1f7c2290410122c27e9f878bee07e950ac5f4b8d423
 
AUX nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch 2808 BLAKE2B 921a0e8e16d0490fb2217d8d2014770a59ff737e989bcc1424a540358b6af5e954d5c8cdf7b6096f128fc86c96a909ee68878a89b803819f57c3b6908443b7e2 SHA512 9150b778701a47bb86a98b6c1b2251d60f135794a212a9b03cb3b0f7830cb62ee466cce5f85dbee008aa476eac71e54bb3b0fca677d9dd5a31b09256d4892f48
 
AUX nfs-utils-2.4.2-mountd-Add-check-for-struct-file_handle.patch 1745 BLAKE2B f86feba7e005dc6766b66a15018c5b1e7c2bf192fcf41a4be6feef6ebfd56ee290b6a7fcb789ad32499ef2cb61343d84e9f248a031e949fe2a1288a059f81e47 SHA512 087c5923cb09616846629671721763d3600dd2c55b0f70fb0a7a9f60da884ed448dc1b338a0cf6245845053a8138b99132605a9abd0e90e3be9719ce37d7a0b3
 
AUX nfs-utils-2.4.2-mountd-Fix-compilation-for--disable-uuid.patch 1031 BLAKE2B eabcf55eada5f7dcc16a576cc49a1ed163d482906d1e0cbd6d42d18512374215455050bec38ce0e29c5b6516bed4113a476aeceea2f6ba229b8254e62905bdc3 SHA512 bf130ed8cce32849bd45957b5f4077e58fe6d98111f90746d628401b804bc9f13623aaca329967210a76e91ead254f3755906de313ad200f76bd52b835d79809
 
AUX nfs-utils-2.4.2-no-werror.patch 1866 BLAKE2B 6307f2dad086ea39b851085479a3503fd205946ee27ea693af996b2ff5cbbd642822afa18eba6598267914e0667f80cc84df64ad69689e2706d1121abace2f68 SHA512 861956a04ef5bcac9d9eb18e93e5257b0c35598a527f5b20e305ce6993532bc905e66610300b6c098433a81ee3eb08312b307f5cd276c530dcb4071429c0ffcc
 
AUX nfs-utils.conf 74 BLAKE2B 504c298c1e8e7eb596cd87813f1aeeac5cbc830bb85be9e26ed98f7ed85cdbd14ae2c47b0e111c912398ef28ef629e6de7e585a7b161624e9698ea208750fd9f SHA512 d72c0fbdf12cb1ddf8eaa5885e1ed93a2078c40ca48eb8868836fb72fa456c4865df15273fb7472f70dfe8098167e695b1340ff9a59b55e73b47690baaf977d6
 
AUX nfs.confd 930 BLAKE2B 4ef1662b31cffd78b0e96396ad74dc8b8135a9a18956fa1267639d2069893d4f218ded5809497b56d19a192e7e18408e1d1b56bd1535abed8db236bc1a1649cb SHA512 bc11b073735ee86c96b9c249ee187f4d16329c279a4e26760875059d2b5fa1d510ef3e4df5ee9dfb2a3133d755e1eb5c323d2fadc432a0cf630191ec353ac535
 
AUX nfs.initd 4013 BLAKE2B 3ccbafc56cb1aaf7b091ca5e895e71516a899177dbf5b74d3b8ecd7cb369ed2a3108cef8f76f6abc72272fbc1c692bc50a219025a9abc05d2ffb0e9caf2309d9 SHA512 2bfd641d1ff3b377aef81632ceba75e1e9aa0305d776ac8ca03217f253040ea3e6349d6d2d1815b91c5f6c90d076d6cb86294e41ecd19f31c288219620703ecc
 
AUX nfsclient.confd 592 BLAKE2B b661b726aa50f904752ec73a201a088f403a1e0f8d11181615e794da259a03b98131fff68e27645d4371564c796bb44915d6a13db9dc5a909294c4d1613c429d SHA512 f12e67728ac4e76357685e2fe38bd7f6fcd90064165758ffeca145e6962ac44d4ff9d8d57e18cc6925a6ada8e95ad8321e9fc355931a804dd455aae1e4850e92
 
AUX nfsclient.initd 752 BLAKE2B 8e3303be602ed97b9c6db0238b950039ec87830d733e7490f62657953e18d8050d5cd75e603d566b00db86ba910384d36e488d149112c86f1b9ed8e0901f5c16 SHA512 85078e2cd38b37a1e6fbaf0e40cf7690f403e71d9c8188d542d12fe56bfc02a49763c7bcc7742691754acc37928468c215db2795bebc29a5dfb052ba08f407bb
 
AUX nfsmount.confd 326 BLAKE2B c9506a71d28358d0ee7eef18985e3f65decd6cd2735cae17cef911129fe0531e2859c833ef75b04c1521c364c5aa1245d38a03191cb4167f6c1fa02383e7c091 SHA512 6e23897885cc33c49d9c7353b456585a1e0c7300822edba81bc48ba4ccc18297adce137260cc0aa9487aa5ef0aab3eecf931532cfa5bd40fd03bc9e0ddacfb28
 
AUX nfsmount.initd 1014 BLAKE2B 2a8f142c3932afa7867e2e85ed4497a45413a2abe602ac39a1897f912d2c24d4e80be3ed50602c5563eff05ce4476eba2f4e2442fce3deec34558533c26ff73b SHA512 89259b9f0878658d48792b5b2f42b43c966ed098dba1fecf9e07fb0de4aab37ad67655ea8dbcc2361ddab2b5013b2de35a03048a513aaeedf790e4b416a35a54
 
AUX nfsmount.initd-1.3.1 740 BLAKE2B 2668a3c485925f5b670efd11f357c5e0d616c1e1b62863c14b86e3201d5a5d61c1c4f4257b3b19ed8a8194879c67a9ddf996608073474e154f033be719b5ea54 SHA512 a540443a0259360f2476277bc020bb08eb095debe9c8e6a620dba5da1c7850f399673cc1ab505df65aea095a7e67954a9b5b8b26bbfd94e55d62348791af643d
 
AUX rpc.gssd.initd 455 BLAKE2B 9831c82341737d7877b01deebff82bfc49be59f8faabe4b5ee5542912b488460efd226f01e0bad5486faff5f37579ac15c8e8cf410a5eccd79d690c34f2beb4f SHA512 d9d7eeebbe153d3c4784112ed6d50734b5619b3315bb1454f8163de2b78ed8f958029a0e1088de58e9b1b8069184aeab2c8f19af4b957b6be25e4f138960aeac
 
AUX rpc.idmapd.initd 482 BLAKE2B db643d164787a730ed8f1da73cbc045237bb641fcdf297015e6651a4c683a075fdc29d037bc44a9832d45be87d41f37eb4e00ea37fdeed66038cf4a93d1a260f SHA512 f3e88038cb040ffcbca76166f4322d37e39da00d144bc0a17aed4467ab10c6e626fcde6c407d0911d135bfab55622ad2e38ed93788b11459c5882ce60577fb45
 
AUX rpc.pipefs.initd 760 BLAKE2B 4c05275e59d7d19d80779964a3631096258704cec2097f12d87232deecba5d74181f1713e18ebb01f5da9c3833037ba47566414f0b415608ad13e3fa97c8f1e6 SHA512 3d3fa6e7ae01e27d27d88aba1e307c5293dd1cbc9d555737e03c4f1e17988518f4f1e7f7a38a7337f8e8961e8378cc4611769b04db7368460589a3b218ac6d6b
 
AUX rpc.statd.initd 706 BLAKE2B 6c175729706d298307deea1d190703e67edb671a6b2c86216658fc89dafff1ae9f85a25b5386e4c89b86ca1b7b1fce7bb3045f944b7a1aee5b6544594d753cf8 SHA512 7f6baea852fff91b88e15e432ba19f9da0a3e3510b6f550b553912cf3887ce176280367b62bcce2a044730a075e4c1f6d7df1a669556d42725dea6e6e8e967ac
 
AUX rpc.svcgssd.initd 470 BLAKE2B c610a7abc44b86ca242d59f833ffa6e42f48d1c3bf93420988c6c6dfcd5cc4d8e02eaf2f3a86bb8bca7c8952e05017f887e6c4f4290085c41cc095a580e04235 SHA512 819cce4ae0a0f26bc74ce546e149b98420584240a594c9bb4a0a49413750320bde050866f3753c499425ea8d8df094211fb1f7e020ce281791e1933e1bc6a47f
 
DIST nfs-utils-2.3.2.tar.bz2 884068 BLAKE2B c4133cc12c5c1cd33346408e2d1286cf50880a89ec97cb8ce4453266ba5b145eb1ca7a4362ac1a91ea5c1ebddd4fcd1d6a4cd12f45637cd5d845cc6d8d5f139d SHA512 4b948d92f515e9340163f53ab26dd7189fa8b13909f5c668b7c66ae13f181ed778967edc0a20753763540b5a3f93a41a2de38a7276ffbfadfd866c5ed422520c
 
DIST nfs-utils-2.3.4.tar.bz2 906900 BLAKE2B 968fac7b37c7311bc8d29667c88db925aac0c062ed7ef8c13f9e5c11c3c88960ffaea56c1b6cfb5594a01238f9190e55ab7b837a79a7a804bc55dcca75908eea SHA512 25203b38be6683f25ad6583ac8534873c907124092a768955c1454899e2f467b9dd427b167556eb4f28992b5720da13078eb1eb086da991438454f268e1559a5
 
EBUILD nfs-utils-2.3.2.ebuild 5346 BLAKE2B fcf2e6f977ac80cf34433c1c46be5291e3b02c986215bc83acad00225e42e3201f01dde1a7eaaac270c9f6ec1058dc3ce8c95c77ed626ea3149be6579f72a856 SHA512 8ada0b5fe90cae49d99c0b02e2162585e7c681ee8e9a1da48e0656aa339bfad11b269a4a718cf7b25beae3ad781cac5f163265c09d3c76ecf408e61a18d6e889
 
EBUILD nfs-utils-2.3.4.ebuild 5224 BLAKE2B d3875920a72f2c943b65c07e29c5237af45acbf241de116ed9adc07757221950143fe3e962ccf2ec0ea072bc6839fce7813addb204f3223a22fa5191a3b36969 SHA512 f84a0609b65c511b00c4d859916311465d512048182d7d2388708d47232b3fb60e402a605480da337fde593a96190b0654c14637dfc157fd7350d1c5cd8590dd
 
MISC metadata.xml 932 BLAKE2B 14cb95a010cdb52373502bdad4de008234494be6e38f6b3fbf6b69e0848a6daa1315ed69b8eaadaad0cd546e84ba0e291b56ebf9db486b7c6e66011147b9a97c SHA512 eb45c97d7ed2bdaa8e43ce0a4fdb2f8a1d197bfd67a8b04f718c6083e7701873e2c22550700049edc25068daacb5278ca2535b63a02a10c1040efe0dbcef76a5
net-fs/nfs-utils/files/exports
Show inline comments
 
new file 100644
 
# /etc/exports: NFS file systems being exported.  See exports(5).
net-fs/nfs-utils/files/nfs-utils-1.1.4-mtab-sym.patch
Show inline comments
 
new file 100644
 
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+");
net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch
Show inline comments
 
new file 100644
 
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)
 

	
 
posted upstream:
 
https://marc.info/?l=linux-nfs&m=136416341629788&w=2
 
Date: Sun, 24 Mar 2013 22:21:08 +0000
 
Message-ID: 1364163668-15490-1-git-send-email-vapier@gentoo.org
 

	
 
From 269ae1346d9ccc97304205066d20e7e7b638f30e Mon Sep 17 00:00:00 2001
 
From: Mike Frysinger <vapier@gentoo.org>
 
Date: Sun, 24 Mar 2013 18:14:48 -0400
 
Subject: [PATCH nfs-utils] locktes/rpcgen: tweak how we override compiler settings
 

	
 
Newer autotools will use both CFLAGS and <target>_CFLAGS when compiling
 
the <target>.  Adding the build settings to the target-specific flags no
 
longer works as a way to compile build-time tools.
 

	
 
Instead, clobber the global flags.  This triggers an automake warning,
 
but the end result actually works (unlike the existing code).
 

	
 
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
 

	
 
--- 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
net-fs/nfs-utils/files/nfs-utils-2.3.2-junction_libs.patch
Show inline comments
 
new file 100644
 
From 8f3e4f4d6df9f813572051e12e974b35c26a1743 Mon Sep 17 00:00:00 2001
 
From: Lars Wendler <polynomial-c@gentoo.org>
 
Date: Mon, 28 May 2018 12:13:10 +0200
 
Subject: [PATCH] Fix undefined references and bad include when build with
 
 junction support
 

	
 
---
 
 support/junction/Makefile.am | 2 +-
 
 utils/nfsref/Makefile.am     | 6 +++---
 
 2 files changed, 4 insertions(+), 4 deletions(-)
 

	
 
diff --git a/support/junction/Makefile.am b/support/junction/Makefile.am
 
index 97e7426..89cb532 100644
 
--- a/support/junction/Makefile.am
 
+++ b/support/junction/Makefile.am
 
@@ -31,4 +31,4 @@ libjunction_la_SOURCES	= display.c export-cache.c junction.c \
 
 
 
 MAINTAINERCLEANFILES	= Makefile.in
 
 
 
-AM_CPPFLAGS		= -I. -I../include -I/usr/include/libxml2
 
+AM_CPPFLAGS		= -I. -I../include -I/usr/include/libxml2 @TIRPC_CFLAGS@
 
diff --git a/utils/nfsref/Makefile.am b/utils/nfsref/Makefile.am
 
index 2b2bb53..a652b03 100644
 
--- a/utils/nfsref/Makefile.am
 
+++ b/utils/nfsref/Makefile.am
 
@@ -27,13 +27,13 @@ noinst_HEADERS		= nfsref.h
 
 
 
 sbin_PROGRAMS		= nfsref
 
 nfsref_SOURCES		= add.c lookup.c nfsref.c remove.c
 
-LDADD			= $(LIBXML2) $(LIBCAP) \
 
-			  ../../support/nfs/libnfs.la \
 
+LIBS			+= $(LIBXML2) $(LIBCAP)
 
+LDADD			=  ../../support/nfs/libnfs.la \
 
 			  ../../support/junction/libjunction.la
 
 
 
 man8_MANS		= nfsref.man
 
 
 
 MAINTAINERCLEANFILES	= Makefile.in
 
 
 
-AM_CPPFLAGS		= -I. -I../../support/include
 
+AM_CPPFLAGS		= -I. -I../../support/include @TIRPC_CFLAGS@
 
 ##AM_LDFLAGS		= -Wl,--as-needed
 
-- 
 
2.17.0
 

	
net-fs/nfs-utils/files/nfs-utils-2.3.2-no-werror.patch
Show inline comments
 
new file 100644
 
https://bugs.gentoo.org/656984
 

	
 
Don't build with -Werror flags.
 

	
 
--- a/configure.ac
 
+++ b/configure.ac
 
@@ -544,45 +544,11 @@
 
 AC_SUBST(LDFLAGS_FOR_BUILD)
 
 
 
 my_am_cflags="\
 
- -pipe \
 
  -Wall \
 
  -Wextra \
 
- -Werror=strict-prototypes \
 
- -Werror=missing-prototypes \
 
- -Werror=missing-declarations \
 
- -Werror=format=2 \
 
- -Werror=undef \
 
- -Werror=missing-include-dirs \
 
- -Werror=strict-aliasing=2 \
 
- -Werror=init-self \
 
- -Werror=implicit-function-declaration \
 
- -Werror=return-type \
 
- -Werror=switch \
 
- -Werror=overflow \
 
- -Werror=parentheses \
 
- -Werror=aggregate-return \
 
- -Werror=unused-result \
 
  -fno-strict-aliasing \
 
 "
 
-
 
-AC_DEFUN([CHECK_CCSUPPORT], [
 
-  my_save_cflags="$CFLAGS"
 
-  CFLAGS=$1
 
-  AC_MSG_CHECKING([whether CC supports $1])
 
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
 
-    [AC_MSG_RESULT([yes])]
 
-    [$2+=$1],
 
-    [AC_MSG_RESULT([no])]
 
-  )
 
-  CFLAGS="$my_save_cflags"
 
-])
 
-
 
-CHECK_CCSUPPORT([-Werror=format-overflow=2], [flg1])
 
-CHECK_CCSUPPORT([-Werror=int-conversion], [flg2])
 
-CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3])
 
-CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4])
 
-
 
-AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4"])
 
+AC_SUBST([AM_CFLAGS], ["$my_am_cflags"])
 
 
 
 # Make sure that $ACLOCAL_FLAGS are used during a rebuild
 
 AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"])
net-fs/nfs-utils/files/nfs-utils-2.3.4-no-werror.patch
Show inline comments
 
new file 100644
 
From 04c9e3cc26dd330d9cb524c02de610c3bccd4b7b Mon Sep 17 00:00:00 2001
 
From: Mike Frysinger <vapier@gentoo.org>
 
Date: Sat, 11 May 2019 22:51:35 +0200
 
Subject: [PATCH] Don't build with -Werror flags
 

	
 
https://bugs.gentoo.org/656984
 

	
 
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
 
---
 
 configure.ac | 34 +---------------------------------
 
 1 file changed, 1 insertion(+), 33 deletions(-)
 

	
 
diff --git a/configure.ac b/configure.ac
 
index 4d70961..e6e709c 100644
 
--- a/configure.ac
 
+++ b/configure.ac
 
@@ -574,46 +574,14 @@ AC_SUBST(CPPFLAGS_FOR_BUILD)
 
 AC_SUBST(LDFLAGS_FOR_BUILD)
 
 
 
 my_am_cflags="\
 
- -pipe \
 
  -Wall \
 
  -Wextra \
 
  $rpcgen_cflags \
 
- -Werror=missing-prototypes \
 
- -Werror=missing-declarations \
 
- -Werror=format=2 \
 
- -Werror=undef \
 
- -Werror=missing-include-dirs \
 
- -Werror=strict-aliasing=2 \
 
- -Werror=init-self \
 
- -Werror=implicit-function-declaration \
 
- -Werror=return-type \
 
- -Werror=switch \
 
- -Werror=overflow \
 
- -Werror=parentheses \
 
- -Werror=aggregate-return \
 
- -Werror=unused-result \
 
  -Wno-cast-function-type \
 
  -fno-strict-aliasing \
 
 "
 
 
 
-AC_DEFUN([CHECK_CCSUPPORT], [
 
-  my_save_cflags="$CFLAGS"
 
-  CFLAGS=$1
 
-  AC_MSG_CHECKING([whether CC supports $1])
 
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
 
-    [AC_MSG_RESULT([yes])]
 
-    [$2+=$1],
 
-    [AC_MSG_RESULT([no])]
 
-  )
 
-  CFLAGS="$my_save_cflags"
 
-])
 
-
 
-CHECK_CCSUPPORT([-Werror=format-overflow=2], [flg1])
 
-CHECK_CCSUPPORT([-Werror=int-conversion], [flg2])
 
-CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3])
 
-CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4])
 
-
 
-AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4"])
 
+AC_SUBST([AM_CFLAGS], ["$my_am_cflags"])
 
 
 
 # Make sure that $ACLOCAL_FLAGS are used during a rebuild
 
 AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"])
 
-- 
 
2.21.0
 

	
net-fs/nfs-utils/files/nfs-utils-2.4.1-Fix-include-order-between-config.h-and-stat.h.patch
Show inline comments
 
new file 100644
 
From 2fbc62e2a13fc22b6ae4910e295a2c10fb790486 Mon Sep 17 00:00:00 2001
 
From: Zoltan Karcagi <zkr7432@gmail.com>
 
Date: Mon, 12 Aug 2019 13:27:16 -0400
 
Subject: [PATCH] Fix include order between config.h and stat.h
 

	
 
At least on Arch linux ARM, the definition of struct stat in stat.h depends
 
on __USE_FILE_OFFSET64. This symbol comes from config.h when defined,
 
therefore config.h must always be included before stat.h. Fix all
 
occurrences where the order is wrong by moving config.h to the top.
 

	
 
This fixes the client side error "Stale file handle" when mounting from
 
a server running Arch Linux ARM.
 

	
 
Signed-off-by: Zoltan Karcagi <zkr7432@gmail.com>
 
Signed-off-by: Steve Dickson <steved@redhat.com>
 
---
 
 support/misc/nfsd_path.c         | 5 ++++-
 
 support/misc/xstat.c             | 5 ++++-
 
 support/nfs/conffile.c           | 8 +++++++-
 
 utils/blkmapd/device-discovery.c | 8 ++++----
 
 utils/idmapd/idmapd.c            | 8 ++++----
 
 5 files changed, 23 insertions(+), 11 deletions(-)
 

	
 
diff --git a/support/misc/nfsd_path.c b/support/misc/nfsd_path.c
 
index 84e48028..f078a668 100644
 
--- a/support/misc/nfsd_path.c
 
+++ b/support/misc/nfsd_path.c
 
@@ -1,3 +1,7 @@
 
+#ifdef HAVE_CONFIG_H
 
+#include <config.h>
 
+#endif
 
+
 
 #include <errno.h>
 
 #include <sys/types.h>
 
 #include <sys/stat.h>
 
@@ -5,7 +9,6 @@
 
 #include <stdlib.h>
 
 #include <unistd.h>
 
 
 
-#include "config.h"
 
 #include "conffile.h"
 
 #include "xmalloc.h"
 
 #include "xlog.h"
 
diff --git a/support/misc/xstat.c b/support/misc/xstat.c
 
index fa047880..4c997eea 100644
 
--- a/support/misc/xstat.c
 
+++ b/support/misc/xstat.c
 
@@ -1,3 +1,7 @@
 
+#ifdef HAVE_CONFIG_H
 
+#include <config.h>
 
+#endif
 
+
 
 #include <errno.h>
 
 #include <sys/types.h>
 
 #include <fcntl.h>
 
@@ -5,7 +9,6 @@
 
 #include <sys/sysmacros.h>
 
 #include <unistd.h>
 
 
 
-#include "config.h"
 
 #include "xstat.h"
 
 
 
 #ifdef HAVE_FSTATAT
 
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
 
index b6400bec..6ba8a35c 100644
 
--- a/support/nfs/conffile.c
 
+++ b/support/nfs/conffile.c
 
@@ -500,7 +500,7 @@ conf_readfile(const char *path)
 
 
 
 	if ((stat (path, &sb) == 0) || (errno != ENOENT)) {
 
 		char *new_conf_addr = NULL;
 
-		size_t sz = sb.st_size;
 
+		off_t sz;
 
 		int fd = open (path, O_RDONLY, 0);
 
 
 
 		if (fd == -1) {
 
@@ -517,6 +517,11 @@ conf_readfile(const char *path)
 
 
 
 		/* only after we have the lock, check the file size ready to read it */
 
 		sz = lseek(fd, 0, SEEK_END);
 
+		if (sz < 0) {
 
+			xlog_warn("conf_readfile: unable to determine file size: %s",
 
+				  strerror(errno));
 
+			goto fail;
 
+		}
 
 		lseek(fd, 0, SEEK_SET);
 
 
 
 		new_conf_addr = malloc(sz+1);
 
@@ -2162,6 +2167,7 @@ conf_write(const char *filename, const char *section, const char *arg,
 
 	ret = 0;
 
 
 
 cleanup:
 
+	flush_outqueue(&inqueue, NULL);
 
 	flush_outqueue(&outqueue, NULL);
 
 
 
 	if (buff)
 
diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c
 
index e811703d..f5f9b10b 100644
 
--- a/utils/blkmapd/device-discovery.c
 
+++ b/utils/blkmapd/device-discovery.c
 
@@ -26,6 +26,10 @@
 
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
  */
 
 
 
+#ifdef HAVE_CONFIG_H
 
+#include "config.h"
 
+#endif /* HAVE_CONFIG_H */
 
+
 
 #include <sys/sysmacros.h>
 
 #include <sys/types.h>
 
 #include <sys/stat.h>
 
@@ -51,10 +55,6 @@
 
 #include <errno.h>
 
 #include <libdevmapper.h>
 
 
 
-#ifdef HAVE_CONFIG_H
 
-#include "config.h"
 
-#endif /* HAVE_CONFIG_H */
 
-
 
 #include "device-discovery.h"
 
 #include "xcommon.h"
 
 #include "nfslib.h"
 
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
 
index 62e37b8a..267acea5 100644
 
--- a/utils/idmapd/idmapd.c
 
+++ b/utils/idmapd/idmapd.c
 
@@ -34,6 +34,10 @@
 
  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
  */
 
 
 
+#ifdef HAVE_CONFIG_H
 
+#include "config.h"
 
+#endif /* HAVE_CONFIG_H */
 
+
 
 #include <sys/types.h>
 
 #include <sys/time.h>
 
 #include <sys/inotify.h>
 
@@ -62,10 +66,6 @@
 
 #include <libgen.h>
 
 #include <nfsidmap.h>
 
 
 
-#ifdef HAVE_CONFIG_H
 
-#include "config.h"
 
-#endif /* HAVE_CONFIG_H */
 
-
 
 #include "xlog.h"
 
 #include "conffile.h"
 
 #include "queue.h"
 
-- 
 
2.21.0
 

	
net-fs/nfs-utils/files/nfs-utils-2.4.1-gssd-Look-in-lib32-for-gss-libs-aswell.patch
Show inline comments
 
new file 100644
 
From e2244412ae8b0b04446063ff6e8a1d0ebebe55a8 Mon Sep 17 00:00:00 2001
 
From: Matt Turner <mattst88@gmail.com>
 
Date: Sun, 11 Aug 2019 14:50:01 -0700
 
Subject: [PATCH] gssd: Look in lib32 for gss libs aswell.
 

	
 
Akin to commit da999b81b058 ("Look in lib64 for gss libs aswell.")
 

	
 
mips/n32 systems have libraries in lib32 (but not lib or lib64). Without
 
checking lib32, configure fails with
 

	
 
checking for Kerberos v5... configure: error: Kerberos v5 with GSS
 
         support not found: consider --disable-gss or --with-krb5=
 

	
 
Signed-off-by: Matt Turner <mattst88@gmail.com>
 
---
 
 aclocal/kerberos5.m4 | 6 ++++--
 
 1 file changed, 4 insertions(+), 2 deletions(-)
 

	
 
diff --git a/aclocal/kerberos5.m4 b/aclocal/kerberos5.m4
 
index 8a0f3e4c..faa58049 100644
 
--- a/aclocal/kerberos5.m4
 
+++ b/aclocal/kerberos5.m4
 
@@ -38,9 +38,11 @@ AC_DEFUN([AC_KERBEROS_V5],[
 
       AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
 
       if test -f $dir/include/gssapi/gssapi_krb5.h -a \
 
                 \( -f $dir/lib/libgssapi_krb5.a -o \
 
+                   -f $dir/lib/libgssapi_krb5.so -o \
 
+                   -f $dir/lib32/libgssapi_krb5.a -o \
 
+                   -f $dir/lib32/libgssapi_krb5.so -o \
 
                    -f $dir/lib64/libgssapi_krb5.a -o \
 
-                   -f $dir/lib64/libgssapi_krb5.so -o \
 
-                   -f $dir/lib/libgssapi_krb5.so \) ; then
 
+                   -f $dir/lib64/libgssapi_krb5.so \) ; then
 
          AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries])
 
          KRBDIR="$dir"
 
          gssapi_lib=gssapi_krb5
 
-- 
 
2.21.0
 

	
net-fs/nfs-utils/files/nfs-utils-2.4.1-statx.patch
Show inline comments
 
new file 100644
 
From c8953944c5d34095d42f604f911022fbe144918c Mon Sep 17 00:00:00 2001
 
From: Andreas Steinmetz <ast@domdv.de>
 
Date: Wed, 30 Oct 2019 16:57:00 +0100
 
Subject: [PATCH] Old kernels don't know statx calls and return EINVAL
 

	
 
On a system with glibc-2.29 and kernel 4.9.128 nfs v3 mount fails as
 
statx() with mask=STATX_BASIC_STATS returns EINVAL, probably from
 
glibc, as strace of rpc.mountd shows no system call.
 

	
 
Fixes: https://bugs.gentoo.org/688644
 
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
 
---
 
 support/misc/xstat.c | 2 ++
 
 1 file changed, 2 insertions(+)
 

	
 
diff --git a/support/misc/xstat.c b/support/misc/xstat.c
 
index fa047880..6aca6e29 100644
 
--- a/support/misc/xstat.c
 
+++ b/support/misc/xstat.c
 
@@ -47,6 +47,8 @@ statx_do_stat(int fd, const char *pathname, struct stat *statbuf, int flags)
 
 			statx_copy(statbuf, &stxbuf);
 
 			return 0;
 
 		}
 
+		if (errno == EINVAL)
 
+			errno = ENOSYS;
 
 		if (errno == ENOSYS)
 
 			statx_supported = 0;
 
 	} else
 
-- 
 
2.24.0.rc1
 

	
net-fs/nfs-utils/files/nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch
Show inline comments
 
new file 100644
 
From 1378280398ef9f5cd45f5542ae2945b9a360b132 Mon Sep 17 00:00:00 2001
 
From: Doug Nazar <nazard@nazar.ca>
 
Date: Sun, 17 Nov 2019 14:31:33 -0500
 
Subject: [PATCH] Ensure consistent struct stat definition
 

	
 
Although 2fbc62e2a13fc ("Fix include order between config.h and stat.h")
 
reorganized those files that were already including config.h, not all
 
files were including config.h.
 

	
 
Fixes at least stack smashing crashes in mountd on 32-bit systems.
 

	
 
Signed-off-by: Doug Nazar <nazard@nazar.ca>
 
Signed-off-by: Steve Dickson <steved@redhat.com>
 
---
 
 support/junction/junction.c | 4 ++++
 
 support/misc/file.c         | 4 ++++
 
 support/misc/mountpoint.c   | 4 ++++
 
 support/nfs/cacheio.c       | 4 ++++
 
 utils/mount/fstab.c         | 4 ++++
 
 utils/nfsdcld/legacy.c      | 4 ++++
 
 6 files changed, 24 insertions(+)
 

	
 
diff --git a/support/junction/junction.c b/support/junction/junction.c
 
index ab6caa6..41cce26 100644
 
--- a/support/junction/junction.c
 
+++ b/support/junction/junction.c
 
@@ -23,6 +23,10 @@
 
  *	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
 
  */
 
 
 
+#ifdef HAVE_CONFIG_H
 
+#include <config.h>
 
+#endif
 
+
 
 #include <sys/types.h>
 
 #include <sys/stat.h>
 
 
 
diff --git a/support/misc/file.c b/support/misc/file.c
 
index e7c3819..06f6bb2 100644
 
--- a/support/misc/file.c
 
+++ b/support/misc/file.c
 
@@ -18,6 +18,10 @@
 
  * along with nfs-utils.  If not, see <http://www.gnu.org/licenses/>.
 
  */
 
 
 
+#ifdef HAVE_CONFIG_H
 
+#include <config.h>
 
+#endif
 
+
 
 #include <sys/stat.h>
 
 
 
 #include <string.h>
 
diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c
 
index c6217f2..14d6731 100644
 
--- a/support/misc/mountpoint.c
 
+++ b/support/misc/mountpoint.c
 
@@ -3,6 +3,10 @@
 
  * check if a given path is a mountpoint 
 
  */
 
 
 
+#ifdef HAVE_CONFIG_H
 
+#include <config.h>
 
+#endif
 
+
 
 #include <string.h>
 
 #include "xcommon.h"
 
 #include <sys/stat.h>
 
diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c
 
index 9dc4cf1..7c4cf37 100644
 
--- a/support/nfs/cacheio.c
 
+++ b/support/nfs/cacheio.c
 
@@ -15,6 +15,10 @@
 
  *
 
  */
 
 
 
+#ifdef HAVE_CONFIG_H
 
+#include <config.h>
 
+#endif
 
+
 
 #include <nfslib.h>
 
 #include <stdio.h>
 
 #include <stdio_ext.h>
 
diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c
 
index eedbdda..8b0aaf1 100644
 
--- a/utils/mount/fstab.c
 
+++ b/utils/mount/fstab.c
 
@@ -7,6 +7,10 @@
 
  * - Moved code to nfs-utils/support/nfs from util-linux/mount.
 
  */
 
 
 
+#ifdef HAVE_CONFIG_H
 
+#include <config.h>
 
+#endif
 
+
 
 #include <errno.h>
 
 #include <stdio.h>
 
 #include <fcntl.h>
 
diff --git a/utils/nfsdcld/legacy.c b/utils/nfsdcld/legacy.c
 
index 07f477a..3c6bea6 100644
 
--- a/utils/nfsdcld/legacy.c
 
+++ b/utils/nfsdcld/legacy.c
 
@@ -15,6 +15,10 @@
 
  * Boston, MA 02110-1301, USA.
 
  */
 
 
 
+#ifdef HAVE_CONFIG_H
 
+#include <config.h>
 
+#endif
 
+
 
 #include <stdio.h>
 
 #include <dirent.h>
 
 #include <string.h>
 
-- 
 
1.8.3.1
 

	
net-fs/nfs-utils/files/nfs-utils-2.4.2-mountd-Add-check-for-struct-file_handle.patch
Show inline comments
 
new file 100644
 
From f100d07d923b5db60d42dc2453485fa0dba69a79 Mon Sep 17 00:00:00 2001
 
From: Petr Vorel <petr.vorel@gmail.com>
 
Date: Mon, 18 Nov 2019 08:58:36 -0500
 
Subject: [PATCH] mountd: Add check for 'struct file_handle'
 

	
 
From: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
 

	
 
The code to check if name_to_handle_at() is implemented generates only a
 
warning but with some toolchain it doesn't fail to link (the function must be
 
implemented somewhere).
 
However the "struct file_handle" type is not available.
 

	
 
So, this patch adds a check for this struct.
 

	
 
Patch taken from buildroot distribution.
 

	
 
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 
[ pvorel: rebased from nfs-utils-1-3-4 ]
 
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
 
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
 
Signed-off-by: Steve Dickson <steved@redhat.com>
 
---
 
 configure.ac         | 1 +
 
 utils/mountd/cache.c | 2 +-
 
 2 files changed, 2 insertions(+), 1 deletion(-)
 

	
 
diff --git a/configure.ac b/configure.ac
 
index 9ba9d4b..949ff9f 100644
 
--- a/configure.ac
 
+++ b/configure.ac
 
@@ -510,6 +510,7 @@ AC_TYPE_PID_T
 
 AC_TYPE_SIZE_T
 
 AC_HEADER_TIME
 
 AC_STRUCT_TM
 
+AC_CHECK_TYPES([struct file_handle])
 
 
 
 dnl *************************************************************
 
 dnl Check for functions
 
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
 
index 3861f84..31e9507 100644
 
--- a/utils/mountd/cache.c
 
+++ b/utils/mountd/cache.c
 
@@ -446,7 +446,7 @@ static int same_path(char *child, char *parent, int len)
 
 	if (count_slashes(p) != count_slashes(parent))
 
 		return 0;
 
 
 
-#if HAVE_NAME_TO_HANDLE_AT
 
+#if defined(HAVE_NAME_TO_HANDLE_AT) && defined(HAVE_STRUCT_FILE_HANDLE)
 
 	struct {
 
 		struct file_handle fh;
 
 		unsigned char handle[128];
 
-- 
 
1.8.3.1
 

	
net-fs/nfs-utils/files/nfs-utils-2.4.2-mountd-Fix-compilation-for--disable-uuid.patch
Show inline comments
 
new file 100644
 
From 31bb484b22c220c561f3a95c3b7ca3ea9b96cc9b Mon Sep 17 00:00:00 2001
 
From: Petr Vorel <petr.vorel@gmail.com>
 
Date: Mon, 18 Nov 2019 11:27:19 -0500
 
Subject: [PATCH] mountd: Fix compilation for --disable-uuid
 

	
 
Although code in configure.ac pretends to set USE_BLKID as 0
 
via AC_DEFINE_UNQUOTED, it's actually not defined
 
support/include/config.h.in
 
support/include/config.h
 
/* #undef USE_BLKID */
 

	
 
Fixes: 8e643554 ("Allow disabling of libblkid usage.")
 

	
 
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
 
Signed-off-by: Steve Dickson <steved@redhat.com>
 
---
 
 utils/mountd/cache.c | 2 +-
 
 1 file changed, 1 insertion(+), 1 deletion(-)
 

	
 
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
 
index 31e9507..e5186c7 100644
 
--- a/utils/mountd/cache.c
 
+++ b/utils/mountd/cache.c
 
@@ -221,7 +221,7 @@ static void auth_unix_gid(int f)
 
 		xlog(L_ERROR, "auth_unix_gid: error writing reply");
 
 }
 
 
 
-#if USE_BLKID
 
+#ifdef USE_BLKID
 
 static const char *get_uuid_blkdev(char *path)
 
 {
 
 	/* We set *safe if we know that we need the
 
-- 
 
1.8.3.1
 

	
net-fs/nfs-utils/files/nfs-utils-2.4.2-no-werror.patch
Show inline comments
 
new file 100644
 
From b7df6ae89846104b99f46336592b928a5421c3d8 Mon Sep 17 00:00:00 2001
 
From: Mike Frysinger <vapier@gentoo.org>
 
Date: Sat, 16 Nov 2019 12:04:48 +0100
 
Subject: [PATCH] Don't build with -Werror flags
 

	
 
https://bugs.gentoo.org/656984
 

	
 
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
 
---
 
 configure.ac | 33 +--------------------------------
 
 1 file changed, 1 insertion(+), 32 deletions(-)
 

	
 
diff --git a/configure.ac b/configure.ac
 
index 9ba9d4b5..26663264 100644
 
--- a/configure.ac
 
+++ b/configure.ac
 
@@ -581,47 +581,16 @@ AC_SUBST(CPPFLAGS_FOR_BUILD)
 
 AC_SUBST(LDFLAGS_FOR_BUILD)
 
 
 
 my_am_cflags="\
 
- -pipe \
 
  -Wall \
 
  -Wextra \
 
  $rpcgen_cflags \
 
- -Werror=missing-prototypes \
 
- -Werror=missing-declarations \
 
- -Werror=format=2 \
 
- -Werror=undef \
 
- -Werror=missing-include-dirs \
 
- -Werror=strict-aliasing=2 \
 
- -Werror=init-self \
 
- -Werror=implicit-function-declaration \
 
- -Werror=return-type \
 
- -Werror=switch \
 
- -Werror=overflow \
 
- -Werror=parentheses \
 
- -Werror=aggregate-return \
 
- -Werror=unused-result \
 
  -Wno-cast-function-type \
 
  -fno-strict-aliasing \
 
 "
 
 
 
-AC_DEFUN([CHECK_CCSUPPORT], [
 
-  my_save_cflags="$CFLAGS"
 
-  CFLAGS=$1
 
-  AC_MSG_CHECKING([whether CC supports $1])
 
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
 
-    [AC_MSG_RESULT([yes])]
 
-    [$2+=$1],
 
-    [AC_MSG_RESULT([no])]
 
-  )
 
-  CFLAGS="$my_save_cflags"
 
-])
 
-
 
-CHECK_CCSUPPORT([-Werror=format-overflow=2], [flg1])
 
-CHECK_CCSUPPORT([-Werror=int-conversion], [flg2])
 
-CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3])
 
-CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4])
 
 AX_GCC_FUNC_ATTRIBUTE([format])
 
 
 
-AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4"])
 
+AC_SUBST([AM_CFLAGS], ["$my_am_cflags"])
 
 
 
 # Make sure that $ACLOCAL_FLAGS are used during a rebuild
 
 AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"])
 
-- 
 
2.24.0
 

	
net-fs/nfs-utils/files/nfs-utils.conf
Show inline comments
 
new file 100644
 
d /var/lib/nfs/rpc_pipefs
 
d /var/lib/nfs/v4recovery
 
d /var/lib/nfs/v4root
net-fs/nfs-utils/files/nfs.confd
Show inline comments
 
new file 100644
 
# /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"
net-fs/nfs-utils/files/nfs.initd
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2014 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
extra_started_commands="reload"
 

	
 
# 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 [ "${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() {
 
	svc_stop
 
	svc_start
 
}
net-fs/nfs-utils/files/nfsclient.confd
Show inline comments
 
new file 100644
 
# 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"
net-fs/nfs-utils/files/nfsclient.initd
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2015 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
[ -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
 
}
net-fs/nfs-utils/files/nfsmount.confd
Show inline comments
 
new file 100644
 
# 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"
net-fs/nfs-utils/files/nfsmount.initd
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2013 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
[ -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 $?
 
}
net-fs/nfs-utils/files/nfsmount.initd-1.3.1
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2015 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
# 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
 
}
net-fs/nfs-utils/files/rpc.gssd.initd
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2008 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
[ -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 $?
 
}
net-fs/nfs-utils/files/rpc.idmapd.initd
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2008 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
[ -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 $?
 
}
net-fs/nfs-utils/files/rpc.pipefs.initd
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2014 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
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 $?
 
}
net-fs/nfs-utils/files/rpc.statd.initd
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2015 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
[ -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 $?
 
}
net-fs/nfs-utils/files/rpc.svcgssd.initd
Show inline comments
 
new file 100644
 
#!/sbin/openrc-run
 
# Copyright 1999-2008 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
[ -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 $?
 
}
net-fs/nfs-utils/metadata.xml
Show inline comments
 
new file 100644
 
<?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 
<pkgmetadata>
 
  <maintainer type="project">
 
    <email>base-system@gentoo.org</email>
 
    <name>Gentoo Base System</name>
 
  </maintainer>
 
  <longdescription>NFS client and server daemons</longdescription>
 
  <use>
 
    <flag name="junction">Enable NFS junction support in nfsref</flag>
 
    <flag name="ldap">Add ldap support</flag>
 
    <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>
net-fs/nfs-utils/nfs-utils-2.3.2.ebuild
Show inline comments
 
new file 100644
 
# Copyright 1999-2018 Gentoo Foundation
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
EAPI=6
 

	
 
inherit autotools flag-o-matic multilib systemd
 

	
 
DESCRIPTION="NFS client and server daemons"
 
HOMEPAGE="http://linux-nfs.org/"
 

	
 
if [[ "${PV}" = *_rc* ]] ; then
 
	inherit versionator
 
	MY_PV="$(replace_all_version_separators -)"
 
	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"
 
	S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
 
else
 
	SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2"
 
	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
 
fi
 

	
 
LICENSE="GPL-2"
 
SLOT="0"
 
IUSE="caps ipv6 junction kerberos ldap +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="
 
	net-libs/libtirpc:=
 
	>=net-nds/rpcbind-0.2.4
 
	sys-libs/e2fsprogs-libs
 
	caps? ( sys-libs/libcap )
 
	ldap? ( net-nds/openldap )
 
	libmount? ( sys-apps/util-linux )
 
	nfsdcld? ( >=dev-db/sqlite-3.3 )
 
	nfsv4? (
 
		dev-libs/libevent:=
 
		>=sys-apps/keyutils-1.5.9
 
		kerberos? (
 
			>=net-libs/libtirpc-0.2.4-r1[kerberos]
 
			app-crypt/mit-krb5
 
		)
 
	)
 
	nfsv41? (
 
		sys-fs/lvm2
 
	)
 
	tcpd? ( sys-apps/tcp-wrappers )
 
	uuid? ( sys-apps/util-linux )"
 
RDEPEND="${DEPEND_COMMON}
 
	!net-libs/libnfsidmap
 
	!net-nds/portmap
 
	!<sys-apps/openrc-0.13.9
 
	selinux? (
 
		sec-policy/selinux-rpc
 
		sec-policy/selinux-rpcbind
 
	)
 
"
 
DEPEND="${DEPEND_COMMON}
 
	dev-libs/libxml2
 
	virtual/pkgconfig"
 

	
 
PATCHES=(
 
	"${FILESDIR}"/${PN}-1.1.4-mtab-sym.patch
 
	"${FILESDIR}"/${PN}-1.2.8-cross-build.patch
 
	"${FILESDIR}"/${PN}-2.3.2-junction_libs.patch
 
	"${FILESDIR}"/${PN}-2.3.2-no-werror.patch
 
)
 

	
 
src_prepare() {
 
	default
 

	
 
	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)
 
	local myeconfargs=(
 
		--with-statedir="${EPREFIX%/}"/var/lib/nfs
 
		--enable-tirpc
 
		--with-tirpcinclude="${EPREFIX%/}"/usr/include/tirpc/
 
		--with-pluginpath="${EPREFIX%/}"/usr/$(get_libdir)/libnfsidmap
 
		--with-systemd="$(systemd_get_systemunitdir)"
 
		--without-gssglue
 
		$(use_enable caps)
 
		$(use_enable ipv6)
 
		$(use_enable junction)
 
		$(use_enable kerberos gss)
 
		$(use_enable kerberos svcgss)
 
		$(use_enable ldap)
 
		$(use_enable libmount libmount-mount)
 
		$(use_enable nfsdcld nfsdcltrack)
 
		$(use_enable nfsv4)
 
		$(use_enable nfsv41)
 
		$(use_enable uuid)
 
		$(use_with tcpd tcp-wrappers)
 
	)
 
	econf "${myeconfargs[@]}"
 
}
 

	
 
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/nfs "${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
 

	
 
	local systemd_systemunitdir="$(systemd_get_systemunitdir)"
 
	sed -i \
 
		-e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \
 
		"${ED%/}${systemd_systemunitdir}"/* || die
 

	
 
	keepdir /var/lib/nfs #368505
 
	keepdir /var/lib/nfs/v4recovery #603628
 

	
 
}
 

	
 
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
 
	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
 
}
net-fs/nfs-utils/nfs-utils-2.3.4.ebuild
Show inline comments
 
new file 100644
 
# Copyright 1999-2020 Gentoo Authors
 
# Distributed under the terms of the GNU General Public License v2
 

	
 
EAPI=7
 

	
 
inherit autotools flag-o-matic multilib systemd
 

	
 
DESCRIPTION="NFS client and server daemons"
 
HOMEPAGE="http://linux-nfs.org/"
 

	
 
if [[ "${PV}" = *_rc* ]] ; then
 
	MY_PV="$(ver_rs 1- -)"
 
	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"
 
	S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
 
else
 
	SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2"
 
	KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86"
 
fi
 

	
 
LICENSE="GPL-2"
 
SLOT="0"
 
IUSE="caps ipv6 junction kerberos ldap +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="
 
	>=dev-db/sqlite-3.3
 
	dev-libs/libxml2
 
	net-libs/libtirpc:=
 
	>=net-nds/rpcbind-0.2.4
 
	sys-libs/e2fsprogs-libs
 
	caps? ( sys-libs/libcap )
 
	ldap? ( net-nds/openldap )
 
	libmount? ( sys-apps/util-linux )
 
	nfsv4? (
 
		dev-libs/libevent:=
 
		>=sys-apps/keyutils-1.5.9
 
		kerberos? (
 
			>=net-libs/libtirpc-0.2.4-r1[kerberos]
 
			app-crypt/mit-krb5
 
		)
 
	)
 
	nfsv41? (
 
		sys-fs/lvm2
 
	)
 
	tcpd? ( sys-apps/tcp-wrappers )
 
	uuid? ( sys-apps/util-linux )"
 
RDEPEND="${DEPEND}
 
	!net-libs/libnfsidmap
 
	!net-nds/portmap
 
	!<sys-apps/openrc-0.13.9
 
	selinux? (
 
		sec-policy/selinux-rpc
 
		sec-policy/selinux-rpcbind
 
	)
 
"
 
BDEPEND="
 
	virtual/pkgconfig
 
"
 

	
 
PATCHES=(
 
	"${FILESDIR}"/${PN}-1.1.4-mtab-sym.patch
 
	"${FILESDIR}"/${PN}-1.2.8-cross-build.patch
 
	"${FILESDIR}"/${PN}-2.3.4-no-werror.patch
 
)
 

	
 
src_prepare() {
 
	default
 

	
 
	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)
 
	local myeconfargs=(
 
		--with-statedir="${EPREFIX}"/var/lib/nfs
 
		--enable-tirpc
 
		--with-tirpcinclude="${EPREFIX}"/usr/include/tirpc/
 
		--with-pluginpath="${EPREFIX}"/usr/$(get_libdir)/libnfsidmap
 
		--with-systemd="$(systemd_get_systemunitdir)"
 
		--without-gssglue
 
		$(use_enable caps)
 
		$(use_enable ipv6)
 
		$(use_enable junction)
 
		$(use_enable kerberos gss)
 
		$(use_enable kerberos svcgss)
 
		$(use_enable ldap)
 
		$(use_enable libmount libmount-mount)
 
		$(use_enable nfsdcld nfsdcltrack)
 
		$(use_enable nfsv4)
 
		$(use_enable nfsv41)
 
		$(use_enable uuid)
 
		$(use_with tcpd tcp-wrappers)
 
	)
 
	econf "${myeconfargs[@]}"
 
}
 

	
 
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/nfs "${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
 

	
 
	local systemd_systemunitdir="$(systemd_get_systemunitdir)"
 
	sed -i \
 
		-e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \
 
		"${ED}${systemd_systemunitdir}"/* || die
 

	
 
	keepdir /var/lib/nfs #368505
 
	keepdir /var/lib/nfs/v4recovery #603628
 

	
 
}
 

	
 
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
 
	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
 
		for v in ${REPLACING_VERSIONS}; do
 
			if ver_test "${v}" -lt 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
 
		done
 
	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
 
}
0 comments (0 inline, 0 general)