added missing deps
[fai-configs.git] / files / etc / init.d / install-mediagoblin / DEFAULT
CommitLineData
0fe7460b 1#/bin/bash
cc84a658
LMM
2echo Installing GMG into GMG_PATH_TOKEN...
3(
e101f210 4cd GMG_PATH_TOKEN
0fe7460b
LMM
5if [ ! -d mediagoblin ]; then
6
7 # Create the GMG user
9bd468c2
LMM
8 sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'"
9 sudo -u postgres psql -c "DROP DATABASE template1"
10 sudo -u postgres psql -c "CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING='UNICODE' LC_COLLATE='en_US.UTF8' LC_CTYPE='en_US.UTF8'"
11 sudo -u postgres psql -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'"
12 sudo -u postgres psql -c "UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template1'"
fd13c219 13
0fe7460b
LMM
14 sudo -u postgres createuser -A -D mediagoblin
15 # Crea te GMG database
16 sudo -u postgres createdb -E UNICODE -O mediagoblin mediagoblin
17
cc84a658 18 sudo -u mediagoblin git clone git://git.savannah.gnu.org/mediagoblin.git -b stable
0fe7460b
LMM
19
20 cd mediagoblin
cc84a658
LMM
21 sudo -u mediagoblin git submodule init && git submodule update
22
23 sudo -u mediagoblin ./bootstrap.sh && sudo -u mediagoblin ./configure && sudo -u mediagoblin make
24 sudo -u mediagoblin mkdir user_dev && sudo -u mediagoblin chmod 750 user_dev
25 sudo -u mediagoblin ./bin/easy_install flup
26
27 sudo -u mediagoblin cp /etc/mediagoblin-templates/mediagoblin.ini mediagoblin_local.ini
0fe7460b 28
cc84a658 29 sudo -u mediagoblin ./bin/gmg dbupdate
0fe7460b 30
cc84a658
LMM
31 update-rc.d mediagoblin-paster defaults
32 update-rc.d mediagoblin-celery-worker defaults
33 /etc/init.d/mediagoblin-paster start
34 /etc/init.d/mediagoblin-celery-worker start
0fe7460b 35fi
cc84a658
LMM
36) >> /var/log/fai/install-mediagoblin.log
37echo Install Completed, started mediagoblin-paster and mediagoblin-celery-worker