Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | SUMMARY = "Secure and configurable FTP server" |
| 2 | SECTION = "net" |
| 3 | HOMEPAGE = "http://www.proftpd.org" |
| 4 | LICENSE = "GPLv2+" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184" |
| 6 | |
| 7 | SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \ |
| 8 | file://basic.conf.patch \ |
| 9 | file://proftpd-basic.init \ |
| 10 | file://default \ |
| 11 | file://close-RequireValidShell-check.patch \ |
| 12 | file://contrib.patch \ |
| 13 | file://build_fixup.patch \ |
| 14 | file://proftpd.service \ |
| 15 | file://CVE-2016-3125.patch \ |
| 16 | " |
| 17 | |
| 18 | SRC_URI[md5sum] = "b9d3092411478415b31d435f8e26d173" |
| 19 | SRC_URI[sha256sum] = "a1f48df8539c414ec56e0cea63dcf4b8e16e606c05f10156f030a4a67fae5696" |
| 20 | |
| 21 | inherit autotools-brokensep useradd update-rc.d systemd |
| 22 | |
| 23 | PACKAGECONFIG ??= "sia shadow" |
| 24 | PACKAGECONFIG += " ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}" |
| 25 | PACKAGECONFIG += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" |
| 26 | |
| 27 | PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses, --disable-curses --disable-ncurses, ncurses" |
| 28 | PACKAGECONFIG[openssl] = "--enable-openssl, --disable-openssl, openssl, openssl" |
| 29 | PACKAGECONFIG[pam] = "--enable-auth-pam, --disable-auth-pam, libpam, libpam" |
| 30 | PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6" |
| 31 | PACKAGECONFIG[shadow] = "--enable-shadow, --disable-shadow" |
| 32 | PACKAGECONFIG[pcre] = "--enable-pcre, --disable-pcre, libpcre " |
| 33 | |
| 34 | # enable POSIX.1e capabilities |
| 35 | PACKAGECONFIG[cap] = "--enable-cap, --disable-cap, libcap, libcap" |
| 36 | |
| 37 | #enable support for POSIX ACLs |
| 38 | PACKAGECONFIG[acl] = "--enable-facl, --disable-facl" |
| 39 | |
| 40 | #enable proftpd controls via ftpdct |
| 41 | PACKAGECONFIG[ctrls] = "--enable-ctrls, --disable-crtls" |
| 42 | |
| 43 | #prevent proftpd from using its bundled getopt implementation. |
| 44 | PACKAGECONFIG[getopt] = "--with-getopt, --without-getopt" |
| 45 | |
| 46 | #do not strip debugging symbols from installed code |
| 47 | PACKAGECONFIG[strip] = "--enable-strip, --disable-strip" |
| 48 | |
| 49 | #enable SIA authentication support (Tru64) |
| 50 | PACKAGECONFIG[sia] = "--enable-sia, --disable-sia" |
| 51 | PACKAGECONFIG[sendfile] = "-enable-sendfile, --disable-sendfile" |
| 52 | |
| 53 | #enable Native Language Support (NLS) |
| 54 | PACKAGECONFIG[nls] = "--enable-nls, --disable-nls" |
| 55 | |
| 56 | #add mod_dso to core modules |
| 57 | PACKAGECONFIG[dso] = "--enable-dso, --disable-dso" |
| 58 | PACKAGECONFIG[largefile] = "--enable-largefile, --disable-largefile" |
| 59 | |
| 60 | #omit mod_auth_file from core modules |
| 61 | PACKAGECONFIG[auth] = "--enable-auth-file, --disable-auth-file" |
| 62 | |
| 63 | |
| 64 | # proftpd uses libltdl which currently makes configuring using |
| 65 | # autotools.bbclass a pain... |
| 66 | do_configure () { |
| 67 | oe_runconf |
| 68 | cp ${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool ${S}/libtool |
| 69 | } |
| 70 | |
| 71 | FTPUSER = "ftp" |
| 72 | FTPGROUP = "ftp" |
| 73 | |
| 74 | do_install () { |
| 75 | oe_runmake DESTDIR=${D} install |
| 76 | rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale |
| 77 | [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir} |
| 78 | sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf |
| 79 | sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf |
| 80 | install -d ${D}${sysconfdir}/init.d |
| 81 | install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd |
| 82 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd |
| 83 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd |
| 84 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd |
| 85 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd |
| 86 | |
| 87 | install -d ${D}${sysconfdir}/default |
| 88 | install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd |
| 89 | |
| 90 | # create the pub directory |
| 91 | mkdir -p ${D}/home/${FTPUSER}/pub/ |
| 92 | chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub |
| 93 | |
| 94 | install -d ${D}/${systemd_unitdir}/system |
| 95 | install -m 644 ${WORKDIR}/proftpd.service ${D}/${systemd_unitdir}/system |
| 96 | sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \ |
| 97 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
| 98 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 99 | -i ${D}${systemd_unitdir}/system/*.service |
| 100 | } |
| 101 | |
| 102 | INITSCRIPT_NAME = "proftpd" |
| 103 | INITSCRIPT_PARAM = "defaults 85 15" |
| 104 | |
| 105 | SYSTEMD_PACKAGES = "${PN}" |
| 106 | SYSTEMD_SERVICE_${PN} = "proftpd.service" |
| 107 | |
| 108 | USERADD_PACKAGES = "${PN}" |
| 109 | GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}" |
| 110 | USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \ |
| 111 | --shell /bin/false ${FTPUSER}" |
| 112 | |
| 113 | FILES_${PN} += "/home/${FTPUSER}" |
| 114 | |
| 115 | RDEPENDS_${PN} += "perl" |