proftpd_1.3.5b.bb 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \
  7. file://basic.conf.patch \
  8. file://proftpd-basic.init \
  9. file://default \
  10. file://close-RequireValidShell-check.patch \
  11. file://contrib.patch \
  12. file://build_fixup.patch \
  13. file://proftpd.service \
  14. "
  15. SRC_URI[md5sum] = "f7b8e3a383b34a894c2502db74ccccde"
  16. SRC_URI[sha256sum] = "afc1789f2478acf88dfdc7d70da90a4fa2786d628218e9574273295d044b4fc8"
  17. inherit autotools-brokensep useradd update-rc.d systemd
  18. PACKAGECONFIG ??= "shadow \
  19. ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
  20. "
  21. PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses, --disable-curses --disable-ncurses, ncurses"
  22. PACKAGECONFIG[openssl] = "--enable-openssl, --disable-openssl, openssl, openssl"
  23. PACKAGECONFIG[pam] = "--enable-auth-pam, --disable-auth-pam, libpam, libpam"
  24. PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6"
  25. PACKAGECONFIG[shadow] = "--enable-shadow, --disable-shadow"
  26. PACKAGECONFIG[pcre] = "--enable-pcre, --disable-pcre, libpcre "
  27. # enable POSIX.1e capabilities
  28. PACKAGECONFIG[cap] = "--enable-cap, --disable-cap, libcap, libcap"
  29. #enable support for POSIX ACLs
  30. PACKAGECONFIG[acl] = "--enable-facl, --disable-facl"
  31. #enable proftpd controls via ftpdct
  32. PACKAGECONFIG[ctrls] = "--enable-ctrls, --disable-crtls"
  33. #prevent proftpd from using its bundled getopt implementation.
  34. PACKAGECONFIG[getopt] = "--with-getopt, --without-getopt"
  35. #do not strip debugging symbols from installed code
  36. PACKAGECONFIG[strip] = "--enable-strip, --disable-strip"
  37. #enable SIA authentication support (Tru64)
  38. PACKAGECONFIG[sia] = "--enable-sia, --disable-sia"
  39. PACKAGECONFIG[sendfile] = "-enable-sendfile, --disable-sendfile"
  40. #enable Native Language Support (NLS)
  41. PACKAGECONFIG[nls] = "--enable-nls, --disable-nls"
  42. #add mod_dso to core modules
  43. PACKAGECONFIG[dso] = "--enable-dso, --disable-dso"
  44. PACKAGECONFIG[largefile] = "--enable-largefile, --disable-largefile"
  45. #omit mod_auth_file from core modules
  46. PACKAGECONFIG[auth] = "--enable-auth-file, --disable-auth-file"
  47. # proftpd uses libltdl which currently makes configuring using
  48. # autotools.bbclass a pain...
  49. do_configure () {
  50. oe_runconf
  51. cp ${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool ${S}/libtool
  52. }
  53. FTPUSER = "ftp"
  54. FTPGROUP = "ftp"
  55. do_install () {
  56. oe_runmake DESTDIR=${D} install
  57. rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale
  58. [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir}
  59. sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf
  60. sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf
  61. install -d ${D}${sysconfdir}/init.d
  62. install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd
  63. sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd
  64. sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd
  65. sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd
  66. sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd
  67. install -d ${D}${sysconfdir}/default
  68. install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd
  69. # create the pub directory
  70. mkdir -p ${D}/home/${FTPUSER}/pub/
  71. chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub
  72. if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
  73. # install proftpd pam configuration
  74. install -d ${D}${sysconfdir}/pam.d
  75. install -m 644 ${S}/contrib/dist/rpm/ftp.pamd ${D}${sysconfdir}/pam.d/proftpd
  76. sed -i '/ftpusers/d' ${D}${sysconfdir}/pam.d/proftpd
  77. # specify the user Authentication config
  78. sed -i '/^MaxInstances/a\AuthPAM on\nAuthPAMConfig proftpd' \
  79. ${D}${sysconfdir}/proftpd.conf
  80. fi
  81. install -d ${D}/${systemd_unitdir}/system
  82. install -m 644 ${WORKDIR}/proftpd.service ${D}/${systemd_unitdir}/system
  83. sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
  84. -e 's,@SYSCONFDIR@,${sysconfdir},g' \
  85. -e 's,@SBINDIR@,${sbindir},g' \
  86. -i ${D}${systemd_unitdir}/system/*.service
  87. sed -e 's|--sysroot=${STAGING_DIR_HOST}||g' \
  88. -e 's|${STAGING_DIR_NATIVE}||g' \
  89. -e 's|-fdebug-prefix-map=[^ ]*||g' \
  90. -i ${D}/${bindir}/prxs
  91. # ftpmail perl script, which reads the proftpd log file and sends
  92. # automatic email notifications once an upload finishs,
  93. # depends on an old perl Mail::Sendmail
  94. # The Mail::Sendmail has not been maintained for almost 10 years
  95. # Other distribution not ship with ftpmail, so do the same to
  96. # avoid confusion about having it fails to run
  97. rm -rf ${D}${bindir}/ftpmail
  98. rm -rf ${D}${mandir}/man1/ftpmail.1
  99. }
  100. INITSCRIPT_NAME = "proftpd"
  101. INITSCRIPT_PARAM = "defaults 85 15"
  102. SYSTEMD_PACKAGES = "${PN}"
  103. SYSTEMD_SERVICE_${PN} = "proftpd.service"
  104. USERADD_PACKAGES = "${PN}"
  105. GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}"
  106. USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \
  107. --shell /bin/false ${FTPUSER}"
  108. FILES_${PN} += "/home/${FTPUSER}"
  109. RDEPENDS_${PN} += "perl"