kumquat-buildroot/package/nfs-utils/nfs-utils.mk
Carlos Santos 749334cb36 package/nfs-utils: always use libtirpc and enable IPv6
nfs-utils selects rpcbind, and rpcbind unconditionally selects
libtirpc. Therefore, nfs-utils will never be used with the C library
RPC implementation: libtirpc will always be used. Consequently, all
the conditional logic to use libtirpc only if available is useless,
and we can use libtirpc unconditionally.

As an added bonus, this means that we can enable IPv6, because
libtirpc provides an IPv6-compatible RPC implementation.

Fixes: https://bugs.busybox.net/show_bug.cgi?id=10806

Signed-off-by: Carlos Santos <unixmania@gmail.com>
[Thomas: rework commit log]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-09-12 19:10:33 +02:00

119 lines
3.6 KiB
Makefile

################################################################################
#
# nfs-utils
#
################################################################################
NFS_UTILS_VERSION = 1.3.4
NFS_UTILS_SOURCE = nfs-utils-$(NFS_UTILS_VERSION).tar.xz
NFS_UTILS_SITE = https://www.kernel.org/pub/linux/utils/nfs-utils/$(NFS_UTILS_VERSION)
NFS_UTILS_LICENSE = GPL-2.0+
NFS_UTILS_LICENSE_FILES = COPYING
NFS_UTILS_AUTORECONF = YES
NFS_UTILS_DEPENDENCIES = host-pkgconf libtirpc
NFS_UTILS_CONF_ENV = knfsd_cv_bsd_signals=no
NFS_UTILS_CONF_OPTS = \
--disable-nfsv4 \
--disable-nfsv41 \
--disable-gss \
--disable-uuid \
--enable-tirpc \
--enable-ipv6 \
--without-tcp-wrappers \
--with-statedir=/run/nfs \
--with-rpcgen=internal
HOST_NFS_UTILS_CONF_OPTS = \
--disable-nfsv4 \
--disable-nfsv41 \
--disable-gss \
--disable-uuid \
--disable-ipv6 \
--without-tcp-wrappers \
--with-statedir=/run/nfs \
--disable-caps \
--disable-tirpc \
--without-systemd \
--with-rpcgen=internal
HOST_NFS_UTILS_DEPENDENCIES = host-pkgconf host-libtirpc
NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPCDEBUG) += usr/sbin/rpcdebug
NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_LOCKD) += usr/sbin/rpc.lockd
NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_RQUOTAD) += usr/sbin/rpc.rquotad
NFS_UTILS_TARGETS_$(BR2_PACKAGE_NFS_UTILS_RPC_NFSD) += usr/sbin/exportfs \
usr/sbin/rpc.mountd usr/sbin/rpc.nfsd usr/lib/systemd/system/nfs-server.service
ifeq ($(BR2_PACKAGE_LIBCAP),y)
NFS_UTILS_CONF_OPTS += --enable-caps
NFS_UTILS_DEPENDENCIES += libcap
else
NFS_UTILS_CONF_OPTS += --disable-caps
endif
define NFS_UTILS_INSTALL_FIXUP
cd $(TARGET_DIR) && rm -f $(NFS_UTILS_TARGETS_)
touch $(TARGET_DIR)/etc/exports
$(INSTALL) -D -m 644 \
$(@D)/utils/mount/nfsmount.conf $(TARGET_DIR)/etc/nfsmount.conf
endef
NFS_UTILS_POST_INSTALL_TARGET_HOOKS += NFS_UTILS_INSTALL_FIXUP
ifeq ($(BR2_INIT_SYSTEMD),y)
NFS_UTILS_CONF_OPTS += --with-systemd=/usr/lib/systemd/system
NFS_UTILS_DEPENDENCIES += systemd
else
NFS_UTILS_CONF_OPTS += --without-systemd
endif
ifeq ($(BR2_PACKAGE_NFS_UTILS_RPC_NFSD),y)
define NFS_UTILS_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/nfs-utils/S60nfs \
$(TARGET_DIR)/etc/init.d/S60nfs
endef
define NFS_UTILS_INSTALL_INIT_SYSTEMD_NFSD
ln -fs ../../../../usr/lib/systemd/system/nfs-server.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-server.service
endef
endif
define NFS_UTILS_INSTALL_INIT_SYSTEMD
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
$(NFS_UTILS_INSTALL_INIT_SYSTEMD_NFSD)
ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-client.target
mkdir -p $(TARGET_DIR)/etc/systemd/system/remote-fs.target.wants
ln -fs ../../../../usr/lib/systemd/system/nfs-client.target \
$(TARGET_DIR)/etc/systemd/system/remote-fs.target.wants/nfs-client.target
$(INSTALL) -D -m 0755 package/nfs-utils/nfs-utils_env.sh \
$(TARGET_DIR)/usr/lib/systemd/scripts/nfs-utils_env.sh
$(INSTALL) -D -m 0644 package/nfs-utils/nfs-utils_tmpfiles.conf \
$(TARGET_DIR)/usr/lib/tmpfiles.d/nfs-utils.conf
endef
define NFS_UTILS_REMOVE_NFSIOSTAT
rm -f $(TARGET_DIR)/usr/sbin/nfsiostat
endef
# nfsiostat is interpreted python, so remove it unless it's in the target
NFS_UTILS_POST_INSTALL_TARGET_HOOKS += $(if $(BR2_PACKAGE_PYTHON),,NFS_UTILS_REMOVE_NFSIOSTAT)
define HOST_NFS_UTILS_BUILD_CMDS
$(MAKE) -C $(@D)/tools/rpcgen
endef
define HOST_NFS_UTILS_INSTALL_CMDS
$(INSTALL) -D -m 0755 $(@D)/tools/rpcgen/rpcgen $(HOST_DIR)/bin/rpcgen
endef
$(eval $(autotools-package))
$(eval $(host-autotools-package))