diff options
Diffstat (limited to 'meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb')
-rw-r--r-- | meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb new file mode 100644 index 000000000..e4d65eea6 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb | |||
@@ -0,0 +1,106 @@ | |||
1 | SUMMARY = "Very Secure FTP server" | ||
2 | HOMEPAGE = "https://security.appspot.com/vsftpd.html" | ||
3 | SECTION = "network" | ||
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 | " | ||
21 | |||
22 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ | ||
23 | file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \ | ||
24 | file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb" | ||
25 | SRC_URI[md5sum] = "8b00c749719089401315bd3c44dddbb2" | ||
26 | SRC_URI[sha256sum] = "be46f0e2c5528fe021fafc8dab1ecfea0c1f183063a06977f8537fcd0b195e56" | ||
27 | |||
28 | |||
29 | PACKAGECONFIG ??= "tcp-wrappers" | ||
30 | PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers" | ||
31 | SRC_URI +="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)}" | ||
32 | |||
33 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
34 | RDEPENDS_${PN} += "${@base_contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}" | ||
35 | PAMLIB = "${@base_contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}" | ||
36 | NOPAM_SRC ="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}" | ||
37 | SRC_URI += "${@base_contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)}" | ||
38 | |||
39 | inherit update-rc.d useradd systemd | ||
40 | |||
41 | CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf" | ||
42 | LDFLAGS_append =" -lcrypt -lcap" | ||
43 | |||
44 | do_configure() { | ||
45 | # Fix hardcoded /usr, /etc, /var mess. | ||
46 | cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \ | ||
47 | |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new | ||
48 | mv tunables.c.new tunables.c | ||
49 | } | ||
50 | |||
51 | do_compile() { | ||
52 | oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} -lwrap" | ||
53 | } | ||
54 | |||
55 | do_install() { | ||
56 | install -d ${D}${sbindir} | ||
57 | install -d ${D}${mandir}/man8 | ||
58 | install -d ${D}${mandir}/man5 | ||
59 | oe_runmake 'DESTDIR=${D}' install | ||
60 | install -d ${D}${sysconfdir} | ||
61 | install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf | ||
62 | install -d ${D}${sysconfdir}/init.d/ | ||
63 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd | ||
64 | install -d ${D}/${sysconfdir}/default/volatiles | ||
65 | install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd | ||
66 | |||
67 | install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/ | ||
68 | install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/ | ||
69 | if ! test -z "${PAMLIB}" ; then | ||
70 | install -d ${D}${sysconfdir}/pam.d/ | ||
71 | cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd | ||
72 | sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd | ||
73 | sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd | ||
74 | fi | ||
75 | if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
76 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
77 | echo "d /var/run/vsftpd/empty 0755 root root -" \ | ||
78 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf | ||
79 | fi | ||
80 | |||
81 | # Install systemd unit files | ||
82 | install -d ${D}${systemd_unitdir}/system | ||
83 | install -m 0644 ${WORKDIR}/vsftpd.service ${D}${systemd_unitdir}/system | ||
84 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/vsftpd.service | ||
85 | } | ||
86 | |||
87 | INITSCRIPT_PACKAGES = "${PN}" | ||
88 | INITSCRIPT_NAME_${PN} = "vsftpd" | ||
89 | INITSCRIPT_PARAMS_${PN} = "defaults 80" | ||
90 | |||
91 | USERADD_PACKAGES = "${PN}" | ||
92 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \ | ||
93 | --shell /bin/false ftp " | ||
94 | GROUPADD_PARAM_${PN} = "-r ftp" | ||
95 | |||
96 | SYSTEMD_SERVICE_${PN} = "vsftpd.service" | ||
97 | |||
98 | pkg_postinst_${PN}() { | ||
99 | if [ -z "$D" ]; then | ||
100 | if type systemd-tmpfiles >/dev/null; then | ||
101 | systemd-tmpfiles --create | ||
102 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
103 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
104 | fi | ||
105 | fi | ||
106 | } | ||