blob: 28f98980d4b61b3bde760ac623f15e0e1542d4ff [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "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 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://nfsserver \
23 file://nfscommon \
24 file://nfs-utils.conf \
25 file://nfs-server.service \
26 file://nfs-mountd.service \
27 file://nfs-statd.service \
28 file://proc-fs-nfsd.mount \
29 file://nfs-utils-debianize-start-statd.patch \
30 file://bugfix-adjust-statd-service-name.patch \
31 file://nfs-utils-musl-limits.patch \
32 file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \
33 file://0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch \
34 file://clang-format-string.patch \
35 file://0001-Makefile.am-update-the-path-of-libnfs.a.patch \
36 file://0001-Makefile.am-fix-undefined-function-for-libnsm.a.patch \
37 file://0001-Don-t-build-tools-with-CC_FOR_BUILD.patch \
38"
39SRC_URI_append_libc-glibc = " file://0001-configure.ac-Do-not-fatalize-Wmissing-prototypes.patch"
40SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"
41
42SRC_URI[md5sum] = "b6c9c032995af1c08fea9fbcc1ce33e9"
43SRC_URI[sha256sum] = "f68b34793831b05f1fd5760d6bdec92772c7684177586a99a61e7b444f336322"
44
45# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
46# pull in the remainder of the dependencies.
47
48INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
49INITSCRIPT_NAME = "nfsserver"
50INITSCRIPT_PARAMS = "defaults"
51INITSCRIPT_NAME_${PN}-client = "nfscommon"
52INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
53
54inherit autotools-brokensep update-rc.d systemd pkgconfig
55
56SYSTEMD_PACKAGES = "${PN} ${PN}-client"
57SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
58SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
59
60# --enable-uuid is need for cross-compiling
61EXTRA_OECONF = "--with-statduser=rpcuser \
62 --enable-mountconfig \
63 --enable-libmount-mount \
64 --enable-uuid \
65 --disable-gss \
66 --disable-nfsdcltrack \
67 --with-statdpath=/var/lib/nfs/statd \
68 "
69
70CFLAGS += "-Wno-error=format-overflow"
71
72PACKAGECONFIG ??= "tcp-wrappers \
73 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
74"
75PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
76PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
77PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
78# libdevmapper is available in meta-oe
79PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper"
80# keyutils is available in meta-security
81PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils"
82
83PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats"
84
85CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
86 ${localstatedir}/lib/nfs/rmtab \
87 ${localstatedir}/lib/nfs/xtab \
88 ${localstatedir}/lib/nfs/statd/state \
89 ${sysconfdir}/nfsmount.conf"
90
91FILES_${PN}-client = "${sbindir}/*statd \
92 ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
93 ${sbindir}/showmount ${sbindir}/nfsstat \
94 ${localstatedir}/lib/nfs \
95 ${sysconfdir}/nfs-utils.conf \
96 ${sysconfdir}/nfsmount.conf \
97 ${sysconfdir}/init.d/nfscommon \
98 ${systemd_unitdir}/system/nfs-statd.service"
99RDEPENDS_${PN}-client = "${PN}-mount rpcbind"
100
101FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*"
102
103FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
104RDEPENDS_${PN}-stats = "python3-core"
105
106FILES_${PN} += "${systemd_unitdir}"
107
108do_configure_prepend() {
109 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
110 ${S}/utils/mount/Makefile.am
111
112 sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
113 ${S}/utils/osd_login/Makefile.am
114}
115
116# Make clean needed because the package comes with
117# precompiled 64-bit objects that break the build
118do_compile_prepend() {
119 make clean
120}
121
Brad Bishopc68388fc2019-08-26 01:33:31 -0400122# Works on systemd only
123HIGH_RLIMIT_NOFILE ??= "4096"
124
Brad Bishop19323692019-04-05 15:28:33 -0400125do_install_append () {
126 install -d ${D}${sysconfdir}/init.d
127 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
128 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
129
130 install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
131 install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
132
133 install -d ${D}${systemd_unitdir}/system
134 install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
135 install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
136 install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
137 sed -i -e 's,@SBINDIR@,${sbindir},g' \
138 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
Brad Bishopc68388fc2019-08-26 01:33:31 -0400139 -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \
Brad Bishop19323692019-04-05 15:28:33 -0400140 ${D}${systemd_unitdir}/system/*.service
141 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
142 install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
143 install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
144 ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
145 fi
146
147 # kernel code as of 3.8 hard-codes this path as a default
148 install -d ${D}/var/lib/nfs/v4recovery
149
150 # chown the directories and files
151 chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
152 chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
153
154 # Make python tools use python 3
155 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
156
157}