Skip to content

Instantly share code, notes, and snippets.

@rolfn
Last active June 2, 2020 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolfn/aa086883d43eb508bc25876ac0ab8876 to your computer and use it in GitHub Desktop.
Save rolfn/aa086883d43eb508bc25876ac0ab8876 to your computer and use it in GitHub Desktop.
CouchDB 3.x.y for openSUSE

CouchDB 3.x.y for openSUSE

The following explanations refer to »openSUSE Leap 15.1«.

Preparation

Register a required non-standard repository

Due to a bug in the version of the system repository of mozjs60 (see apache/couchdb-pkg#65) an alternative is necessary. In the upcoming version »openSUSE Leap 15.2« this is probably no longer necessary.

sudo zypper addrepo \
https://download.opensuse.org/repositories/home:/WernerFink:/mozilla/openSUSE_Leap_15.1/home:WernerFink:mozilla.repo
sudo zypper refresh 'home_WernerFink_mozilla' 

Installation of the necessary packages

sudo zypper install -t pattern devel_C_C++  
sudo zypper install --allow-vendor-change \
erlang erlang-rebar erlang-reltool erlang-epmd \
mozjs60-devel mozjs60 libmozjs-60 help2man libcurl-devel \
libicu-devel pkg-config autoconf213 mozilla-nspr-devel rpmbuild libffi-devel

Resolving a permission issue

sudo chmod o+r /usr/lib64/erlang/lib/crypto-4.2.2.2/priv/obj/*

Compilation of CouchDB 3.x.y

The following example relates to »CouchDB 3.1.0«.

git clone https://github.com/apache/couchdb-pkg.git
cd couchdb-pkg
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
make download-couch openSUSE \
  URL=http://mirror.23media.de/apache/couchdb/source/3.1.0/apache-couchdb-3.1.0.tar.gz
# or if the tar source archive has already been downloaded:
make openSUSE

Installation

sudo zypper install --allow-unsigned-rpm \
  ~/rpmbuild/RPMS/x86_64/couchdb-3.1.0-1.x86_64.rpm  

Creating an admin account

Add in /opt/couchdb/etc/local.ini:

[admins]
admin = mysecretpassword

Start & Test

sudo systemctl start couchdb.service     
sudo systemctl enable couchdb.service 

curl http://127.0.0.1:5984/

Postprocessing

Creation of possibly necessary databases:

sudo curl -X PUT http://admin:mysecretpassword@127.0.0.1:5984/_users
sudo curl -X PUT http://admin:mysecretpassword@127.0.0.1:5984/_replicator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment