Skip to content

Commit

Permalink
Merge pull request #2 from mhall119/add-snap-packaging
Browse files Browse the repository at this point in the history
Add snap packaging that was previously in the main repo
  • Loading branch information
wohali committed Apr 17, 2017
2 parents 5be82f0 + 3eb30cd commit 3663a37
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
10 changes: 10 additions & 0 deletions snap/snap.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; Snap-specific Configuration Settings

[couchdb]
database_dir = /var/snap/couchdb/common/data
view_index_dir = /var/snap/couchdb/common/data

[log]
writer = file
file = /var/snap/couchdb/current/couchdb.log
;level = info
24 changes: 24 additions & 0 deletions snap/snap_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

# The purpose of this script is to echo an OS specific command before launching
# the actual process. This provides a way for Erlang to hard-kill its external
# processes.

export HOME=$SNAP_DATA
export ERL_FLAGS="-couch_ini ${SNAP}/rel/couchdb/etc/default.ini ${SNAP}/rel/couchdb/etc/snap.ini ${SNAP_DATA}/local.ini"
if [ ! -e ${SNAP_DATA}/local.ini ]; then
touch ${SNAP_DATA}/local.ini
fi

exec ${SNAP}/rel/couchdb/bin/couchdb
82 changes: 82 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: couchdb
version: 2.0
summary: Document based database
description: CouchDB is a database that completely embraces the web. Store your data with JSON documents. Access your documents and query your indexes with your web browser, via HTTP. Index, combine, and transform your documents with JavaScript.
confinement: strict
grade: stable

apps:
server:
daemon: simple
command: rel/couchdb/bin/snap_run
plugs: [network-bind, process-control, mount-observe]
couchdb:
command: rel/couchdb/bin/snap_run
plugs: [network-bind]
parts:
couchdb:
plugin: make
source: https://github.com/apache/couchdb.git
source-type: git
prepare: |
./configure --disable-docs
build: |
make release
cp -ra ./rel $SNAPCRAFT_PART_INSTALL
cp -ra ./bin $SNAPCRAFT_PART_INSTALL
build-packages:
- binutils
- libc6-dev
- gcc
- g++
- make
- erlang-dev
- erlang-base-hipe
- erlang-reltool
- libcurl4-openssl-dev
- libmozjs185-dev
- libnspr4-dev
- libicu-dev
- icu-devtools
# For erlang/rebar processing
- erlang-nox
- erlang-os-mon
- erlang-syntax-tools
# For fauxton
- nodejs-dev
- nodejs-legacy
- npm
stage:
- rel
- bin
prime:
- rel
- bin

snap-config:
plugin: dump
source: ./snap/
organize:
snap.ini: rel/couchdb/etc/snap.ini
snap_run: rel/couchdb/bin/snap_run

erlang:
plugin: nil
stage-packages:
- erlang-base-hipe
- erlang-crypto
- erlang-eunit
- erlang-inets
- erlang-os-mon
- erlang-public-key
- erlang-ssl
- erlang-syntax-tools
- erlang-tools
- erlang-xmerl
- libc6
- libcurl3
- libgcc1
- libicu55
- libmozjs185-1.0
- libstdc++6

0 comments on commit 3663a37

Please sign in to comment.