couchdb-1.6.1-r2.ebuild 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils multilib pax-utils user
  5. DESCRIPTION="Distributed, fault-tolerant and schema-free document-oriented database"
  6. HOMEPAGE="http://couchdb.apache.org/"
  7. SRC_URI="mirror://apache/couchdb/source/${PV}/apache-${P}.tar.gz"
  8. LICENSE="Apache-2.0"
  9. SLOT="0"
  10. KEYWORDS="amd64 ppc x86"
  11. IUSE="libressl selinux test"
  12. RDEPEND=">=dev-libs/icu-4.3.1:=
  13. <dev-lang/erlang-19.0[ssl]
  14. !libressl? ( >=dev-libs/openssl-0.9.8j:0 )
  15. libressl? ( dev-libs/libressl )
  16. >=net-misc/curl-7.18.2
  17. <dev-lang/spidermonkey-1.8.7
  18. selinux? ( sec-policy/selinux-couchdb )"
  19. DEPEND="${RDEPEND}
  20. sys-devel/autoconf-archive"
  21. RESTRICT=test
  22. S="${WORKDIR}/apache-${P}"
  23. pkg_setup() {
  24. enewgroup couchdb
  25. enewuser couchdb -1 -1 /var/lib/couchdb couchdb
  26. }
  27. src_prepare() {
  28. sed -i ./src/couchdb/priv/Makefile.* -e 's|-Werror||g'
  29. epatch "${FILESDIR}/${PV}-erlang-18.patch"
  30. eautoreconf
  31. }
  32. src_configure() {
  33. econf \
  34. --with-erlang="${EPREFIX}"/usr/$(get_libdir)/erlang/usr/include \
  35. --localstatedir="${EPREFIX}"/var \
  36. --with-js-lib="${EPREFIX}"/usr/$(get_libdir)
  37. # bug 296609, upstream bug #COUCHDB-621
  38. sed -e "s#localdocdir = /usr/share/doc/couchdb#localdocdir = "${EPREFIX}"/usr/share/doc/${PF}#" -i Makefile || die "sed failed"
  39. }
  40. src_compile() {
  41. emake
  42. # bug 442616
  43. pax-mark mr src/couchdb/priv/couchjs
  44. }
  45. src_test() {
  46. emake distcheck
  47. }
  48. src_install() {
  49. emake DESTDIR="${D}" install
  50. fowners couchdb:couchdb \
  51. /var/lib/couchdb \
  52. /var/log/couchdb
  53. for f in "${ED}"/etc/couchdb/*.ini ; do
  54. fowners root:couchdb "${f#${ED}}"
  55. fperms 660 "${f#${ED}}"
  56. done
  57. fperms 664 /etc/couchdb/default.ini
  58. newinitd "${FILESDIR}/couchdb.init-4" couchdb
  59. newconfd "${FILESDIR}/couchdb.conf-2" couchdb
  60. sed -i -e "s:LIBDIR:$(get_libdir):" "${ED}/etc/conf.d/couchdb"
  61. }