Install the rocksdb package instead of building it

collocatordb 1.5.0 builds against any recent rocksdb, so neither CI nor the
docker image has to build rocksdb 5.11 from source anymore. CI installs
librocksdb-dev, the image rocksdb-dev.

Verified with gitlab-ci-local: the job passes in 1.4 minutes instead of 5.45,
with librocksdb-dev 7.8.3 of the image. For the docker image, collocatordb was
built against alpine's rocksdb 11.0.4 with the package list of the Dockerfile,
and Makefile.PL accepts the resulting library.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Change-Id: I24f38158ac5faed9802cf0955617de064580c016
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8a0d1c1..6c275ec 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -33,28 +33,12 @@
 
     - start_section install_linux_packages "Installing missing Linux packages"
     - mkdir -pv $APT_CACHE_DIR ccache
-    - apt-get update && apt-get -o dir::cache::archives="$APT_CACHE_DIR" -y install ccache cmake libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev libomp-dev
+    - apt-get update && apt-get -o dir::cache::archives="$APT_CACHE_DIR" -y install ccache cmake librocksdb-dev libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev libomp-dev
     # ccache only makes the build faster, it must never be able to make it fail,
     # so everything that uses it is guarded and CCACHE_OPTS stays empty without it
     - if CCACHE=$(command -v ccache); then ln -sf "$CCACHE" /usr/local/sbin/gcc && ln -sf "$CCACHE" /usr/local/sbin/g++ && CCACHE_OPTS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"; else echo "ccache is not available - building without it"; CCACHE_OPTS=""; fi
     - end_section install_linux_packages
 
-    - start_section install_rocksdb_static "Building and installing rocksdb-static"
-    - git clone https://github.com/kupietz/rocksdb.git -b 5.11.fb --single-branch
-    - cd rocksdb
-    - export PROCS=$(nproc)
-    - make -j $PROCS static_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
-    - command -v ccache > /dev/null && ccache --show-stats || true
-    - make install-static DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
-    - end_section install_rocksdb_static
-
-    - start_section install_rocksdb_shared "Building and installing rocksdb-shared"
-    - make -j $PROCS shared_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
-    - make install-shared DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
-    - ldconfig
-    - cd ..
-    - end_section rocksdb_shared
-
     - start_section install_collocatordb "Building and installing collocatordb"
     - git clone "https://korap.ids-mannheim.de/gerrit/ids-kl/collocatordb"
     - cd collocatordb
diff --git a/Dockerfile b/Dockerfile
index 54720ef..caa9fb1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@
             perl-inline-c \
             g++ \
             make \
-            cmake gflags-dev snappy-dev zlib-dev zstd-dev lz4-dev bzip2-dev linux-headers \
+            cmake rocksdb-dev gflags-dev snappy-dev zlib-dev zstd-dev lz4-dev bzip2-dev linux-headers \
             curl && \
     set -o pipefail
 
@@ -19,27 +19,13 @@
 RUN git config --global user.email "korap+docker@ids-mannheim.de" && \
     git config --global user.name "Docker"
 
-# Install RocksDB
-RUN export PROCS=$(nproc) && \
-    git clone https://github.com/kupietz/rocksdb.git -b 5.11.fb --single-branch && \
-    cd rocksdb && \
-    mkdir -p build && \
-    cd build && \
-    cmake .. -DWITH_SNAPPY=1 -DWITH_LZ4=1 -DWITH_ZLIB=1 -DWITH_GFLAGS=1 && \
-    make -j $PROCS && \
-    make install && \
-    ln -s /usr/lib/librocksdb.so.5.11.4 /usr/lib/librocksdb.so.5.11
-
-RUN cd /derekovecs && \
-    rm -rf rocksdb
-
-# Install collocatordb
+# Install collocatordb, which builds against the rocksdb package
 RUN git clone "https://korap.ids-mannheim.de/gerrit/ids-kl/collocatordb" && \
     cd collocatordb && \
     mkdir -p build && \
     cd build && \
     cmake .. && \
-    make && \
+    make -j $(nproc) && \
     make install
 
 RUN cd /derekovecs && \