Created attachment 342186 [details] initial init.d file Rethinkdb is a very cool new database server. I would love to see an ebuild for it. In lieu of writing one immediately, I'm posting build/install instructions for gentoo with the hope that someone may pickup the torch. If I find the time, I will. I have an init.d already. (Yes, I know bugzilla doesn't use markdown...) # Java currently required for build. This dep is going away soon. emerge -uq virtual/jre # Ensure node.js (and v8, which is not always a node.js dep) is installed. emerge net-libs/nodejs dev-lang/v8 -uq # 3 node packages are required. It is likely possible to build with these installed non-globally. npm install -g less npm install -g handlebars ## Apparently 1.5, 1.6 and 1.6.1 all ship with a bug that breaks things. This bug has been fixed in master, but not pushed to npm. npm install -g coffee-script@1.4 # Static deps ## Rethink recommends statically linking a number of core libraries. It is possible to run `./configure` with `--static none` to remove this requirement. echo dev-libs/protobuf static-libs >> /etc/portage/package.use echo dev-util/google-perftools static-libs >> /etc/portage/package.use ### <dev-util/google-perftools-2 does not support static-libs. Unstable version 2.0 that supports USE="static-libs" echo dev-util/google-perftools ~amd64 >> /etc/portage/package.keywords emerge dev-libs/protobuf-c dev-util/google-perftools dev-libs/boost -uq # Build git clone git://github.com/rethinkdb/rethinkdb cd rethinkdb ## If using recommended static libs: ./configure ## If static libs are undesired: ./configure --static none make -j4 # Install export BINDIR=/usr/bin export WEBDIR=/usr/share/rethinkdb_web_assets export DB_DIR=/var/lib/rethinkdb ## Don't forget sudo cp build/release/rethinkdb ${BINDIR}/ cp -r build/release/rethinkdb_web_assets ${WEBDIR} # Initial database setup (should be run during `emerge --config ...`) ## Run as user that will run daemon or fix premissions manually after ${BINDIR}/rethinkdb create --directory ${DB_DIR} # Run manually ${BINDIR}/rethinkdb serve --directory ${DB_DIR} # Init.d script I've written a simple init.d script that picks sensible defaults if they are unset in the associated conf.d. Currently, the only requirement before running is to create a log file with appropriate permissions: ``` export LOG=/var/log/rethinkdb.log touch ${LOG} chown rethinkdb: ${LOG} ``` However, if someone implemented #454914, this would be unnecessary. # Migration from older versions This is outside of the scope of this post. More info: http://github.com/rethinkdb/rethinkdb/tree/next/scripts/migration
Created attachment 356370 [details] rethinkdb-1.8.0.ebuild Here's the ebuild for RethinkDB 1.8.0 and its Python driver module I'm using at the moment: - Support for Ruby and JavaScript drivers is still missing. Ruby support would require a new ebuild for ruby_protobuf. - There's no pkg_config step yet, so new databases have to be created manually. - The ebuild uses the init.d script shipped with RethinkDB, which should probably be replaced.
Created attachment 356392 [details] rethinkdb-1.8.0.ebuild Revised ebuild with pkg_config step to create a new instance via emerge --config rethinkdb
Created attachment 357166 [details] rethinkdb-1.8.1.ebuild Updated ebuild for RethinkDB 1.8.1
Created attachment 357904 [details] rethinkdb-1.8.1.ebuild Removed Java dependency from ebuild; it's not required to build RethinkDB >= 1.8.0
Created attachment 358486 [details] rethinkdb-1.9.0.ebuild - Removed dependency on static libraries - Updated to version 1.9.0
Created attachment 359882 [details] rethinkdb-1.10.0.ebuild Version bump to RethinkDB 1.10.0: - New dependency on sys-libs/ncurses (using sed to replace termcap by ncurses) - Ebuild: Fixed usage of wrong path in config step
Created attachment 364048 [details] rethinkdb-1.11.0.ebuild Version bump to RethinkDB 1.11.0: - DEPENDENCIES file was removed from package - Still depends on dev-lang/v8 (I'm not sure how to bundle v8 yet; see announcement of phasing it out as a shared lib)
Why replace termcap with ncurses? The init script needs some love and should probably check/create that log file.
As far as I can tell, termcap was removed from portage long time ago because it's unmaintained and there's no ebuild for it. ncurses provides support for the same functionality and was used as an alternative. It's also used by RethinkDB when building the Debian package. However, suggestions are welcome.
Eric: Thanks for the recap. I thought I'd give this a go shortly. Hopefully I can find someone to proxy it for me/you/us as well.
So, not having dev-lang/v8 in tree anymore will make this ebuild have to jump through hoops. Suggestions?
Created attachment 381480 [details] ebuild that builds v8 'n stuff. A horrible hackery that doesn't fully work
Created attachment 382214 [details] ebuild for rethinkdb-1.13.3 rethinkdb supported fetch v8 itself during configuration, I have successfully installed on my amd64 box, please check.
Etienne Laurin (@atnnn) told me from twitter: "Since RethinkDB 1.13, v8 is bundled in the tgz. The --fetch v8 and --static v8 flags are not necessary." I have tesed on my amd64 desktop, it emerged successfully, hope this will help.
Created attachment 385552 [details] rethinkdb-1.15.0_p1.ebuild I updated my version of the ebuild to RethinkDB 1.15.0-1: - Removed the ncurses patches from the ebuild because it's handled by RethingDB's build system now - Added Python 3.3 and 3.4 slots for the Python driver - Added stub comments for installation of systemd service files - Stripped all Ruby stub comments
Created attachment 385556 [details] rethinkdb-1.15.0_p1.ebuild RethinkDB 1.15.0-1: - Added missing dependency on net-misc/curl
Created attachment 385616 [details] rethinkdb.service systemd service file for RethinkDB
Created attachment 385618 [details] rethinkdb.tmpfilesd systemd tmpfiles.d description for RethinkDB
Created attachment 385622 [details] rethinkdb-1.15.0_p1.ebuild Updated ebuild for RethinkDB 1.15.0-1: - systemd support. To start "mydb" instance: systemctl start rethinkdb@mydb
Created attachment 395612 [details] rethinkdb-1.16.0_p1.ebuild Updated ebuild for RethinkDB 1.16.0-1: - Added USE flags for different malloc implementations. Although not RethinkDB's default for Linux system malloc is used (for me this is the only implementation that let's RethinkDB compile correctly at the moment—needs more investigation) - Added USE flags for docs
Created attachment 401298 [details] ebuild for rethinkdb-2.0.0-1
Rethinkdb 2.0.0 was released on April 14, I have successfully installed on my amd64 desktop, the ebuild is based on Erich Seifert's 1.16.0 ebuild, with tiny modification: - Bash completion was removed in version 2.0.0, see https://github.com/rethinkdb/rethinkdb/issues/719 - When compile with jemalloc, static-libs USE flag is required, https://github.com/rethinkdb/rethinkdb/issues/3741
Created attachment 404826 [details] rethinkdb-2.0.2.ebuild I tried to install rethinkdb 2.0.2 using the latest attached ebuild, but it failed with this error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/dev-db/rethinkdb-2.0.2/work/rethinkdb-2.0.2/build/external/icu_54.1/lib/libicuuc.a(putil.ao): undefined reference to symbol 'dlclose@@GLIBC_2.2.5' /lib64/libdl.so.2: error adding symbols: DSO missing from command line I had to add LDFLAGS="-ld" to conf_opts to overcome this. Of course this is most probably not the proper way to fix it.
Created attachment 409078 [details] rethinkdb-2.1.1.ebuild Version bump to RethinkDB 2.1.1. I didn't include the LDFLAGS workaround by Ilya because it compiles fine here without it.
Created attachment 429166 [details] rethinkdb-2.2.5.ebuild Version bump to RethinkDB 2.2.5
Created attachment 429180 [details] rethinkdb-2.2.5.ebuild Fixed a few QA warnings in the previous ebuild.
dev-db/rethinkdb and dev-python/python-rethinkdb are in the portage tree now: http://www.ultrabug.fr/rethinkdb-on-gentoo-linux/
Thanks everyone for your patience and help, I'm glad it's finally in tree ;)