summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/proftpd/proftpd_1.3.9b.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-daemons/proftpd/proftpd_1.3.9b.bb')
-rw-r--r--meta-networking/recipes-daemons/proftpd/proftpd_1.3.9b.bb158
1 files changed, 158 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/proftpd/proftpd_1.3.9b.bb b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.9b.bb
new file mode 100644
index 0000000000..3da67c9e1c
--- /dev/null
+++ b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.9b.bb
@@ -0,0 +1,158 @@
1SUMMARY = "Secure and configurable FTP server"
2SECTION = "net"
3HOMEPAGE = "http://www.proftpd.org"
4LICENSE = "GPL-2.0-or-later"
5LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184"
6
7SRCREV = "390b21555268bbc64b66d2dfa7ae40476419b80f"
8BRANCH = "1.3.9"
9
10SRC_URI = "git://github.com/proftpd/proftpd.git;branch=${BRANCH};protocol=https;tag=v${PV} \
11 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 "
19
20
21inherit autotools-brokensep useradd update-rc.d systemd multilib_script
22
23# patch releases have character after version
24UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+\w?))"
25CVE_VERSION_SUFFIX = "alphabetical"
26
27CVE_STATUS[CVE-2001-0027] = "fixed-version: version 1.2.0rc3 removed affected module"
28CVE_STATUS[CVE-2021-47865] = "upstream-wontfix: it is not a vulnerability but inproper configuration"
29
30EXTRA_OECONF += "--enable-largefile INSTALL=install"
31
32PACKAGECONFIG ??= "shadow \
33 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
34 static \
35 "
36
37PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses, --disable-curses --disable-ncurses, ncurses"
38PACKAGECONFIG[openssl] = "--enable-openssl, --disable-openssl, openssl, openssl"
39PACKAGECONFIG[pam] = "--enable-auth-pam, --disable-auth-pam, libpam, libpam"
40PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6"
41PACKAGECONFIG[shadow] = "--enable-shadow, --disable-shadow"
42PACKAGECONFIG[pcre] = "--enable-pcre, --disable-pcre, libpcre "
43PACKAGECONFIG[static] = "--enable-static=yes, --enable-static=no"
44
45# enable POSIX.1e capabilities
46PACKAGECONFIG[cap] = "--enable-cap, --disable-cap, libcap, libcap"
47
48#enable support for POSIX ACLs
49PACKAGECONFIG[acl] = "--enable-facl, --disable-facl"
50
51#enable proftpd controls via ftpdct
52PACKAGECONFIG[ctrls] = "--enable-ctrls, --disable-crtls"
53
54#prevent proftpd from using its bundled getopt implementation.
55PACKAGECONFIG[getopt] = "--with-getopt, --without-getopt"
56
57#do not strip debugging symbols from installed code
58PACKAGECONFIG[strip] = "--enable-strip, --disable-strip"
59
60#enable SIA authentication support (Tru64)
61PACKAGECONFIG[sia] = "--enable-sia, --disable-sia"
62PACKAGECONFIG[sendfile] = "-enable-sendfile, --disable-sendfile"
63
64#enable Native Language Support (NLS)
65PACKAGECONFIG[nls] = "--enable-nls, --disable-nls"
66
67#add mod_dso to core modules
68PACKAGECONFIG[dso] = "--enable-dso, --disable-dso"
69
70#omit mod_auth_file from core modules
71PACKAGECONFIG[auth] = "--enable-auth-file, --disable-auth-file"
72
73# proftpd uses libltdl which currently makes configuring using
74# autotools.bbclass a pain...
75do_configure () {
76 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
77 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
78 oe_runconf
79 sed -e 's|--sysroot=${STAGING_DIR_HOST}||g' \
80 -e 's|${STAGING_DIR_NATIVE}||g' \
81 -e 's|-ffile-prefix-map=[^ ]*||g' \
82 -e 's|-fdebug-prefix-map=[^ ]*||g' \
83 -e 's|-fmacro-prefix-map=[^ ]*||g' \
84 -i ${B}/config.h
85}
86
87FTPUSER = "ftp"
88FTPGROUP = "ftp"
89
90do_install () {
91 oe_runmake DESTDIR=${D} install
92 rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale
93 [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir}
94 sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf
95 sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf
96 install -d ${D}${sysconfdir}/init.d
97 install -m 0755 ${UNPACKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd
98 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd
99 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd
100 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd
101 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd
102
103 install -d ${D}${sysconfdir}/default
104 install -m 0755 ${UNPACKDIR}/default ${D}${sysconfdir}/default/proftpd
105
106 # create the pub directory
107 mkdir -p ${D}/home/${FTPUSER}/pub/
108 chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub
109 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
110 # install proftpd pam configuration
111 install -d ${D}${sysconfdir}/pam.d
112 install -m 644 ${S}/contrib/dist/rpm/ftp.pamd ${D}${sysconfdir}/pam.d/proftpd
113 sed -i '/ftpusers/d' ${D}${sysconfdir}/pam.d/proftpd
114 # specify the user Authentication config
115 sed -i '/^MaxInstances/a\AuthPAM on\nAuthPAMConfig proftpd' \
116 ${D}${sysconfdir}/proftpd.conf
117 fi
118
119 install -d ${D}/${systemd_unitdir}/system
120 install -m 644 ${UNPACKDIR}/proftpd.service ${D}/${systemd_unitdir}/system
121 sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
122 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
123 -e 's,@SBINDIR@,${sbindir},g' \
124 -i ${D}${systemd_unitdir}/system/*.service
125
126 sed -e 's|--sysroot=${STAGING_DIR_HOST}||g' \
127 -e 's|${STAGING_DIR_NATIVE}||g' \
128 -e 's|-ffile-prefix-map=[^ ]*||g' \
129 -e 's|-fdebug-prefix-map=[^ ]*||g' \
130 -e 's|-fmacro-prefix-map=[^ ]*||g' \
131 -i ${D}/${bindir}/prxs ${D}${includedir}/proftpd/Make.rules ${D}${includedir}/proftpd/config.h
132
133 # ftpmail perl script, which reads the proftpd log file and sends
134 # automatic email notifications once an upload finishs,
135 # depends on an old perl Mail::Sendmail
136 # The Mail::Sendmail has not been maintained for almost 10 years
137 # Other distribution not ship with ftpmail, so do the same to
138 # avoid confusion about having it fails to run
139 rm -rf ${D}${bindir}/ftpmail
140 rm -rf ${D}${mandir}/man1/ftpmail.1
141}
142
143INITSCRIPT_NAME = "proftpd"
144INITSCRIPT_PARAM = "defaults 85 15"
145
146SYSTEMD_PACKAGES = "${PN}"
147SYSTEMD_SERVICE:${PN} = "proftpd.service"
148
149USERADD_PACKAGES = "${PN}"
150GROUPADD_PARAM:${PN} = "--system ${FTPGROUP}"
151USERADD_PARAM:${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \
152 --shell /bin/false ${FTPUSER}"
153
154MULTILIB_SCRIPTS = "${PN}:${bindir}/prxs"
155
156FILES:${PN} += "/home/${FTPUSER}"
157
158RDEPENDS:${PN} += "perl"