Repository: couchdb-ci Updated Branches: refs/heads/master acde835e4 -> 5dda73dee
Add dependency installer for FreeBSD Project: http://git-wip-us.apache.org/repos/asf/couchdb-ci/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-ci/commit/5dda73de Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ci/tree/5dda73de Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ci/diff/5dda73de Branch: refs/heads/master Commit: 5dda73deec3b1e320135133fc72b3983ca0f0f23 Parents: acde835 Author: Joan Touzet <[email protected]> Authored: Tue Jun 26 21:30:56 2018 -0400 Committer: Joan Touzet <[email protected]> Committed: Tue Jun 26 21:30:56 2018 -0400 ---------------------------------------------------------------------- bin/detect-os.sh | 5 ++++ bin/install-dependencies.sh | 7 +++++ bin/pkg-dependencies.sh | 58 ++++++++++++++++++++++++++++++++++++++++ bin/pkg-erlang.sh | 44 ++++++++++++++++++++++++++++++ 4 files changed, 114 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/5dda73de/bin/detect-os.sh ---------------------------------------------------------------------- diff --git a/bin/detect-os.sh b/bin/detect-os.sh index 610e959..f664f33 100755 --- a/bin/detect-os.sh +++ b/bin/detect-os.sh @@ -100,6 +100,11 @@ case "${OSTYPE}" in fi ;; + freebsd*) + echo "Detected OS: FreeBSD" + # use userland version + VERSION=$(freebsd-version -u | cut -d '-' -f1) + ;; *bsd*) # TODO: detect netbsd vs. freebsd vs. openbsd? echo "Detected OS: BSD - UNSUPPORTED" http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/5dda73de/bin/install-dependencies.sh ---------------------------------------------------------------------- diff --git a/bin/install-dependencies.sh b/bin/install-dependencies.sh index 2431dbf..aad0e64 100755 --- a/bin/install-dependencies.sh +++ b/bin/install-dependencies.sh @@ -84,6 +84,13 @@ case "${OSTYPE}" in # useful for other platforms below: # https://github.com/kerl/kerl/issues/240 + freebsd*) + NODEVERSION=${NODEVERSION} ERLANGVERSION=${ERLANGVERSION} \ + ${SCRIPTPATH}/pkg-dependencies.sh ${JSINSTALL} + if [[ ! ${SKIPERLANG} ]]; then + ERLANGVERSION=${ERLANGVERSION} ${SCRIPTPATH}/pkg-erlang.sh + fi + ;; bsd*) # TODO: detect netbsd vs. freebsd vs. openbsd? echo "Detected OS: BSD - UNSUPPORTED" http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/5dda73de/bin/pkg-dependencies.sh ---------------------------------------------------------------------- diff --git a/bin/pkg-dependencies.sh b/bin/pkg-dependencies.sh new file mode 100755 index 0000000..92d503c --- /dev/null +++ b/bin/pkg-dependencies.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +# This shell script installs all OS package dependencies for Apache +# CouchDB 2.x for pkg-based systems such as FreeBSD. + +# stop on error +set -e + +# Check if running as root +if [[ ${EUID} -ne 0 ]]; then + echo "Sorry, this script must be run as root." + echo "Try: sudo $0 $*" + exit 1 +fi + +# Upgrade all packages +pkg upgrade -y + +pkg install -y gmake help2man openssl icu curl git bash \ + autoconf automake libtool node8 npm-node8 lang/python \ + py27-sphinx py27-pip + +# rest of python dependencies +pip install --upgrade sphinx_rtd_theme nose requests hypothesis + +# TODO: package building stuff? + +# convenience stuff for the CI workflow maintainer ;) +pkg install -y vim-tiny screen wget + +# js packages, as long as we're not told to skip them +if [[ $1 != "nojs" ]]; then + pkg install -y spidermonkey185 +else + # install js build-time dependencies only + # we can't add the CouchDB repo here because the plat may not exist yet + pkg install -y libffi autotools +fi + +# Erlang is installed by pkg-erlang.sh + http://git-wip-us.apache.org/repos/asf/couchdb-ci/blob/5dda73de/bin/pkg-erlang.sh ---------------------------------------------------------------------- diff --git a/bin/pkg-erlang.sh b/bin/pkg-erlang.sh new file mode 100755 index 0000000..b0242b2 --- /dev/null +++ b/bin/pkg-erlang.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +# This shell script installs Erlang dependencies for Apache +# CouchDB 2.x for deb-based systems. +# +# While these scripts are primarily written to support building CI +# Docker images, they can be used on any workstation to install a +# suitable build environment. + +# stop on error +set -e + +# TODO: support Mint, Devuan, etc. + +# Check if running as root +if [[ ${EUID} -ne 0 ]]; then + echo "Sorry, this script must be run as root." + echo "Try: sudo $0 $*" + exit 1 +fi + +# you DID run apt-dependencies.sh first, didn't you? + +pkg install -y erlang + +# TODO: support installing a specific Erlang version from ${ERLANGVERSION} +# perhaps using kerl?
