blob: 57d4984bd97a80e0b999f70aef67eacfbaf672d9 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "Secure and configurable FTP server"
2SECTION = "net"
3HOMEPAGE = "http://www.proftpd.org"
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184"
6
7SRC_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
18SRC_URI[md5sum] = "b9d3092411478415b31d435f8e26d173"
19SRC_URI[sha256sum] = "a1f48df8539c414ec56e0cea63dcf4b8e16e606c05f10156f030a4a67fae5696"
20
21inherit autotools-brokensep useradd update-rc.d systemd
22
23PACKAGECONFIG ??= "sia shadow"
24PACKAGECONFIG += " ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
25PACKAGECONFIG += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
26
27PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses, --disable-curses --disable-ncurses, ncurses"
28PACKAGECONFIG[openssl] = "--enable-openssl, --disable-openssl, openssl, openssl"
29PACKAGECONFIG[pam] = "--enable-auth-pam, --disable-auth-pam, libpam, libpam"
30PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6"
31PACKAGECONFIG[shadow] = "--enable-shadow, --disable-shadow"
32PACKAGECONFIG[pcre] = "--enable-pcre, --disable-pcre, libpcre "
33
34# enable POSIX.1e capabilities
35PACKAGECONFIG[cap] = "--enable-cap, --disable-cap, libcap, libcap"
36
37#enable support for POSIX ACLs
38PACKAGECONFIG[acl] = "--enable-facl, --disable-facl"
39
40#enable proftpd controls via ftpdct
41PACKAGECONFIG[ctrls] = "--enable-ctrls, --disable-crtls"
42
43#prevent proftpd from using its bundled getopt implementation.
44PACKAGECONFIG[getopt] = "--with-getopt, --without-getopt"
45
46#do not strip debugging symbols from installed code
47PACKAGECONFIG[strip] = "--enable-strip, --disable-strip"
48
49#enable SIA authentication support (Tru64)
50PACKAGECONFIG[sia] = "--enable-sia, --disable-sia"
51PACKAGECONFIG[sendfile] = "-enable-sendfile, --disable-sendfile"
52
53#enable Native Language Support (NLS)
54PACKAGECONFIG[nls] = "--enable-nls, --disable-nls"
55
56#add mod_dso to core modules
57PACKAGECONFIG[dso] = "--enable-dso, --disable-dso"
58PACKAGECONFIG[largefile] = "--enable-largefile, --disable-largefile"
59
60#omit mod_auth_file from core modules
61PACKAGECONFIG[auth] = "--enable-auth-file, --disable-auth-file"
62
63
64# proftpd uses libltdl which currently makes configuring using
65# autotools.bbclass a pain...
66do_configure () {
67 oe_runconf
68 cp ${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool ${S}/libtool
69}
70
71FTPUSER = "ftp"
72FTPGROUP = "ftp"
73
74do_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
102INITSCRIPT_NAME = "proftpd"
103INITSCRIPT_PARAM = "defaults 85 15"
104
105SYSTEMD_PACKAGES = "${PN}"
106SYSTEMD_SERVICE_${PN} = "proftpd.service"
107
108USERADD_PACKAGES = "${PN}"
109GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}"
110USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \
111 --shell /bin/false ${FTPUSER}"
112
113FILES_${PN} += "/home/${FTPUSER}"
114
115RDEPENDS_${PN} += "perl"