atheme-services-9999.ebuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit git-2 user eutils flag-o-matic perl-module
  5. MY_P=${P/_/-}
  6. DESCRIPTION="A portable and secure set of open-source and modular IRC services"
  7. HOMEPAGE="http://atheme.net/"
  8. EGIT_REPO_URI="git://github.com/atheme/atheme.git"
  9. EGIT_HAS_SUBMODULES="true"
  10. LICENSE="BSD"
  11. SLOT="0"
  12. KEYWORDS=""
  13. IUSE="cracklib largenet ldap nls +pcre perl profile ssl"
  14. RDEPEND="=dev-libs/libmowgli-9999:2
  15. cracklib? ( sys-libs/cracklib )
  16. ldap? ( net-nds/openldap )
  17. nls? ( sys-devel/gettext )
  18. perl? ( dev-lang/perl )
  19. pcre? ( dev-libs/libpcre )
  20. ssl? ( dev-libs/openssl )"
  21. DEPEND="${RDEPEND}
  22. virtual/pkgconfig"
  23. pkg_setup() {
  24. # the dependency calculation puts all of the .c files together and
  25. # overwhelms cc1 with this flag :-(
  26. filter-flags -combine
  27. if use profile; then
  28. # bug #371119
  29. ewarn "USE=\"profile\" is incompatible with the hardened profile's -pie flag."
  30. ewarn "Disabling PIE. Please ignore any warning messages about -nopie being invalid."
  31. append-flags -nopie
  32. fi
  33. enewgroup ${PN}
  34. enewuser ${PN} -1 -1 /var/lib/atheme ${PN}
  35. }
  36. # To stop perl-module overriding this function
  37. src_unpack() {
  38. git-2_src_unpack
  39. }
  40. src_prepare() {
  41. # fix docdir
  42. sed -i -e 's/\(^DOCDIR.*=.\)@DOCDIR@/\1@docdir@/' extra.mk.in || die
  43. # basic logging config directive fix
  44. sed -i -e '/^logfile/s;var/\(.*\.log\);'"${EPREFIX}"'/var/log/atheme/\1;g' dist/* || die
  45. # QA against bundled libs.
  46. # But comment it out in the live ebuild
  47. # because it only contains a git submodule
  48. # and removing it MAY break everything.
  49. #rm -rf libmowgli-2 || die
  50. }
  51. src_configure() {
  52. econf \
  53. atheme_cv_c_gcc_w_error_implicit_function_declaration=no \
  54. --sysconfdir="${EPREFIX}"/etc/${PN} \
  55. --docdir="${EPREFIX}"/usr/share/doc/${PF} \
  56. --localstatedir="${EPREFIX}"/var \
  57. --enable-fhs-paths \
  58. --disable-warnings \
  59. --enable-contrib \
  60. $(use_enable largenet large-net) \
  61. $(use_with cracklib) \
  62. $(use_with ldap) \
  63. $(use_with nls) \
  64. $(use_enable profile) \
  65. $(use_with perl) \
  66. $(use_with pcre) \
  67. $(use_enable ssl)
  68. }
  69. src_compile() {
  70. emake V=1
  71. }
  72. src_install() {
  73. emake DESTDIR="${D}" install
  74. insinto /etc/${PN}
  75. for conf in dist/*.example; do
  76. # The .cron file isn't meant to live in /etc/${PN}, so only
  77. # install a .example version.
  78. [[ ${conf} == *cron* ]] && continue
  79. newins ${conf} $(basename ${conf} .example)
  80. done
  81. fowners -R 0:${PN} /etc/${PN}
  82. keepdir /var/{lib,log}/atheme
  83. fowners ${PN}:${PN} /var/{lib,log,run}/atheme
  84. fperms -R go-w,o-rx /etc/${PN}
  85. fperms 750 /etc/${PN} /var/{lib,log,run}/atheme
  86. newinitd "${FILESDIR}"/${PN}.initd ${PN}
  87. mv "${ED}"/usr/bin/{,atheme-}dbverify || die
  88. # contributed scripts and such:
  89. insinto /usr/share/doc/${PF}/contrib
  90. doins contrib/*.{c,pl,php,py,rb}
  91. if use perl; then
  92. perl_set_version
  93. insinto "${VENDOR_LIB#${EPREFIX}}"
  94. doins -r contrib/Atheme{,.pm}
  95. fi
  96. }