kumquat-buildroot/package/vsftpd/vsftpd.mk
Maarten ter Huurne 9840261050 vsftpd: Add build option to disable utmpx update code
This was modeled after a similar option for Dropbear.

The utmpx code is automatically disabled when compiling with musl,
to avoid a build error due to WTMPX_FILE being undefined. Note that
musl has an empty utmpx implementation, so no functionality is lost
by not calling it.

[Peter: use positive logic]
Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-12 09:32:15 +02:00

62 lines
1.7 KiB
Makefile

################################################################################
#
# vsftpd
#
################################################################################
VSFTPD_VERSION = 3.0.2
VSFTPD_SITE = https://security.appspot.com/downloads
VSFTPD_LIBS = -lcrypt
VSFTPD_LICENSE = GPLv2
VSFTPD_LICENSE_FILES = COPYING
define VSFTPD_DISABLE_UTMPX
$(SED) 's/.*VSF_BUILD_UTMPX/#undef VSF_BUILD_UTMPX/' $(@D)/builddefs.h
endef
define VSFTPD_ENABLE_SSL
$(SED) 's/.*VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(@D)/builddefs.h
endef
ifeq ($(BR2_PACKAGE_VSFTPD_UTMPX),)
VSFTPD_POST_CONFIGURE_HOOKS += VSFTPD_DISABLE_UTMPX
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
VSFTPD_DEPENDENCIES += openssl
VSFTPD_LIBS += -lssl -lcrypto
VSFTPD_POST_CONFIGURE_HOOKS += VSFTPD_ENABLE_SSL
endif
ifeq ($(BR2_PACKAGE_LIBCAP),y)
VSFTPD_DEPENDENCIES += libcap
VSFTPD_LIBS += -lcap
endif
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
VSFTPD_DEPENDENCIES += linux-pam
VSFTPD_LIBS += -lpam
endif
define VSFTPD_BUILD_CMDS
$(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" LIBS="$(VSFTPD_LIBS)" -C $(@D)
endef
define VSFTPD_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 755 $(@D)/vsftpd $(TARGET_DIR)/usr/sbin/vsftpd
$(INSTALL) -D -m 644 $(@D)/vsftpd.8 \
$(TARGET_DIR)/usr/share/man/man8/vsftpd.8
$(INSTALL) -D -m 644 $(@D)/vsftpd.conf.5 \
$(TARGET_DIR)/usr/share/man/man5/vsftpd.conf.5
test -f $(TARGET_DIR)/etc/init.d/S70vsftpd || \
$(INSTALL) -D -m 755 package/vsftpd/vsftpd-init \
$(TARGET_DIR)/etc/init.d/S70vsftpd
test -f $(TARGET_DIR)/etc/vsftpd.conf || \
$(INSTALL) -D -m 644 $(@D)/vsftpd.conf \
$(TARGET_DIR)/etc/vsftpd.conf
$(INSTALL) -d -m 700 $(TARGET_DIR)/usr/share/empty
endef
$(eval $(generic-package))