blob: 79453ad20cc7e126f00d782d39759a9a791064b5 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -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} = "${PN}-client bash"
13RRECOMMENDS_${PN} = "kernel-module-nfsd"
14
15inherit useradd
16
17USERADD_PACKAGES = "${PN}-client"
18USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \
19 --shell /bin/false --user-group rpcuser"
20
21SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
22 file://0001-configure-Allow-to-explicitly-disable-nfsidmap.patch \
23 file://nfs-utils-1.2.3-sm-notify-res_init.patch \
24 file://nfsserver \
25 file://nfscommon \
26 file://nfs-utils.conf \
27 file://nfs-server.service \
28 file://nfs-mountd.service \
29 file://nfs-statd.service \
30 file://proc-fs-nfsd.mount \
31 file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
32 file://nfs-utils-debianize-start-statd.patch \
33 file://bugfix-adjust-statd-service-name.patch \
34 file://0001-include-stdint.h-for-UINT16_MAX-definition.patch \
35"
36
37SRC_URI[md5sum] = "59dfcb2e6254b129f901f40c86086b13"
38SRC_URI[sha256sum] = "0faeb54c70b84e6bd3b9b6901544b1f6add8d246f35c1683e402daf4e0c719ef"
39
40# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
41# pull in the remainder of the dependencies.
42
43INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
44INITSCRIPT_NAME = "nfsserver"
45INITSCRIPT_PARAMS = "defaults"
46INITSCRIPT_NAME_${PN}-client = "nfscommon"
47INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
48
49inherit autotools-brokensep update-rc.d systemd pkgconfig
50
51SYSTEMD_PACKAGES = "${PN} ${PN}-client"
52SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
53SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
54
55# --enable-uuid is need for cross-compiling
56EXTRA_OECONF = "--with-statduser=rpcuser \
57 --enable-mountconfig \
58 --enable-libmount-mount \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050059 --enable-uuid \
60 --disable-gss \
61 --disable-nfsdcltrack \
62 --with-statdpath=/var/lib/nfs/statd \
63 "
64
65PACKAGECONFIG ??= "tcp-wrappers \
66 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
67"
68PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
69PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
70PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
71PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Brad Bishop316dfdd2018-06-25 12:45:53 -040072# libdevmapper is available in meta-oe
73PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050074
75PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats"
76
77CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
78 ${localstatedir}/lib/nfs/rmtab \
79 ${localstatedir}/lib/nfs/xtab \
80 ${localstatedir}/lib/nfs/statd/state \
81 ${sysconfdir}/nfsmount.conf"
82
83FILES_${PN}-client = "${sbindir}/*statd \
84 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
85 ${sbindir}/showmount ${sbindir}/nfsstat \
86 ${localstatedir}/lib/nfs \
87 ${sysconfdir}/nfs-utils.conf \
88 ${sysconfdir}/nfsmount.conf \
89 ${sysconfdir}/init.d/nfscommon \
90 ${systemd_unitdir}/system/nfs-statd.service"
91RDEPENDS_${PN}-client = "${PN}-mount rpcbind"
92
93FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*"
94
95FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
96RDEPENDS_${PN}-stats = "python3-core"
97
98FILES_${PN} += "${systemd_unitdir}"
99
100do_configure_prepend() {
101 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
102 ${S}/utils/mount/Makefile.am
103
104 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
105 ${S}/utils/osd_login/Makefile.am
106}
107
108# Make clean needed because the package comes with
109# precompiled 64-bit objects that break the build
110do_compile_prepend() {
111 make clean
112}
113
114do_install_append () {
115 install -d ${D}${sysconfdir}/init.d
116 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
117 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
118
119 install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
120 install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
121
122 install -d ${D}${systemd_unitdir}/system
123 install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
124 install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
125 install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
126 sed -i -e 's,@SBINDIR@,${sbindir},g' \
127 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
128 ${D}${systemd_unitdir}/system/*.service
129 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
130 install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
131 install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
132 ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
133 fi
134
135 # kernel code as of 3.8 hard-codes this path as a default
136 install -d ${D}/var/lib/nfs/v4recovery
137
138 # chown the directories and files
139 chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
140 chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
141
142 # the following are built by CC_FOR_BUILD
143 rm -f ${D}${sbindir}/rpcdebug
144 rm -f ${D}${sbindir}/rpcgen
145 rm -f ${D}${sbindir}/locktest
146
147 # Make python tools use python 3
148 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
149
150}