blob: 7ab1b8d8784a561f5159f9fe2a19d5ac6e46537e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Document-oriented NoSQL database"
HOMEPAGE="https://couchdb.apache.org"
SRC_URI="https://apache.org/dist/${PN}/source/${PV}/apache-${PN}-${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
QA_PREBUILT="
/usr/lib/${PN}/lib/**/*
/usr/lib/${PN}/erts-*/bin/*
"
RDEPEND="
>=dev-libs/openssl-3.5.6
>=dev-libs/icu-78.3
>=sys-libs/ncurses-6.5_p20251220
>=virtual/zlib-1.3.1
acct-user/couchdb
acct-group/couchdb
"
DEPEND="${RDEPEND}"
BDEPEND="
${RDEPEND}
>=dev-lang/erlang-28.1
"
src_prepare() {
# Change CouchDB's data directory to /var/lib/couchdb
sed -i 's|./data|/var/lib/couchdb|' "${S}"/configure || die
eapply_user
}
src_configure() {
econf \
--js-engine=quickjs \
--disable-spidermonkey
}
src_compile() {
emake release
}
src_install() {
# CouchDB doesn't provide a helpful `make install`, so we have to manually copy
# most things over to ${D}
mkdir -p "${D}"/usr/lib/${PN} "${D}"/etc/${PN} || die
cp -vr "${S}"/rel/${PN} "${D}"/usr/lib/ || die
mv -v "${D}"/usr/lib/${PN}/etc/{default.ini,local.ini,vm.args} "${D}"/etc/${PN}/ || die
# Scope ownership of CouchDB directories to the couchdb user
fowners -R couchdb:couchdb /usr/lib/${PN}
fowners -R couchdb:couchdb /etc/${PN}
find "${D}"/usr/lib/${PN} -type d -exec chmod 0770 {} \;
fperms 0644 /etc/${PN}/*
# Install scripts
newinitd "${FILESDIR}"/couchdb-init.d couchdb
newconfd "${FILESDIR}"/couchdb-conf.d couchdb
# Remove some cruft
rm -vr "${D}"/usr/lib/${PN}/erts-*/{doc,include,lib,man,src} || die
rm -vr "${D}"/usr/lib/${PN}/etc/ || die
rm -vr "${D}"/usr/lib/${PN}/lib/couch-${PV}/priv/couch_{ejson_compare,js} || die
}
|