fix content type for cover
[nikiroo-utils.git] / configure.sh
CommitLineData
08fe2e33
NR
1#!/bin/sh
2
3# default:
4PREFIX=/usr/local
5PROGS="java javac jar make sed"
6
24c18093 7IMG=be/nikiroo/utils/ui/ImageUtilsAwt
9119671d 8
08fe2e33
NR
9valid=true
10while [ "$*" != "" ]; do
9119671d
NR
11 key=`echo "$1" | cut -f1 -d=`
12 val=`echo "$1" | cut -f2 -d=`
08fe2e33 13 case "$key" in
9119671d
NR
14 --)
15 ;;
16 --help) # This help message
17 echo The following arguments can be used:
18 cat "$0" | grep '^\s*--' | grep '#' | while read ln; do
19 cmd=`echo "$ln" | cut -f1 -d')'`
20 msg=`echo "$ln" | cut -f2 -d'#'`
21 echo " $cmd$msg"
22 done
23 ;;
24 --prefix) #=PATH Change the prefix to the given path
08fe2e33
NR
25 PREFIX="$val"
26 ;;
27 *)
28 echo "Unsupported parameter: '$1'" >&2
9119671d
NR
29 echo >&2
30 sh "$0" --help >&2
08fe2e33
NR
31 valid=false
32 ;;
33 esac
34 shift
35done
36
37[ $valid = false ] && exit 1
38
39MESS="A required program cannot be found:"
40for prog in $PROGS; do
41 out="`whereis -b "$prog" 2>/dev/null`"
42 if [ "$out" = "$prog:" ]; then
43 echo "$MESS $prog" >&2
44 valid=false
45 fi
46done
47
48[ $valid = false ] && exit 2
49
a6395bef
NR
50if [ "`whereis tput`" = "tput:" ]; then
51 ok='"[ ok ]"';
52 ko='"[ !! ]"';
53 cols=80;
54else
7e50d389
NR
55 #ok='"`tput bold`[`tput setf 2` OK `tput init``tput bold`]`tput init`"';
56 #ko='"`tput bold`[`tput setf 4` !! `tput init``tput bold`]`tput init`"';
57 ok='"`tput bold`[`tput setaf 2` OK `tput init``tput bold`]`tput init`"';
58 ko='"`tput bold`[`tput setaf 1` !! `tput init``tput bold`]`tput init`"';
a6395bef
NR
59 cols='"`tput cols`"';
60fi;
61
08fe2e33 62echo "MAIN = be/nikiroo/fanfix/Main" > Makefile
d7367179 63echo "MORE = $IMG" >> Makefile
92fb0719 64echo "TEST = be/nikiroo/fanfix/test/Test" >> Makefile
a6395bef 65echo "TEST_PARAMS = $cols $ok $ko" >> Makefile
08fe2e33
NR
66echo "NAME = fanfix" >> Makefile
67echo "PREFIX = $PREFIX" >> Makefile
d7367179 68echo "JAR_FLAGS += -C bin/ org -C bin/ be -C ./ LICENSE -C ./ VERSION -C libs/ licenses" >> Makefile
08fe2e33
NR
69
70cat Makefile.base >> Makefile
71