blob: cdebd24af1c46e8b9bd1b36c47a57c98bf9c0878 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SUMMARY = "Secure and configurable FTP server"
2SECTION = "net"
3HOMEPAGE = "http://www.proftpd.org"
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184"
6
Andrew Geisslerf103a7f2021-05-07 16:09:40 -05007SRCREV = "715eadc1aa4f6b07d69f9d09558e9cb471e51d87"
8BRANCH = "1.3.7"
9
Andrew Geissler595f6302022-01-24 19:11:47 +000010SRC_URI = "git://github.com/proftpd/proftpd.git;branch=${BRANCH};protocol=https \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050011 file://basic.conf.patch \
12 file://proftpd-basic.init \
13 file://default \
14 file://close-RequireValidShell-check.patch \
15 file://contrib.patch \
16 file://build_fixup.patch \
17 file://proftpd.service \
18 "
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050019
20S = "${WORKDIR}/git"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050021
Andrew Geissler82c905d2020-04-13 13:39:40 -050022inherit autotools-brokensep useradd update-rc.d systemd multilib_script
Brad Bishopd7bf8c12018-02-25 22:55:05 -050023
24PACKAGECONFIG ??= "shadow \
25 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050026 static \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027 "
28
29PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses, --disable-curses --disable-ncurses, ncurses"
30PACKAGECONFIG[openssl] = "--enable-openssl, --disable-openssl, openssl, openssl"
31PACKAGECONFIG[pam] = "--enable-auth-pam, --disable-auth-pam, libpam, libpam"
32PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6"
33PACKAGECONFIG[shadow] = "--enable-shadow, --disable-shadow"
34PACKAGECONFIG[pcre] = "--enable-pcre, --disable-pcre, libpcre "
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050035PACKAGECONFIG[static] = "--enable-static=yes, --enable-static=no"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050036
37# enable POSIX.1e capabilities
38PACKAGECONFIG[cap] = "--enable-cap, --disable-cap, libcap, libcap"
39
40#enable support for POSIX ACLs
41PACKAGECONFIG[acl] = "--enable-facl, --disable-facl"
42
43#enable proftpd controls via ftpdct
44PACKAGECONFIG[ctrls] = "--enable-ctrls, --disable-crtls"
45
46#prevent proftpd from using its bundled getopt implementation.
47PACKAGECONFIG[getopt] = "--with-getopt, --without-getopt"
48
49#do not strip debugging symbols from installed code
50PACKAGECONFIG[strip] = "--enable-strip, --disable-strip"
51
52#enable SIA authentication support (Tru64)
53PACKAGECONFIG[sia] = "--enable-sia, --disable-sia"
54PACKAGECONFIG[sendfile] = "-enable-sendfile, --disable-sendfile"
55
56#enable Native Language Support (NLS)
57PACKAGECONFIG[nls] = "--enable-nls, --disable-nls"
58
59#add mod_dso to core modules
60PACKAGECONFIG[dso] = "--enable-dso, --disable-dso"
61PACKAGECONFIG[largefile] = "--enable-largefile, --disable-largefile"
62
63#omit mod_auth_file from core modules
64PACKAGECONFIG[auth] = "--enable-auth-file, --disable-auth-file"
65
Brad Bishopd7bf8c12018-02-25 22:55:05 -050066# proftpd uses libltdl which currently makes configuring using
67# autotools.bbclass a pain...
68do_configure () {
69 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
70 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
71 oe_runconf
Brad Bishopd7bf8c12018-02-25 22:55:05 -050072}
73
74FTPUSER = "ftp"
75FTPGROUP = "ftp"
76
77do_install () {
78 oe_runmake DESTDIR=${D} install
79 rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale
80 [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir}
81 sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf
82 sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf
83 install -d ${D}${sysconfdir}/init.d
84 install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd
85 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd
86 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd
87 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd
88 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd
89
90 install -d ${D}${sysconfdir}/default
91 install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd
92
93 # create the pub directory
94 mkdir -p ${D}/home/${FTPUSER}/pub/
95 chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub
96 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
97 # install proftpd pam configuration
98 install -d ${D}${sysconfdir}/pam.d
99 install -m 644 ${S}/contrib/dist/rpm/ftp.pamd ${D}${sysconfdir}/pam.d/proftpd
100 sed -i '/ftpusers/d' ${D}${sysconfdir}/pam.d/proftpd
101 # specify the user Authentication config
102 sed -i '/^MaxInstances/a\AuthPAM on\nAuthPAMConfig proftpd' \
103 ${D}${sysconfdir}/proftpd.conf
104 fi
105
106 install -d ${D}/${systemd_unitdir}/system
107 install -m 644 ${WORKDIR}/proftpd.service ${D}/${systemd_unitdir}/system
108 sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
109 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
110 -e 's,@SBINDIR@,${sbindir},g' \
111 -i ${D}${systemd_unitdir}/system/*.service
112
113 sed -e 's|--sysroot=${STAGING_DIR_HOST}||g' \
114 -e 's|${STAGING_DIR_NATIVE}||g' \
Andrew Geisslerf103a7f2021-05-07 16:09:40 -0500115 -e 's|-ffile-prefix-map=[^ ]*||g' \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500116 -e 's|-fdebug-prefix-map=[^ ]*||g' \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500117 -e 's|-fmacro-prefix-map=[^ ]*||g' \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500118 -i ${D}/${bindir}/prxs
119
120 # ftpmail perl script, which reads the proftpd log file and sends
121 # automatic email notifications once an upload finishs,
122 # depends on an old perl Mail::Sendmail
123 # The Mail::Sendmail has not been maintained for almost 10 years
124 # Other distribution not ship with ftpmail, so do the same to
125 # avoid confusion about having it fails to run
126 rm -rf ${D}${bindir}/ftpmail
127 rm -rf ${D}${mandir}/man1/ftpmail.1
128}
129
130INITSCRIPT_NAME = "proftpd"
131INITSCRIPT_PARAM = "defaults 85 15"
132
133SYSTEMD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -0500134SYSTEMD_SERVICE:${PN} = "proftpd.service"
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500135
136USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -0500137GROUPADD_PARAM:${PN} = "--system ${FTPGROUP}"
138USERADD_PARAM:${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500139 --shell /bin/false ${FTPUSER}"
140
Andrew Geissler82c905d2020-04-13 13:39:40 -0500141MULTILIB_SCRIPTS = "${PN}:${bindir}/prxs"
142
Patrick Williams213cb262021-08-07 19:21:33 -0500143FILES:${PN} += "/home/${FTPUSER}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500144
Patrick Williams213cb262021-08-07 19:21:33 -0500145RDEPENDS:${PN} += "perl"