File: configure

package info (click to toggle)
catfish 1.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 992 kB
  • sloc: python: 2,239; sh: 44; xml: 16; makefile: 9
file content (49 lines) | stat: -rwxr-xr-x 1,316 bytes parent folder | download
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
#!/bin/sh

APPNAME=catfish
VERSION=1.0.2

PYTHON=python

help () {
    echo "Supported options are:"
    echo "    --help                          print this help and exit"
    echo "    --prefix=<path>                 specify installation prefix"
    echo "        <path>/bin - will hold all executables"
    echo "        default <path> is /usr/local"
    echo "    --python=<python executable>    specify python version"
    echo "        python or python3"
    echo "        default <python executable> is $PYTHON"
}

PREFIX="/usr/local"
while [ $# -gt 0 ]; do
    case $1 in
        --help)
            help
            exit 0
            ;;
        --prefix=*)
            PREFIX=`echo $1 | sed 's/--prefix=//'`
            ;;
        --python=*)
            PYTHON=`echo $1 | sed 's/--python=//'`
            ;;
        *)
            echo "Unknown option $1"
            help
            exit 1
            ;;
    esac
    shift
done

$PYTHON build.py check $APPNAME
echo "Creating Makefile..."
sed -e s,@prefix@,$PREFIX, Makefile.in.in > Makefile.in
sed -e s,@python@,$PYTHON, Makefile.in > Makefile
echo "Creating package data..."
install -d deb/DEBIAN
sed -e s,@version@,$VERSION, control.in.in > control.in
sed -e s,@python@,$PYTHON, control.in > deb/DEBIAN/control
echo "Installation prefix is $PREFIX"