kumquat-buildroot/package/nfs-utils/nfs-utils.mk
Aurélien Chabot 9b19438c2c nfs-utils: systemd support
nfs-utils has been patched to install only the needed systemd unit files
supported.
Also tmpfiles was needed because the folder /run/nfs is a tmpfs
and nfs-utils need some files to be there to work correctly.

Signed-off-by: Aurélien Chabot <aurelien@chabot.fr>
[Maxime: Remove patches included originally in the patch as they have
have been merged upstream in v1.3.3]
Signed-off-by Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
[Thomas:
  - add comment in nfs-utils_env.sh to explain why an empty script is
    needed.
  - remove incorrect indentation.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-10-04 17:49:00 +01:00

84 lines
2.6 KiB
Makefile

################################################################################
#
# nfs-utils
#
################################################################################
NFS_UTILS_VERSION = 1.3.3
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 = GPLv2+
NFS_UTILS_LICENSE_FILES = COPYING
NFS_UTILS_AUTORECONF = YES
NFS_UTILS_DEPENDENCIES = host-pkgconf
NFS_UTILS_CONF_ENV = knfsd_cv_bsd_signals=no
NFS_UTILS_CONF_OPTS = \
--disable-nfsv4 \
--disable-nfsv41 \
--disable-gss \
--disable-uuid \
--disable-ipv6 \
--without-tcp-wrappers \
--with-statedir=/run/nfs \
--with-rpcgen=internal
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
ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
NFS_UTILS_CONF_OPTS += --enable-tirpc
NFS_UTILS_DEPENDENCIES += libtirpc
else
NFS_UTILS_CONF_OPTS += --disable-tirpc
endif
define NFS_UTILS_INSTALL_FIXUP
rm -f $(NFS_UTILS_TARGETS_)
touch $(TARGET_DIR)/etc/exports
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
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
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -fs ../../../../usr/lib/systemd/system/nfs-server.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nfs-server.service
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)
$(eval $(autotools-package))