Skip to content

Instantly share code, notes, and snippets.

@mbroadst
Last active February 1, 2017 23:00
Show Gist options
  • Save mbroadst/74d0d0f642dfccd459d89d6d2e61b2fd to your computer and use it in GitHub Desktop.
Save mbroadst/74d0d0f642dfccd459d89d6d2e61b2fd to your computer and use it in GitHub Desktop.
SUMMARY = "RethinkDB is an open source distributed database system for the realtime web."
LICENSE = "AGPL-3.0"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=5e7ac215b3ae3a8526781664de7a8282"
SRC_URI = " \
https://download.rethinkdb.com/dist/rethinkdb-2.3.0.tgz \
file://0001-wrap-compiler-env-variables-in-quotes.patch \
file://0002-configure-v8-without-snapshot-for-cross-compile.patch \
file://0003-fix-v8-pkg_install-include-for-cross-compile.patch \
file://0004-remove-no-registry-flag-for-npm-install.patch \
file://0005-use-separate-toolsets-for-v8-while-cross-compiling.patch \
file://[email protected] \
file://rethinkdb.conf \
"
SRC_URI[md5sum] = "615f4d0f64821c816d94811dfcdbcb69"
SRC_URI[sha256sum] = "8b059ce9f19dc6bba0fe303d238daa91485aef23dd1bc4e3f5f1d76c573ce82c"
DEPENDS += " node-native curl wget zlib"
RDEPENDS_${PN} += " libcrypto libcurl libssl"
inherit systemd
FILES_${PN} += " ${systemd_unitdir}/system"
do_configure() {
${S}/configure --allow-fetch --with-system-malloc --prefix ${prefix} --sysconfdir ${sysconfdir} --localstatedir ${localstatedir}
}
do_install() {
oe_runmake DESTDIR=${D} PVERSION=${PV} STRIP_ON_INSTALL=0 install
# install systemd and tmpfiles configuration
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_unitdir}/system
install -d ${D}${sysconfdir}/tmpfiles.d
install -m 0644 ${WORKDIR}/rethinkdb.conf ${D}${sysconfdir}/tmpfiles.d
}
pkg_postinst_${PN} () {
if [ "x$D" != "x" ]; then
exit 1
fi
# make user and group
grep rethinkdb /etc/group || groupadd rethinkdb
grep rethinkdb /etc/passwd || adduser --disabled-password --home=/var/lib/rethinkdb --ingroup rethinkdb rethinkdb
# setup state dir
mkdir -p /var/lib/rethinkdb
chown rethinkdb.rethinkdb /var/lib/rethinkdb
}
pkg_postrm_${PN} () {
grep rethinkdb /etc/passwd && deluser rethinkdb
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment