use official translation set in the 4.1 development demo
[openemr.git] / contrib / util / installScripts / cvsDemoInstall
blob1b4ec6aa798c173d9abd819173739e551509d291
1 #!/bin/sh
2 # Copyright (C) 2010 Brady Miller <brady@sparmy.com>
4 #This program is free software; you can redistribute it and/or modify
5 #it under the terms of the GNU General Public License as published by
6 #the Free Software Foundation; either version 2 of the License, or
7 #(at your option) any later version.
9 #This script is called by the the OpenEMR developer demos and
10 # developer appliance. It configures the Developer Demos and the
11 # Developer Appliance with the most recent git repository.
12 # (Note it first actually grabs the cvs version)
13 # Logs errors.
16 # PATH VARIABLES
17 WEB=/var/www/html
18 OPENEMR=$WEB/openemr
19 LOG=$WEB/log/logSetup.txt
20 CVS=/home/openemr/cvs
21 GITMAIN=/home/openemr/git
22 GIT=$GITMAIN/openemr
23 TMPDIR=/tmp/openemr-tmp
25 # PATH OF INSTALL SCRIPT
26 INST=$OPENEMR/contrib/util/installScripts/InstallerAuto.php
27 INSTTEMP=$OPENEMR/contrib/util/installScripts/InstallerAutoTemp.php
29 # Turn off apache to avoid users messing up while setting up
30 # (start it again below after install/configure openemr
31 service httpd stop
33 # Connect to a new mandriva package repository (official repository no longer supports mandriva 2008)
34 echo "Updating new Mandriva Package repository. This is a 100MB download, so may take several minutes."
35 echo "Updating new Mandriva Package repository. This is a 100MB download, so may take several minutes." >> $LOG
36 urpmi.addmedia main http://ftp.ussg.iu.edu/linux/mandrake/official/2008.0/i586/media/main/release with media_info/hdlist.cz
37 urpmi.addmedia --update main_updates http://ftp.ussg.iu.edu/linux/mandrake/official/2008.0/i586/media/main/updates with media_info/hdlist.cz
38 urpmi.addmedia contrib http://ftp.ussg.iu.edu/linux/mandrake/official/2008.0/i586/media/contrib/release with media_info/hdlist.cz
39 urpmi.addmedia --update contrib_updates http://ftp.ussg.iu.edu/linux/mandrake/official/2008.0/i586/media/contrib/updates with media_info/hdlist.cz
41 # Install php-gd (graphics), php-mbstring (multibyte character support), php-zip, php-xsl and perl-CGI packages
42 # and restart apache (done after below suhosin patch).
43 echo "Installing gd(graphics) and mbstring(multibyte support) and zip php packages and xsl php package and perl-CGI package and git packages..."
44 echo "Installing gd(graphics) and mbstring(multibyte support) and zip php packages and xsl php package and perl-CGI package and git packages..." >> $LOG
45 urpmi --auto php-gd php-mbstring php-zip php-xsl php-curl php-mcrypt perl-CGI patch git-core qgit >> $LOG
47 # COLLECT THE GIT REPO (if it doesn't exist)
48 if ! [ -d $GITMAIN ]; then
49 echo "Downloading the OpenEMR git repository"
50 echo "Downloading the OpenEMR git repository" >> $LOG
51 mkdir -p $GITMAIN
52 cd $GITMAIN
53 git clone git://github.com/openemr/openemr.git
54 cd openemr
55 git checkout origin/rel-410
56 cd ..
57 else
58 echo "The OpenEMR git repository already exist"
59 echo "The OpenEMR git repository already exist" >> $LOG
62 # COPY THE GIT REPO OPENEMR COPY TO THE WEB DIRECTOY
63 echo "Copy git OpenEMR to web directory"
64 echo "Copy git OpenEMR to web directory" >> $LOG
65 rm -fr $OPENEMR/*
66 rsync --recursive --exclude .git $GIT/* $OPENEMR/
68 #INSTALL AND CONFIGURE OPENEMR
69 echo "Configuring OpenEMR"
70 echo "Configuring OpenEMR" >> $LOG
72 # Set file and directory permissions
73 chmod 666 $OPENEMR/sites/default/sqlconf.php
74 chown -R apache:apache $OPENEMR/sites/default/documents
75 chown -R apache:apache $OPENEMR/sites/default/edi
76 chown -R apache:apache $OPENEMR/sites/default/era
77 chown -R apache:apache $OPENEMR/library/freeb
78 chown -R apache:apache $OPENEMR/sites/default/letter_templates
79 chown -R apache:apache $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/cache
80 chown -R apache:apache $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/compiled
81 chown -R apache:apache $OPENEMR/gacl/admin/templates_c
83 # Run installer class for the demo (note to avoid malicious use, script is activated by removing an exit command,
84 # and the active script is then removed after completion.
85 sed -e 's@^exit;@ @' <$INST >$INSTTEMP
86 php -f $INSTTEMP >> $LOG
87 rm -f $INSTTEMP
89 #reinstitute file permissions
90 chmod 644 $OPENEMR/sites/default/sqlconf.php
91 echo "Done configuring OpenEMR"
92 echo "Done configuring OpenEMR" >> $LOG
94 #Patch the suhosin bug
95 SUHOSINCONF=/etc/php.d/Z98_suhosin.ini
96 echo "Disabling suhosin patch which is not compatible with OpenEMR"
97 echo "Disabling suhosin patch which is not compatible with OpenEMR" >> $LOG
98 echo " In /etc/php.d/Z98_suhosin.ini file commenting out:"
99 echo " In /etc/php.d/Z98_suhosin.ini file commenting out:" >> $LOG
100 echo " extension = suhosin.so"
101 echo " extension = suhosin.so" >> $LOG
102 echo " Then will restart apache."
103 echo " Then will restart apache." >> $LOG
104 echo ""
105 sed -i 's/^extension = suhosin.so/; extension = suhosin.so/' $SUHOSINCONF
106 service httpd start
107 echo ""
109 #Replace manual with newest version and add the refresh script
110 echo "Configuring appliance"
111 echo "Configuring appliance" >> $LOG
112 cp -f $OPENEMR/contrib/util/installScripts/cvsDemoMisc/developerApplianceManual.txt /home/openemr/docs/manual.txt
113 chown openemr:openemr /home/openemr/docs/manual.txt
114 cp -f $OPENEMR/contrib/util/installScripts/cvsDemoMisc/developerApplianceManual.txt $WEB/manual.txt
115 cp -f $OPENEMR/contrib/util/installScripts/cvsDemoMisc/refresh /home/openemr/git/
116 chown openemr:openemr /home/openemr/git/refresh
117 chmod +x /home/openemr/git/refresh
118 echo "Done configuring appliance"
119 echo "Done configuring appliance" >> $LOG
121 #Package the development version into a tarball and zip file to be available thru web browser
122 # This is basically to allow download of most recent cvs version from the cvs Demo appliance
123 # It will also ease transfer/testing openemr on windows systems when using the Developer appliance
124 echo "Creating OpenEMR Development packages"
125 echo "Creating OpenEMR Development packages" >> $LOG
127 # Prepare the development package
128 mkdir -p $TMPDIR/openemr
129 rsync --recursive --exclude .git $GIT/* $TMPDIR/openemr/
130 chmod a+w $TMPDIR/openemr/sites/default/sqlconf.php
131 chmod -R a+w $TMPDIR/openemr/sites/default/documents
132 chmod -R a+w $TMPDIR/openemr/sites/default/edi
133 chmod -R a+w $TMPDIR/openemr/sites/default/era
134 chmod -R a+w $TMPDIR/openemr/library/freeb
135 chmod -R a+w $TMPDIR/openemr/sites/default/letter_templates
136 chmod -R a+w $TMPDIR/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache
137 chmod -R a+w $TMPDIR/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled
138 chmod -R a+w $TMPDIR/openemr/gacl/admin/templates_c
140 # Create the web file directory
141 mkdir $WEB/files
143 # Save the tar.gz cvs package
144 cd $TMPDIR
145 rm -f $WEB/files/openemr-cvs.tar.gz
146 tar -czf $WEB/files/openemr-cvs.tar.gz openemr
147 cd $WEB/files
148 md5sum openemr-cvs.tar.gz > openemr-linux-md5.txt
150 # Save the .zip cvs package
151 cd $TMPDIR
152 rm -f $WEB/files/openemr-cvs.zip
153 zip -rq $WEB/files/openemr-cvs.zip openemr
154 cd $WEB/files
155 md5sum openemr-cvs.zip > openemr-windows-md5.txt
157 # Create the time stamp
158 date > date-cvs.txt
160 # Clean up
161 rm -fr $TMPDIR
162 echo "Done creating OpenEMR Development packages"
163 echo "Done creating OpenEMR Development packages" >> $LOG