siproxd-0.8.0-r3.ebuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils autotools user
  5. DESCRIPTION="A proxy/masquerading daemon for the SIP protocol"
  6. HOMEPAGE="http://siproxd.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 x86"
  11. IUSE="examples doc static"
  12. # TODO: debug can be used but dmalloc is breaking the build
  13. # upstream has been contacted, see bug 2649238 in their bugtracker
  14. RDEPEND=">=net-libs/libosip-3.0.0
  15. <net-libs/libosip-4.0.0"
  16. # debug? ( dev-libs/dmalloc[threads] )"
  17. DEPEND="${RDEPEND}
  18. >=sys-devel/libtool-2.4
  19. doc? ( app-text/docbook-sgml-utils
  20. app-text/docbook-sgml-dtd:4.2 )"
  21. # docbook-sgml-utils is for building doc
  22. # docbook-sgml-dtd is for the doc dtd even if docbook-sgml-utils depends on it
  23. pkg_setup() {
  24. enewgroup siproxd
  25. enewuser siproxd -1 -1 /dev/null siproxd
  26. }
  27. src_prepare() {
  28. default
  29. # make the daemon run as user 'siproxd' by default
  30. sed -i -e "s:nobody:siproxd:" doc/siproxd.conf.example \
  31. || die "patching doc/siproxd.conf.example failed"
  32. # do not fail when building with external libltdl
  33. sed -i 's/libltdl //' Makefile.am || die "patching Makefile failed"
  34. epatch "${FILESDIR}/${PN}-libtool-2.4.patch"
  35. # do not crash when building with external libltdl, bug 308495
  36. sed -i 's|"../libltdl/ltdl.h"|<ltdl.h>|' src/plugins.h || die "patching plugins.h failed"
  37. eautoreconf
  38. }
  39. src_configure() {
  40. # static-libosip2 make it link statically against libosip2
  41. # static build static version of plugins, forced to true
  42. econf \
  43. $(use_enable doc) \
  44. $(use_enable static static-libosip2) \
  45. --enable-static
  46. #$(use debug && use_enable debug dmalloc) \
  47. # statically linked plugins to libosip2 causes a shared lib linking with
  48. # static lib (gcc seems not to like it : portable issue it says).
  49. # there was also DT_TEXREL issue and stripping of static plugins failed
  50. # so shared lib has to be used for plugins
  51. # upstream has been contacted, see bug 2649351 in their bugtracker
  52. if use static; then
  53. sed -i -r -e \
  54. "s:LIBS =(.*)( \/[^ ]*libosip[^ ]*\.a)( \/[^ ]*libosip[^ ]*\.a)(.*):LIBS_STATIC =\1\2\3\4\nLIBS = \1\4 -losip2 -losipparser2:" \
  55. src/Makefile || die "patching src/Makefile failed"
  56. sed -i -e \
  57. "s:\$(siproxd_LDADD) \$(LIBS):\$(siproxd_LDADD) \$(LIBS_STATIC):" \
  58. src/Makefile || die "patching src/Makefile failed"
  59. fi
  60. }
  61. src_install() {
  62. einstall
  63. newinitd "${FILESDIR}"/${PN}.rc6 ${PN}
  64. dodoc AUTHORS ChangeLog NEWS README RELNOTES TODO \
  65. doc/FAQ doc/FLI4L_HOWTO.txt doc/KNOWN_BUGS
  66. if use doc; then
  67. dodoc doc/RFC3261_compliance.txt
  68. # auto-generated doc is not auto-installed
  69. # upstream has been contacted, see bug 2649333 in their bugtracker
  70. dohtml -r doc/html/
  71. # pdf is not build all the time
  72. if has_version app-text/docbook-sgml-utils[jadetex]; then
  73. dodoc doc/pdf/*.pdf
  74. fi
  75. fi
  76. if use examples; then
  77. docinto examples
  78. dodoc doc/sample_*.txt
  79. fi
  80. # set up siproxd directories
  81. keepdir /var/{lib,run}/${PN}
  82. fowners siproxd:siproxd /var/{lib,run}/${PN}
  83. }
  84. pkg_postinst() {
  85. if use static; then
  86. elog "static USE flag does not build a _fully_ statically linked binary"
  87. elog "only libosip2 and libosipparser2 are statically linked"
  88. elog "In addition, plugins are dynamically linked with those libs"
  89. fi
  90. }