blob: a2bebe0ba8d045490fee3201e271fdf2aea27415 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "userspace utilities for kernel nfs"
2DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
3NFS server and related tools."
4HOMEPAGE = "http://nfs.sourceforge.net/"
5SECTION = "console/network"
6
7LICENSE = "MIT & GPLv2+ & BSD"
8LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
9
10# util-linux for libblkid
11DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3 libtirpc"
12RDEPENDS_${PN}-client = "rpcbind bash"
13RDEPENDS_${PN} = "${PN}-client bash"
14RRECOMMENDS_${PN} = "kernel-module-nfsd"
15
16inherit useradd
17
18USERADD_PACKAGES = "${PN}-client"
19USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \
20 --shell /bin/false --user-group rpcuser"
21
22SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
23 file://0001-configure-Allow-to-explicitly-disable-nfsidmap.patch \
24 file://nfs-utils-1.2.3-sm-notify-res_init.patch \
25 file://nfsserver \
26 file://nfscommon \
27 file://nfs-utils.conf \
28 file://nfs-server.service \
29 file://nfs-mountd.service \
30 file://nfs-statd.service \
31 file://proc-fs-nfsd.mount \
32 file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
33 file://nfs-utils-debianize-start-statd.patch \
34 file://0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch \
35 file://bugfix-adjust-statd-service-name.patch \
Brad Bishop37a0e4d2017-12-04 01:01:44 -050036 file://fix-protocol-minor-version-fall-back.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050037"
38
39SRC_URI[md5sum] = "cd6b568c2e9301cc3bfac09d87fbbc0b"
40SRC_URI[sha256sum] = "700d689c5622c87953c34102e5befafc4d3c811e676852238f0dd79c9c0c084d"
41
42# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
43# pull in the remainder of the dependencies.
44
45INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
46INITSCRIPT_NAME = "nfsserver"
47INITSCRIPT_PARAMS = "defaults"
48INITSCRIPT_NAME_${PN}-client = "nfscommon"
49INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
50
51inherit autotools-brokensep update-rc.d systemd pkgconfig
52
53SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
54SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
55SYSTEMD_AUTO_ENABLE = "disable"
56
57# --enable-uuid is need for cross-compiling
58EXTRA_OECONF = "--with-statduser=rpcuser \
59 --enable-mountconfig \
60 --enable-libmount-mount \
61 --disable-nfsv41 \
62 --enable-uuid \
63 --disable-gss \
64 --disable-nfsdcltrack \
65 --with-statdpath=/var/lib/nfs/statd \
66 "
67
Patrick Williamsc0f7c042017-02-23 20:41:17 -060068PACKAGECONFIG ??= "tcp-wrappers \
69 ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
70"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050071PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
72PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
73PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060074PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050075
76INHIBIT_AUTO_STAGE = "1"
77
78PACKAGES =+ "${PN}-client ${PN}-stats"
79
80CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
81 ${localstatedir}/lib/nfs/rmtab \
82 ${localstatedir}/lib/nfs/xtab \
83 ${localstatedir}/lib/nfs/statd/state \
84 ${sysconfdir}/nfsmount.conf"
85
86FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \
87 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
88 ${sbindir}/showmount ${sbindir}/nfsstat \
89 ${localstatedir}/lib/nfs \
90 ${sysconfdir}/nfs-utils.conf \
91 ${sysconfdir}/nfsmount.conf \
92 ${sysconfdir}/init.d/nfscommon \
93 ${systemd_unitdir}/system/nfs-statd.service"
94FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060095RDEPENDS_${PN}-stats = "python3-core"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050096
97FILES_${PN} += "${systemd_unitdir}"
98
99do_configure_prepend() {
100 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
101 ${S}/utils/mount/Makefile.am
102
103 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
104 ${S}/utils/osd_login/Makefile.am
105}
106
107# Make clean needed because the package comes with
108# precompiled 64-bit objects that break the build
109do_compile_prepend() {
110 make clean
111}
112
113do_install_append () {
114 install -d ${D}${sysconfdir}/init.d
115 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
116 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
117
118 install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
119 install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
120
121 install -d ${D}${systemd_unitdir}/system
122 install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
123 install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
124 install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
125 sed -i -e 's,@SBINDIR@,${sbindir},g' \
126 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
127 ${D}${systemd_unitdir}/system/*.service
128 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
129 install -d ${D}${sysconfdir}/modules-load.d
130 echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf
131 install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
132 install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
133 ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
134 fi
135
136 # kernel code as of 3.8 hard-codes this path as a default
137 install -d ${D}/var/lib/nfs/v4recovery
138
139 # chown the directories and files
140 chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
141 chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
142
143 # the following are built by CC_FOR_BUILD
144 rm -f ${D}${sbindir}/rpcdebug
145 rm -f ${D}${sbindir}/rpcgen
146 rm -f ${D}${sbindir}/locktest
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600147
148 # Make python tools use python 3
149 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
150
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500151}