tntnet-2.2.1-r1.ebuild 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils
  5. DESCRIPTION="Modular, multithreaded webapplicationserver extensible with C++"
  6. HOMEPAGE="http://www.tntnet.org/"
  7. SRC_URI="http://www.tntnet.org/download/${P}.tar.gz"
  8. LICENSE="LGPL-2.1"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~sparc ~x86"
  11. IUSE="doc gnutls libressl server ssl examples"
  12. RDEPEND=">=dev-libs/cxxtools-2.2.1
  13. sys-libs/zlib[minizip]
  14. ssl? (
  15. gnutls? (
  16. >=net-libs/gnutls-1.2.0
  17. dev-libs/libgcrypt:0
  18. )
  19. !gnutls? (
  20. !libressl? ( dev-libs/openssl:0= )
  21. libressl? ( dev-libs/libressl:0= )
  22. )
  23. )"
  24. DEPEND="${RDEPEND}
  25. virtual/pkgconfig
  26. app-arch/zip"
  27. src_prepare() {
  28. # Both fixed in the next release
  29. epatch "${FILESDIR}"/${PN}-2.0-zlib-minizip.patch
  30. rm framework/common/{ioapi,unzip}.[ch] || die
  31. # bug 423697
  32. sed -e "s:unzip.h:minizip/unzip.h:" -i framework/defcomp/unzipcomp.cpp
  33. eautoreconf
  34. sed -i -e 's:@localstatedir@:/var:' etc/tntnet/tntnet.xml.in || die
  35. }
  36. src_configure() {
  37. local myconf=""
  38. # Prefer gnutls above SSL
  39. if use gnutls; then
  40. einfo "Using gnutls for ssl support."
  41. myconf="${myconf} --with-ssl=gnutls"
  42. elif use ssl; then
  43. einfo "Using openssl for ssl support."
  44. myconf="${myconf} --with-ssl=openssl"
  45. else
  46. myconf="${myconf} --with-ssl=no"
  47. fi
  48. # default enabled, will not compile without sdk
  49. myconf="${myconf} --with-sdk"
  50. econf \
  51. $(use_with server) \
  52. ${myconf}
  53. }
  54. src_install() {
  55. emake DESTDIR="${D}" install || die
  56. dodoc AUTHORS ChangeLog README TODO
  57. if use doc; then
  58. dodoc doc/*.pdf || die
  59. fi
  60. if use examples; then
  61. cd "${S}/sdk/demos"
  62. emake clean
  63. rm -rf .deps */.deps .libs */.libs
  64. cd "${S}"
  65. insinto /usr/share/doc/${PF}/examples
  66. doins -r sdk/demos/* || die
  67. fi
  68. if use server; then
  69. rm -f "${D}/etc/init.d/tntnet"
  70. newinitd "${FILESDIR}/tntnet.initd" tntnet
  71. fi
  72. }