board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / vsftpd / vsftpd.mk
blobfd923460643314810f556cc4dc50af6d5d9f2479
1 ################################################################################
3 # vsftpd
5 ################################################################################
7 VSFTPD_VERSION = 3.0.3
8 VSFTPD_SITE = https://security.appspot.com/downloads
9 VSFTPD_LIBS = -lcrypt
10 VSFTPD_LICENSE = GPLv2
11 VSFTPD_LICENSE_FILES = COPYING
13 define VSFTPD_DISABLE_UTMPX
14 $(SED) 's/.*VSF_BUILD_UTMPX/#undef VSF_BUILD_UTMPX/' $(@D)/builddefs.h
15 endef
17 define VSFTPD_ENABLE_SSL
18 $(SED) 's/.*VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(@D)/builddefs.h
19 endef
21 ifeq ($(BR2_PACKAGE_VSFTPD_UTMPX),)
22 VSFTPD_POST_CONFIGURE_HOOKS += VSFTPD_DISABLE_UTMPX
23 endif
25 ifeq ($(BR2_PACKAGE_OPENSSL),y)
26 VSFTPD_DEPENDENCIES += openssl host-pkgconf
27 VSFTPD_LIBS += `$(PKG_CONFIG_HOST_BINARY) --libs libssl libcrypto`
28 VSFTPD_POST_CONFIGURE_HOOKS += VSFTPD_ENABLE_SSL
29 endif
31 ifeq ($(BR2_PACKAGE_LIBCAP),y)
32 VSFTPD_DEPENDENCIES += libcap
33 VSFTPD_LIBS += -lcap
34 endif
36 ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
37 VSFTPD_DEPENDENCIES += linux-pam
38 VSFTPD_LIBS += -lpam
39 endif
41 define VSFTPD_BUILD_CMDS
42 $(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
43 LDFLAGS="$(TARGET_LDFLAGS)" LIBS="$(VSFTPD_LIBS)" -C $(@D)
44 endef
46 define VSFTPD_USERS
47 ftp -1 ftp -1 * /home/ftp - - Anonymous FTP User
48 endef
50 define VSFTPD_INSTALL_INIT_SYSV
51 $(INSTALL) -D -m 755 package/vsftpd/S70vsftpd $(TARGET_DIR)/etc/init.d/S70vsftpd
52 endef
54 # vsftpd won't work if the jail directory is writable, it has to be
55 # readable only otherwise you get the following error:
56 # 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
57 # That's why we have to adjust the permissions of /home/ftp
58 define VSFTPD_INSTALL_TARGET_CMDS
59 $(INSTALL) -D -m 755 $(@D)/vsftpd $(TARGET_DIR)/usr/sbin/vsftpd
60 test -f $(TARGET_DIR)/etc/vsftpd.conf || \
61 $(INSTALL) -D -m 644 $(@D)/vsftpd.conf \
62 $(TARGET_DIR)/etc/vsftpd.conf
63 $(INSTALL) -d -m 700 $(TARGET_DIR)/usr/share/empty
64 $(INSTALL) -d -m 555 $(TARGET_DIR)/home/ftp
65 endef
67 $(eval $(generic-package))