mosquitto-1.4.10.ebuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit eutils systemd user python-any-r1
  6. DESCRIPTION="An Open Source MQTT v3 Broker"
  7. HOMEPAGE="http://mosquitto.org/"
  8. SRC_URI="http://mosquitto.org/files/source/${P}.tar.gz"
  9. LICENSE="EPL-1.0"
  10. SLOT="0"
  11. KEYWORDS="amd64 x86 ~arm"
  12. IUSE="bridge examples +persistence +srv ssl tcpd"
  13. RDEPEND="tcpd? ( sys-apps/tcp-wrappers )
  14. ssl? ( dev-libs/openssl:0= )"
  15. DEPEND="${RDEPEND}
  16. ${PYTHON_DEPS}
  17. srv? ( net-dns/c-ares )"
  18. pkg_setup() {
  19. enewgroup mosquitto
  20. enewuser mosquitto -1 -1 -1 mosquitto
  21. }
  22. src_prepare() {
  23. epatch "${FILESDIR}/${P}-conditional-tests.patch"
  24. if use persistence; then
  25. sed -i -e "s:^#autosave_interval:autosave_interval:" \
  26. -e "s:^#persistence false$:persistence true:" \
  27. -e "s:^#persistence_file:persistence_file:" \
  28. -e "s:^#persistence_location$:persistence_location /var/lib/mosquitto/:" \
  29. mosquitto.conf || die
  30. fi
  31. python_setup
  32. python_fix_shebang test
  33. }
  34. src_configure() {
  35. LIBDIR=$(get_libdir)
  36. QA_PRESTRIPPED="/usr/sbin/mosquitto
  37. /usr/bin/mosquitto_passwd
  38. /usr/bin/mosquitto_sub
  39. /usr/bin/mosquitto_pub
  40. /usr/${LIBDIR}/libmosquittopp.so.1
  41. /usr/${LIBDIR}/libmosquitto.so.1"
  42. makeopts=(
  43. "LIB_SUFFIX=${LIBDIR:3}"
  44. "WITH_BRIDGE=$(usex bridge)"
  45. "WITH_PERSISTENCE=$(usex persistence)"
  46. "WITH_SRV=$(usex srv)"
  47. "WITH_TLS=$(usex ssl)"
  48. "WITH_WRAP=$(usex tcpd)"
  49. )
  50. }
  51. src_compile() {
  52. emake "${makeopts[@]}"
  53. }
  54. src_test() {
  55. emake "${makeopts[@]}" test
  56. }
  57. src_install() {
  58. emake "${makeopts[@]}" DESTDIR="${D}" prefix=/usr install
  59. keepdir /var/lib/mosquitto
  60. fowners mosquitto:mosquitto /var/lib/mosquitto
  61. dodoc readme.md CONTRIBUTING.md ChangeLog.txt
  62. doinitd "${FILESDIR}"/mosquitto
  63. insinto /etc/mosquitto
  64. doins mosquitto.conf
  65. systemd_dounit "${FILESDIR}/mosquitto.service"
  66. if use examples; then
  67. docompress -x "/usr/share/doc/${PF}/examples"
  68. insinto "/usr/share/doc/${PF}/examples"
  69. doins -r examples/*
  70. fi
  71. }
  72. pkg_postinst() {
  73. elog ""
  74. elog "The Python module has been moved out of mosquitto."
  75. elog "See http://mosquitto.org/documentation/python/"
  76. elog ""
  77. elog "To start the mosquitto daemon at boot, add it to the default runlevel with:"
  78. elog ""
  79. elog " rc-update add mosquitto default"
  80. elog " or"
  81. elog " systemctl enable mosquitto"
  82. }