siproxd-0.8.1-r2.ebuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. # make the daemon run as user 'siproxd' by default
  29. sed -i -e "s:nobody:siproxd:" doc/siproxd.conf.example \
  30. || die "patching doc/siproxd.conf.example failed"
  31. # do not fail when building with external libltdl
  32. sed -i 's/libltdl //' Makefile.am || die "patching Makefile failed"
  33. epatch "${FILESDIR}/${PN}-libtool-2.4.patch"
  34. # do not crash when building with external libltdl, bug 308495
  35. sed -i 's|"../libltdl/ltdl.h"|<ltdl.h>|' src/plugins.h || die "patching plugins.h failed"
  36. epatch "${FILESDIR}/${PN}-0.8.1-amd64_static_build.patch" #380835
  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. $(use_enable !static shared) \
  46. --enable-static
  47. #$(use debug && use_enable debug dmalloc) \
  48. # statically linked plugins to libosip2 causes a shared lib linking with
  49. # static lib (gcc seems not to like it : portable issue it says).
  50. # there was also DT_TEXREL issue and stripping of static plugins failed
  51. # so shared lib has to be used for plugins
  52. # upstream has been contacted, see bug 2649351 in their bugtracker
  53. if use static; then
  54. sed -i -r -e \
  55. "s:LIBS =(.*)( \/[^ ]*libosip[^ ]*\.a)( \/[^ ]*libosip[^ ]*\.a)(.*):LIBS_STATIC =\1\2\3\4\nLIBS = \1\4 -losip2 -losipparser2:" \
  56. src/Makefile || die "patching src/Makefile failed"
  57. sed -i -e \
  58. "s:\$(siproxd_LDADD) \$(LIBS):\$(siproxd_LDADD) \$(LIBS_STATIC):" \
  59. src/Makefile || die "patching src/Makefile failed"
  60. fi
  61. }
  62. src_install() {
  63. default
  64. newinitd "${FILESDIR}"/${PN}.rc8 ${PN}
  65. dodoc AUTHORS ChangeLog NEWS README RELNOTES TODO \
  66. doc/FAQ doc/FLI4L_HOWTO.txt doc/KNOWN_BUGS
  67. if use doc; then
  68. dodoc doc/RFC3261_compliance.txt
  69. # auto-generated doc is not auto-installed
  70. # upstream has been contacted, see bug 2649333 in their bugtracker
  71. dohtml -r doc/html/
  72. # pdf is not build all the time
  73. if has_version 'app-text/docbook-sgml-utils[jadetex]' ; then
  74. dodoc doc/pdf/*.pdf
  75. fi
  76. fi
  77. if use examples; then
  78. docinto examples
  79. dodoc doc/sample_*.txt
  80. fi
  81. # set up siproxd directories
  82. keepdir /var/lib/${PN}
  83. fowners siproxd:siproxd /var/lib/${PN}
  84. }
  85. pkg_postinst() {
  86. if use static; then
  87. elog "static USE flag does not build a _fully_ statically linked binary"
  88. elog "only libosip2 and libosipparser2 are statically linked"
  89. elog "In addition, plugins are dynamically linked with those libs"
  90. fi
  91. }