fixes for plugins
[fai-configs.git] / files / etc / init.d / install-mediagoblin / DEFAULT
... / ...
CommitLineData
1#/bin/bash
2echo Installing GMG into GMG_PATH_TOKEN...
3(
4cd GMG_PATH_TOKEN
5if [ ! -d mediagoblin ]; then
6
7 # Create the GMG user
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'"
13
14 sudo -u postgres createuser -A -D mediagoblin
15 # Crea te GMG database
16 sudo -u postgres createdb -E UNICODE -O mediagoblin mediagoblin
17
18 sudo -u mediagoblin git clone git://git.savannah.gnu.org/mediagoblin.git -b stable
19
20 if [ ! -d mediagoblin-piwik ]; then
21 sudo -u mediagoblin git clone https://github.com/ayleph/mediagoblin-piwik
22 cp -r mediagoblin-piwik/piwik mediagoblin/mediagoblin/plugins/
23 fi
24
25 if [ ! -d mediagoblin-libreplanet ]; then
26 sudo -u mediagoblin git clone https://vcs.fsf.org/git/mediagoblin-libreplanet.git
27 cp -r mediagoblin-libreplanet/mediagoblin-libreplanet mediagoblin/mediagoblin/plugins/libreplanet
28 fi
29
30 cd mediagoblin
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
38
39 # https://issues.mediagoblin.org/ticket/5373
40 sudo -u mediagoblin ./bin/easy_install flup==1.0.3.dev-20110405
41
42 sudo -u mediagoblin ./bin/gmg dbupdate
43
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
48fi
49) >> /var/log/fai/install-mediagoblin.log
50echo Install Completed, started mediagoblin-paster and mediagoblin-celery-worker