installing console-common uninstalls cryptsetup
[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 /etc/init.d/postgresql start
7 # Create the GMG user
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'"
13
14 sudo -H -u postgres createuser -A -D mediagoblin
15 # Crea te GMG database
16 sudo -H -u postgres createdb -E UNICODE -O mediagoblin mediagoblin
17
18 sudo -H -u mediagoblin git clone git://git.savannah.gnu.org/mediagoblin.git -b stable
19
20 if [ ! -d mediagoblin-piwik ]; then
21 sudo -H -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 -H -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 chown -R mediagoblin.www-data mediagoblin/mediagoblin/plugins/
31
32 cd mediagoblin
33 sudo -H -u mediagoblin git submodule init && git submodule update
34
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
38 # https://issues.mediagoblin.org/ticket/5373
39 sudo -H -u mediagoblin ./bin/easy_install flup==1.0.3.dev-20110405
40
41 sudo -H -u mediagoblin cp /etc/mediagoblin-templates/mediagoblin.ini mediagoblin_local.ini
42 sudo -H -u mediagoblin cp /etc/mediagoblin-templates/paste.ini paste_local.ini
43
44 sudo -H -u mediagoblin ./bin/gmg dbupdate
45
46 update-rc.d mediagoblin-paster defaults
47 update-rc.d mediagoblin-celery-worker defaults
48 /etc/init.d/mediagoblin-paster start
49 /etc/init.d/mediagoblin-celery-worker start
50fi
51) &>> /var/log/fai/install-mediagoblin.log
52echo Install Completed, started mediagoblin-paster and mediagoblin-celery-worker