qpsmtpd-0.95.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. [[ ${PV} == *9999 ]] && SCM="git-2"
  5. inherit eutils perl-app user ${SCM}
  6. DESCRIPTION="qpsmtpd is a flexible smtpd daemon written in Perl"
  7. HOMEPAGE="http://smtpd.develooper.com"
  8. KEYWORDS=""
  9. if [[ ${PV} != *9999 ]]; then
  10. SRC_URI="https://github.com/smtpd/qpsmtpd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  11. KEYWORDS="~amd64 ~x86"
  12. else
  13. # This is a spotted development fork with many improvements
  14. EGIT_REPO_URI="git://github.com/qpsmtpd-dev/qpsmtpd-dev.git
  15. https://github.com/qpsmtpd-dev/qpsmtpd-dev.git"
  16. fi
  17. LICENSE="MIT"
  18. SLOT="0"
  19. KEYWORDS=""
  20. IUSE="postfix ipv6 syslog"
  21. RDEPEND=">=dev-lang/perl-5.8.0
  22. >=dev-perl/Net-DNS-0.690.0
  23. virtual/perl-MIME-Base64
  24. dev-perl/MailTools
  25. dev-perl/IPC-Shareable
  26. dev-perl/Socket6
  27. dev-perl/Danga-Socket
  28. dev-perl/ParaDNS
  29. dev-perl/UNIVERSAL-isa
  30. ipv6? ( dev-perl/IO-Socket-INET6 )
  31. syslog? ( virtual/perl-Sys-Syslog )
  32. virtual/inetd"
  33. pkg_setup() {
  34. enewgroup smtpd
  35. local additional_groups
  36. if use postfix; then
  37. additional_groups="${additional_groups},postdrop"
  38. fi
  39. enewuser smtpd -1 -1 /var/spool/qpsmtpd smtpd${additional_groups}
  40. }
  41. src_unpack() {
  42. if [[ ${PV} != *9999 ]]; then
  43. unpack ${A}
  44. cd "${S}"
  45. else
  46. git-2_src_unpack
  47. cd "${S}"
  48. fi
  49. }
  50. src_install() {
  51. perl-module_src_install
  52. insinto /etc/xinetd.d
  53. newins "${FILESDIR}"/qpsmtpd.xinetd qpsmtpd
  54. dodir /usr/share/qpsmtpd
  55. cp -Rf plugins "${D}"/usr/share/qpsmtpd/
  56. diropts -m 0755 -o smtpd -g smtpd
  57. dodir /var/spool/qpsmtpd
  58. keepdir /var/spool/qpsmtpd
  59. dodir /etc/qpsmtpd
  60. insinto /etc/qpsmtpd
  61. doins config.sample/*
  62. echo "/usr/share/qpsmtpd/plugins" > "${D}"/etc/qpsmtpd/plugin_dirs
  63. echo "/var/spool/qpsmtpd" > "${D}"/etc/qpsmtpd/spool_dir
  64. if use syslog; then
  65. echo "logging/syslog loglevel LOGINFO priority LOG_NOTICE" > "${D}"/etc/qpsmtpd/logging
  66. else
  67. diropts -m 0755 -o smtpd -g smtpd
  68. dodir /var/log/qpsmtpd
  69. keepdir /var/log/qpsmtpd
  70. echo "logging/file loglevel LOGINFO /var/log/qpsmtpd/%Y-%m-%d" > "${D}"/etc/qpsmtpd/logging
  71. fi
  72. newenvd "${FILESDIR}"/qpsmtpd.envd 99qpsmtpd
  73. newconfd "${FILESDIR}"/qpsmtpd.confd qpsmtpd
  74. newinitd "${FILESDIR}"/qpsmtpd.initd-r1 qpsmtpd
  75. dodoc CREDITS Changes README.md README.plugins.md STATUS UPGRADING.md
  76. }