package/nbd: add option for the trdump utility
[buildroot-gz.git] / package / nfs-utils / nfs-utils.mk
blob179009dc5f0b6a5f2a877977d7b697193824ec16
1 ################################################################################
3 # nfs-utils
5 ################################################################################
7 NFS_UTILS_VERSION = 1.3.3
8 NFS_UTILS_SOURCE = nfs-utils-$(NFS_UTILS_VERSION).tar.xz
9 NFS_UTILS_SITE = https://www.kernel.org/pub/linux/utils/nfs-utils/$(NFS_UTILS_VERSION)
10 NFS_UTILS_LICENSE = GPLv2+
11 NFS_UTILS_LICENSE_FILES = COPYING
12 NFS_UTILS_AUTORECONF = YES
13 NFS_UTILS_DEPENDENCIES = host-pkgconf
15 NFS_UTILS_CONF_ENV = knfsd_cv_bsd_signals=no
17 NFS_UTILS_CONF_OPTS = \
18 --disable-nfsv4 \
19 --disable-nfsv41 \
20 --disable-gss \
21 --disable-uuid \
22 --disable-ipv6 \
23 --without-tcp-wrappers \
24 --with-statedir=/run/nfs \
25 --with-rpcgen=internal
27 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPCDEBUG) += usr/sbin/rpcdebug
28 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_LOCKD) += usr/sbin/rpc.lockd
29 NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD) += usr/sbin/rpc.rquotad
31 ifeq ($(BR2_PACKAGE_LIBCAP),y)
32 NFS_UTILS_CONF_OPTS += --enable-caps
33 NFS_UTILS_DEPENDENCIES += libcap
34 else
35 NFS_UTILS_CONF_OPTS += --disable-caps
36 endif
38 ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
39 NFS_UTILS_CONF_OPTS += --enable-tirpc
40 NFS_UTILS_DEPENDENCIES += libtirpc
41 else
42 NFS_UTILS_CONF_OPTS += --disable-tirpc
43 endif
45 define NFS_UTILS_INSTALL_FIXUP
46 rm -f $(NFS_UTILS_TARGETS_)
47 touch $(TARGET_DIR)/etc/exports
48 $(INSTALL) -D -m 644 \
49 $(@D)/utils/mount/nfsmount.conf $(TARGET_DIR)/etc/nfsmount.conf
50 endef
51 NFS_UTILS_POST_INSTALL_TARGET_HOOKS += NFS_UTILS_INSTALL_FIXUP
53 ifeq ($(BR2_INIT_SYSTEMD),y)
54 NFS_UTILS_CONF_OPTS += --with-systemd=/usr/lib/systemd/system
55 NFS_UTILS_DEPENDENCIES += systemd
56 else
57 NFS_UTILS_CONF_OPTS += --without-systemd
58 endif
60 define NFS_UTILS_INSTALL_INIT_SYSV
61 $(INSTALL) -D -m 0755 package/nfs-utils/S60nfs \
62 $(TARGET_DIR)/etc/init.d/S60nfs
63 endef
65 define NFS_UTILS_INSTALL_INIT_SYSTEMD
66 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
68 ln -fs ../../../../usr/lib/systemd/system/nfs-server.service \
69 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-server.service
70 ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
71 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-client.target
73 mkdir -p $(TARGET_DIR)/etc/systemd/system/remote-fs.target.wants
75 ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
76 $(TARGET_DIR)/etc/systemd/system/remote-fs.target.wants/nfs-client.target
78 $(INSTALL) -D -m 0755 package/nfs-utils/nfs-utils_env.sh \
79 $(TARGET_DIR)/usr/lib/systemd/scripts/nfs-utils_env.sh
81 $(INSTALL) -D -m 0644 package/nfs-utils/nfs-utils_tmpfiles.conf \
82 $(TARGET_DIR)/usr/lib/tmpfiles.d/nfs-utils.conf
83 endef
85 define NFS_UTILS_REMOVE_NFSIOSTAT
86 rm -f $(TARGET_DIR)/usr/sbin/nfsiostat
87 endef
89 # nfsiostat is interpreted python, so remove it unless it's in the target
90 NFS_UTILS_POST_INSTALL_TARGET_HOOKS += $(if $(BR2_PACKAGE_PYTHON),,NFS_UTILS_REMOVE_NFSIOSTAT)
92 $(eval $(autotools-package))