charybdis-3.3.0.ebuild 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit autotools eutils multilib user
  5. DESCRIPTION="The atheme project's IRCd based on ratbox"
  6. HOMEPAGE="http://atheme.org/project/charybdis http://www.stack.nl/~jilles/irc/#charybdis"
  7. SRC_URI="http://www.stack.nl/~jilles/irc/${P}.tbz2
  8. https://dev.gentoo.org/~binki/distfiles/${CATEGORY}/${PN}/${P}-patches.tar.bz2"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="amd64 x86"
  12. IUSE="debug +ipv6 largenet ssl zlib"
  13. RDEPEND="ssl? ( dev-libs/openssl )
  14. zlib? ( sys-libs/zlib )"
  15. DEPEND="${RDEPEND}
  16. virtual/yacc
  17. sys-devel/flex"
  18. pkg_setup() {
  19. enewgroup ${PN}
  20. enewuser ${PN} -1 -1 "${EPREFIX}"/usr ${PN}
  21. }
  22. src_prepare() {
  23. EPATCH_SUFFIX=patch epatch
  24. eautoreconf
  25. # Fill the example configuration file with proper paths.
  26. sed -i \
  27. -e "s:path =.*modules:path = \"$(get_libdir)/${PN}/modules:g" \
  28. -e "s:etc/:../etc/${PN}/:g" \
  29. -e "s:logs/:../var/log/charybdis/:g" \
  30. -e "s:test\.\(cert\|key\):ssl.\1:g" \
  31. doc/example.conf \
  32. doc/reference.conf \
  33. || die
  34. }
  35. src_configure() {
  36. econf \
  37. ac_cv_prog_cc_g=no \
  38. --disable-gnutls \
  39. $(use_enable debug assert soft) \
  40. $(use_enable debug iodebug) \
  41. $(use_enable ipv6) \
  42. $(use_enable !largenet small-net) \
  43. $(use_enable ssl openssl) \
  44. $(use_enable zlib) \
  45. --with-program-prefix=charybdis- \
  46. \
  47. --enable-fhs-paths \
  48. --sysconfdir="${EPREFIX}"/etc/${PN} \
  49. --libdir="${EPREFIX}"/usr/"$(get_libdir)"/${PN} \
  50. --with-logdir="${EPREFIX}"/var/log/${PN} \
  51. --with-moduledir="${EPREFIX}"/usr/"$(get_libdir)"/${PN}/modules \
  52. --with-rundir="${EPREFIX}"/var/run
  53. }
  54. src_install() {
  55. default
  56. newinitd "${FILESDIR}"/${PN}.initd ${PN}
  57. newconfd "${FILESDIR}"/${PN}.confd ${PN}
  58. insinto etc/${PN}
  59. newins doc/reference.conf ircd.conf
  60. keepdir var/{lib,log}/${PN}
  61. # Ensure that if `make install' created /var/run/${PN}, we still
  62. # force the initscript to create that directory.
  63. rm -rf "${D}"/var/run || die
  64. # charybdis ircd needs writing to its state (bandb) and log directories
  65. fowners :charybdis /var/{lib,log}/${PN}
  66. fperms 770 /var/{lib,log}/${PN}
  67. # ensure that charybdis can access but not modify its configuration
  68. # while protecting it from others
  69. fowners :charybdis /etc/${PN}{,/ircd.conf}
  70. fperms 750 /etc/${PN}
  71. fperms 640 /etc/${PN}/ircd.conf
  72. }
  73. pkg_postinst() {
  74. elog "All of the charybdis binaries in PATH have been prefixed with"
  75. elog "'charybdis-' to prevent file collisions."
  76. }