newspaint

Documenting Problems That Were Difficult To Find The Answer To

Monthly Archives: Aug 2021

Building CouchDB Package for Debian Bullseye

Presently (as of 2021-08-24) there’s no Debian package available for Debian Bullseye.

The package(s) can be built as follows (on a system with Docker) following the instructions at the couchdb-pkg project.

Preparation

First, pull a Docker image for distribution bullseye with Erlang (available distributions can be browsed at the Docker website):

$ docker pull apache/couchdbci-debian:bullseye-erlang-20.3.8.26-1
bullseye-erlang-20.3.8.26-1: Pulling from apache/couchdbci-debian
cf7e31f85220: Pull complete 
cf6d9735a36c: Pull complete 
3e52071c23c0: Pull complete 
07aa69ba7ab0: Pull complete 
3ae4f423f04a: Pull complete 
283ce036d8ae: Pull complete 
f1191d719a55: Pull complete 
Digest: sha256:f15fc70c274bc84a92e63da0d26a36db71e31dfc60bc8af7014d431b8ea2829c
Status: Downloaded newer image for apache/couchdbci-debian:bullseye-erlang-20.3.8.26-1
docker.io/apache/couchdbci-debian:bullseye-erlang-20.3.8.26-1

Launch all of the following commands from within a shell of the Docker container just fetched:

$ docker run -i -t apache/couchdbci-debian:bullseye-erlang-20.3.8.26-1 /bin/bash
jenkins@e242ab25768f:/

Clone the Git repository of the build scripts for CouchDB:

jenkins@e242ab25768f:/ mkdir ~/git; cd ~/git; git clone https://github.com/apache/couchdb-pkg.git
jenkins@e242ab25768f:/ cd ~/git/couchdb-pkg

Install build dependencies (don’t forget to update first):

jenkins@e242ab25768f:/ apt-get update
jenkins@e242ab25768f:/ apt-get install libffi-dev pkg-kde-tools python

Build the JavaScript Packages

Build the JavaScript package first (required for the CouchDB build later):

jenkins@e242ab25768f:/ make couch-js-debs PLATFORM=$(lsb_release -cs)

Grab a copy of the JavaScript packages that have just been built:

jenkins@e242ab25768f:/ ls ~/git/couchdb-pkg/js/*.deb
/home/jenkins/git/couchdb-pkg/js/couch-libmozjs185-1.0-dbgsym_1.8.5-1.0.0+couch-2~bullseye_amd64.deb
/home/jenkins/git/couchdb-pkg/js/couch-libmozjs185-1.0_1.8.5-1.0.0+couch-2~bullseye_amd64.deb
/home/jenkins/git/couchdb-pkg/js/couch-libmozjs185-dev_1.8.5-1.0.0+couch-2~bullseye_amd64.deb
jenkins@e242ab25768f:/ scp ~/git/couchdb-pkg/js/*.deb user@host:/tmp/

Build the CouchDB Packages

Before we build the CouchDB packages we need to install the development version of the JavaScript package we just built, as well as download the CouchDB source.

jenkins@e242ab25768f:/ sudo dpkg -i ~/git/couchdb-pkg/js/couch-libmozjs185-dev_1.8.5-1.0.0+couch-2~bullseye_amd64.deb ~/git/couchdb-pkg/js/couch-libmozjs185-1.0_1.8.5-1.0.0+couch-2~bullseye_amd64.deb
jenkins@e242ab25768f:/ wget -O /tmp/apache-couchdb-3.1.1.tar.gz https://dist.apache.org/repos/dist/release/couchdb/source/3.1.1/apache-couchdb-3.1.1.tar.gz

Now build the CouchDB packages:

jenkins@e242ab25768f:/ make copy-couch $(lsb_release -cs) COUCHTARBALL=/tmp/apache-couchdb-3.1.1.tar.gz PLATFORM=$(lsb_release -cs)

And copy the CouchDB packages for later installation:

jenkins@e242ab25768f:/ ls ~/git/couchdb-pkg/pkgs/couch/*.deb
/home/jenkins/git/couchdb-pkg/pkgs/couch/couchdb-dbgsym_3.1.1~bullseye_amd64.deb
/home/jenkins/git/couchdb-pkg/pkgs/couch/couchdb_3.1.1~bullseye_amd64.deb
jenkins@e242ab25768f:/ scp ~/git/couchdb-pkg/pkgs/couch/*.deb user@host:/tmp/

Installation of Newly Created Packages

To install the newly created packages first install dependencies, then install the packages (the JavaScript and the CouchDB packages):

$ apt-get install libnspr4 curl libcurl4
$ LC_ALL=C sudo dpkg -i /tmp/couchdb_3.1.1~bullseye_amd64.deb /tmp/couch-libmozjs185-1.0_1.8.5-1.0.0+couch-2~bullseye_amd64.deb

All done, CouchDB should now be installed on Debian Bullseye!