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)
19 LOG
=$WEB/log
/logSetup.txt
21 GITMAIN
=/home
/openemr
/git
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
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 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
53 git clone git
://github.com
/openemr
/openemr.git
55 git checkout origin
/rel-400
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
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 development_translations
=yes >> $LOG
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
105 sed -i 's/^extension = suhosin.so/; extension = suhosin.so/' $SUHOSINCONF
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
143 # Save the tar.gz cvs package
145 tar -czf $WEB/files
/openemr-cvs.
tar.gz openemr
147 md5sum openemr-cvs.
tar.gz
> openemr-linux-md5.txt
149 # Save the .zip cvs package
151 zip -rq $WEB/files
/openemr-cvs.
zip openemr
153 md5sum openemr-cvs.
zip > openemr-windows-md5.txt
155 # Create the time stamp
160 echo "Done creating OpenEMR Development packages"
161 echo "Done creating OpenEMR Development packages" >> $LOG