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