ssl
[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 19
9e37eb1d
LMM
20 if [ ! -d mediagoblin-piwik ]; then
21 sudo -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
26 sudo -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
0fe7460b 30 cd mediagoblin
cc84a658
LMM
31 sudo -u mediagoblin git submodule init && git submodule update
32
33 sudo -u mediagoblin ./bootstrap.sh && sudo -u mediagoblin ./configure && sudo -u mediagoblin make
34 sudo -u mediagoblin mkdir user_dev && sudo -u mediagoblin chmod 750 user_dev
35 sudo -u mediagoblin ./bin/easy_install flup
36
37 sudo -u mediagoblin cp /etc/mediagoblin-templates/mediagoblin.ini mediagoblin_local.ini
0fe7460b 38
55450af1
LMM
39 # https://issues.mediagoblin.org/ticket/5373
40 sudo -u mediagoblin ./bin/easy_install flup==1.0.3.dev-20110405
41
cc84a658 42 sudo -u mediagoblin ./bin/gmg dbupdate
0fe7460b 43
cc84a658
LMM
44 update-rc.d mediagoblin-paster defaults
45 update-rc.d mediagoblin-celery-worker defaults
46 /etc/init.d/mediagoblin-paster start
47 /etc/init.d/mediagoblin-celery-worker start
0fe7460b 48fi
cc84a658 49) >> /var/log/fai/install-mediagoblin.log
9e37eb1d 50echo Install Completed, started mediagoblin-paster and mediagoblin-celery-worker