Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | SUMMARY = "Very Secure FTP server" |
| 2 | HOMEPAGE = "https://security.appspot.com/vsftpd.html" |
| 3 | SECTION = "net" |
| 4 | LICENSE = "GPLv2" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271" |
| 6 | |
| 7 | DEPENDS = "libcap openssl" |
| 8 | |
| 9 | SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \ |
| 10 | file://makefile-destdir.patch \ |
| 11 | file://makefile-libs.patch \ |
| 12 | file://makefile-strip.patch \ |
| 13 | file://init \ |
| 14 | file://vsftpd.conf \ |
| 15 | file://vsftpd.user_list \ |
| 16 | file://vsftpd.ftpusers \ |
| 17 | file://change-secure_chroot_dir.patch \ |
| 18 | file://volatiles.99_vsftpd \ |
| 19 | file://vsftpd.service \ |
| 20 | file://vsftpd-2.1.0-filter.patch \ |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 21 | file://0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 22 | ${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)} \ |
| 23 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)} \ |
| 24 | file://0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch \ |
| 25 | " |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 26 | |
| 27 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ |
| 28 | file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \ |
| 29 | file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb" |
| 30 | SRC_URI[md5sum] = "da119d084bd3f98664636ea05b5bb398" |
| 31 | SRC_URI[sha256sum] = "9d4d2bf6e6e2884852ba4e69e157a2cecd68c5a7635d66a3a8cf8d898c955ef7" |
| 32 | |
| 33 | |
| 34 | PACKAGECONFIG ??= "tcp-wrappers" |
| 35 | PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 36 | |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 37 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" |
| 38 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}" |
| 39 | PAMLIB = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 40 | WRAPLIB = "${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', '-lwrap', '', d)}" |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 41 | NOPAM_SRC ="${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 42 | |
| 43 | inherit update-rc.d useradd systemd |
| 44 | |
| 45 | CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf" |
| 46 | LDFLAGS_append =" -lcrypt -lcap" |
| 47 | |
| 48 | EXTRA_OEMAKE = "-e MAKEFLAGS=" |
| 49 | |
| 50 | do_configure() { |
| 51 | # Fix hardcoded /usr, /etc, /var mess. |
| 52 | cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \ |
| 53 | |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new |
| 54 | mv tunables.c.new tunables.c |
| 55 | } |
| 56 | |
| 57 | do_compile() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 58 | oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} ${WRAPLIB}" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | do_install() { |
| 62 | install -d ${D}${sbindir} |
| 63 | install -d ${D}${mandir}/man8 |
| 64 | install -d ${D}${mandir}/man5 |
| 65 | oe_runmake 'DESTDIR=${D}' install |
| 66 | install -d ${D}${sysconfdir} |
| 67 | install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf |
| 68 | install -d ${D}${sysconfdir}/init.d/ |
| 69 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd |
| 70 | install -d ${D}/${sysconfdir}/default/volatiles |
| 71 | install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd |
| 72 | |
| 73 | install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/ |
| 74 | install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/ |
| 75 | if ! test -z "${PAMLIB}" ; then |
| 76 | install -d ${D}${sysconfdir}/pam.d/ |
| 77 | cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd |
| 78 | sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd |
| 79 | sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd |
| 80 | fi |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 81 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 82 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 83 | echo "d /var/run/vsftpd/empty 0755 root root -" \ |
| 84 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf |
| 85 | fi |
| 86 | |
| 87 | # Install systemd unit files |
| 88 | install -d ${D}${systemd_unitdir}/system |
| 89 | install -m 0644 ${WORKDIR}/vsftpd.service ${D}${systemd_unitdir}/system |
| 90 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/vsftpd.service |
| 91 | } |
| 92 | |
| 93 | INITSCRIPT_PACKAGES = "${PN}" |
| 94 | INITSCRIPT_NAME_${PN} = "vsftpd" |
| 95 | INITSCRIPT_PARAMS_${PN} = "defaults 80" |
| 96 | |
| 97 | USERADD_PACKAGES = "${PN}" |
| 98 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \ |
| 99 | --shell /bin/false ftp " |
| 100 | GROUPADD_PARAM_${PN} = "-r ftp" |
| 101 | |
| 102 | SYSTEMD_SERVICE_${PN} = "vsftpd.service" |
| 103 | |
| 104 | pkg_postinst_${PN}() { |
| 105 | if [ -z "$D" ]; then |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 106 | if type systemd-tmpfiles >/dev/null; then |
| 107 | systemd-tmpfiles --create |
| 108 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then |
| 109 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 110 | fi |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 111 | fi |
| 112 | } |