forked from pet-comp-ufsc/capim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·45 lines (39 loc) · 1.17 KB
/
configure
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
#!/bin/sh
show_help(){
echo "modo de usar: configure --base-path=* [opcoes]"
echo
echo " --python-bin=<caminho> caminho do executável do python no servidor"
echo " --release habilita otimização, facebook e google analytics"
echo " --base-path=<caminho> caminho da pasta principal do CAPIM no servidor"
echo " --subdir=<caminho> subdiretório em que o CAPIM se encontra no site"
echo " --cgi usar cgi no lugar de fcgi"
exit 1
}
PYTHON_BIN=/usr/bin/python
RELEASE=0
SUBDIR=
CGI=fcgi
for opt do
optval="${opt#*=}"
case "$opt" in
--python-bin=*) PYTHON_BIN=$optval ;;
--release) RELEASE=1 ;;
--base-path=*) BASE_PATH=$optval ;;
--subdir=*) SUBDIR=$optval ;;
--cgi) CGI=cgi ;;
*) show_help ;;
esac
done
[ -z "$BASE_PATH" ] && show_help
cat > config.mak << EOF
PYTHON_BIN=${PYTHON_BIN}
RELEASE=${RELEASE}
BASE_PATH=${BASE_PATH}
CGI=${CGI}
EOF
cat > .htaccess << EOF
RewriteEngine On
RewriteBase /${SUBDIR}
RewriteRule ^dispatch\.${CGI}/ - [L]
RewriteRule ^(.*)$ dispatch.${CGI}/\$1 [L]
EOF