fixed typo
[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
ba5dc305
LMM
8 sudo -H -u postgres psql -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'"
9 sudo -H -u postgres psql -c "DROP DATABASE template1"
10 sudo -H -u postgres psql -c "CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING='UNICODE' LC_COLLATE='en_US.UTF8' LC_CTYPE='en_US.UTF8'"
11 sudo -H -u postgres psql -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'"
12 sudo -H -u postgres psql -c "UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template1'"
fd13c219 13
ba5dc305 14 sudo -H -u postgres createuser -A -D mediagoblin
0fe7460b 15 # Crea te GMG database
ba5dc305 16 sudo -H -u postgres createdb -E UNICODE -O mediagoblin mediagoblin
0fe7460b 17
ba5dc305 18 sudo -H -u mediagoblin git clone git://git.savannah.gnu.org/mediagoblin.git -b stable
0fe7460b 19
9e37eb1d 20 if [ ! -d mediagoblin-piwik ]; then
ba5dc305 21 sudo -H -u mediagoblin git clone https://github.com/ayleph/mediagoblin-piwik
55450af1 22 cp -r mediagoblin-piwik/piwik mediagoblin/mediagoblin/plugins/
9e37eb1d
LMM
23 fi
24
25 if [ ! -d mediagoblin-libreplanet ]; then
ba5dc305 26 sudo -H -u mediagoblin git clone https://vcs.fsf.org/git/mediagoblin-libreplanet.git
bcca123c 27 cp -r mediagoblin-libreplanet/mediagoblin_libreplanet mediagoblin/mediagoblin/plugins/libreplanet
9e37eb1d
LMM
28 fi
29
a62299de
LMM
30 chown -R mediagoblin.www-data mediagoblin/mediagoblin/plugins/
31
0fe7460b 32 cd mediagoblin
ba5dc305 33 sudo -H -u mediagoblin git submodule init && git submodule update
cc84a658 34
ba5dc305
LMM
35 sudo -H -u mediagoblin ./bootstrap.sh && sudo -H -u mediagoblin ./configure && sudo -H -u mediagoblin make
36 sudo -H -u mediagoblin mkdir user_dev && sudo -H -u mediagoblin chmod 750 user_dev
37 #sudo -H -u mediagoblin ./bin/easy_install flup
55450af1 38 # https://issues.mediagoblin.org/ticket/5373
ba5dc305 39 sudo -H -u mediagoblin ./bin/easy_install flup==1.0.3.dev-20110405
55450af1 40
ba5dc305 41 sudo -H -u mediagoblin cp /etc/mediagoblin-templates/mediagoblin.ini mediagoblin_local.ini
a62299de 42
ba5dc305 43 sudo -H -u mediagoblin ./bin/gmg dbupdate
0fe7460b 44
cc84a658
LMM
45 update-rc.d mediagoblin-paster defaults
46 update-rc.d mediagoblin-celery-worker defaults
47 /etc/init.d/mediagoblin-paster start
48 /etc/init.d/mediagoblin-celery-worker start
0fe7460b 49fi
cc84a658 50) >> /var/log/fai/install-mediagoblin.log
9e37eb1d 51echo Install Completed, started mediagoblin-paster and mediagoblin-celery-worker