Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: test-for-unexp…
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 131 lines (111 sloc) 3.223 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
#! /bin/sh -e

# 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.

basename=`basename "$0"`

staticdir="%localbuilddatadir%"
erlanglibdir="%localerlanglibdir%"
couchversion="%version%"
dbdir="%localstatelibdir%"
viewdir="%localstatelibdir%"
confdir="%localconfdir%"
urifile="%localstaterundir%/couch.uri"
logdir="%localstatelogdir%"

version () {
    cat << EOF
$basename - %package_name% configuration helper %version%

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.

EOF
}

usage()
{
    cat << EOF
Usage: $basename [OPTION]

The $basename command runs the %package_name% configuration helper
script.

Options:

  --erl-libs-dir Erlang library directory
  --config-dir configuration directory
  --db-dir database dirrectory
  --view-dir view index directory
  --static-dir static asset directory
  --doc-dir documentation directory
  --log-dir log directory
  --uri-file daemon sockets file
  --couch-version version of Apache CouchDB
  --version version of $basename
  --help Print usage

If you want to add an option in couch-config or report bugs please do it
at <%bug_uri%>.
EOF
}
  

if [ $# -lt 1 ]; then
    usage
    exit 1
fi


while [ $# -gt 0 ];
do
    arg="$1"
    var=`echo $arg | sed -e 's/^[^=]*=//'`
    
    case "$arg" in
        --erl-libs-dir)
            echo $erlanglibdir
            ;;
        --config-dir)
            echo $confdir
            ;;
        --db-dir)
            echo $dbdir
            ;;
        --view-dir)
            echo $viewdir
            ;;
        --static-dir)
            echo $staticdir
            ;;
        --doc-dir)
            echo $staticdir
            ;;
        --log-dir)
            echo $logdir
            ;;
        --uri-file)
            echo $urifile
            ;;
        --couch-version)
            echo $couchversion
            ;;
        --version)
            version
            exit 0
            ;;
        --help)
            usage
            exit 0
            ;;
        *|-*)
echo $basename: ERROR Unknown Option $arg 1>&2
            echo 1>&2
            usage 1>&2
            echo "### $basename: Exitting." 1>&2
            exit 1;
            ;;
    esac
    shift
done

exit 0
Something went wrong with that request. Please try again.