ftpbase-0.01-r2.ebuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit eutils pam user
  4. DESCRIPTION="FTP layout package"
  5. HOMEPAGE="https://www.gentoo.org/"
  6. SRC_URI=""
  7. LICENSE="GPL-2"
  8. SLOT="0"
  9. KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
  10. IUSE="pam"
  11. DEPEND="pam? ( virtual/pam )
  12. !<net-ftp/proftpd-1.2.10-r6
  13. !<net-ftp/pure-ftpd-1.0.20-r2
  14. !<net-ftp/vsftpd-2.0.3-r1"
  15. S=${WORKDIR}
  16. pkg_setup() {
  17. # Check if home exists
  18. local exists=false
  19. [[ -d "${ROOT}home/ftp" ]] && exists=true
  20. # Add our default ftp user
  21. enewgroup ftp 21
  22. enewuser ftp 21 -1 /home/ftp ftp
  23. # If home did not exist and does now then we created it in the enewuser
  24. # command. Now we have to change it's permissions to something sane.
  25. if [[ ${exists} == "false" && -d "${ROOT}home/ftp" ]] ; then
  26. chown root:ftp "${ROOT}"home/ftp
  27. fi
  28. }
  29. src_install() {
  30. # The ftpusers file is a list of people who are NOT allowed
  31. # to use the ftp service.
  32. insinto /etc
  33. doins "${FILESDIR}/ftpusers" || die
  34. # Ideally we would create the home directory here with a dodir.
  35. # But we cannot until bug #9849 is solved - so we kludge in pkg_postinst()
  36. cp "${FILESDIR}/ftp-pamd-include" "${T}" || die
  37. if use elibc_FreeBSD; then
  38. sed -i -e "/pam_listfile.so/s/^.*$/account required pam_ftpusers.so no_warn disallow/" \
  39. "${T}"/ftp-pamd-include || die
  40. fi
  41. newpamd "${T}"/ftp-pamd-include ftp
  42. }