updated on Mon Jan 16 16:00:41 UTC 2012
[aur-mirror.git] / vcd-db / vcddb.install
blob638177db4b31ed2f3ecfaf3d80d64afb07ff607d
1 # arg 1:  the new package version
2 post_install() {
3   cp /home/httpd/html/vcddb/setup/config.default /home/httpd/html/vcddb/config.php
4   chmod 666 /home/httpd/html/vcddb/config.php
5   echo
6   echo "> 1- You should uncomment ;extension=gd.so ;extension=mysql.so"
7   echo "  and set allow_url_fopen = On into your /etc/php/php.ini file."
8   echo
9   echo "> 2- Create an empty database:"
10   echo "   mysqladmin create <dbname> -u root -p"
11   echo   
12   echo "> 3- Open http://<yourhost>/vcddb/setup"
13   echo "   Then press Continue and follow the instructions."
14   echo
15   echo "> 4- After a successfull install, delete the setup folder"
16   echo "  and chmod 644 /home/httpd/html/vcddb/config.php"
17   echo "  to prevent any further writing or modification to the file."
18   echo 
19   echo
20   /bin/true
23 # arg 1:  the new package version
24 # arg 2:  the old package version
25 post_upgrade() {
26   if [ ! -e /home/httpd/html/vcddb/config.php ]; then
27   cp /home/httpd/html/vcddb/setup/config.default /home/httpd/html/vcddb/config.php
28   chmod 666 /home/httpd/html/vcddb/config.php
29   fi
31   prev_version=`echo "$2" | awk -F. '{print $2}' | awk -F- '{print $1}'`
32   new_version=`echo "$1" | awk -F. '{print $2}' | awk -F- '{print $1}'`
33   
34   if [ "$prev_version" -ne "$new_version" ]; then
35   echo
36   echo "If you upgrade from vcd-db-0.$prev_version you must follow the bellow instructions:"
37   echo
38   echo "   (Optional: backup your database)"
39   echo
40   fi
42   if [ $prev_version -ge 984 -a $prev_version -le 990 ]; then
43 #  rm -rf /home/httpd/html/vcddb/setup
44   chmod 644 /home/httpd/html/vcddb/config.php
45   echo ">1- Open the vcddb/setup/upgrade.php on your server and follow the instructions to finish the upgrade"
46   echo ">2- Delete the setup folder (rm -rf /home/httpd/html/vcddb/setup)"
47   fi
49   if [ "$prev_version" -eq "983" ] || [ "$prev_version" -eq "982" ]; then
50   echo ">1- Edit your '/home/httpd/html/vcddb/config.php' file and enter the same settings"
51   echo "  you had in your '/home/httpd/html/vcddb/classes/VCDConstants.php' file"
52   echo "    Now you can delete the file VCDConstants.php (it is no longer used)"
53   echo
54   echo ">2- Log into your mysql vcd-db database:"
55   echo "  mysql -u <db_user> -p <db_catalog>"
56   echo "  and execute:"
57   echo "    ALTER TABLE vcd_MetaData CHANGE metadata_value metadata_value VARCHAR( 250 ) NOT NULL;"
58   echo "    ALTER TABLE vcd_RssFeeds ADD isAdult TINYINT NULL DEFAULT '0', ADD isSite TINYINT NULL DEFAULT '0';"
59   echo "    INSERT INTO vcd_UserRoles(role_name, role_description) VALUES ('Adult User', 'User with Adult options enabled');"
60   echo "    UPDATE vcd_MetaDataTypes SET type_name='defaultdvd', type_description='Default DVD Settings' WHERE type_id=20;"
61   echo
62   echo ">3- Open the vcddb/setup/upgrade.php on your server"
63   echo
64   echo ">4- After a successfull install, delete the setup folder"
65   echo "   and chmod 644 /home/httpd/html/vcddb/config.php"
66   echo "   to prevent any further writing or modification to the file."
67   fi
69   if [ "$prev_version" -lt "982" ]; then
70   echo "***UPGRADING FROM VERSION PRIOR TO 0.982 IS NOT LONGER POSSIBLE FROM THIS PACKAGE!"
71   echo "***PLEASE, TRY TO UPDATE MANUALLY!"  
72   fi
74   #if [ "$prev_version" -eq "981" ] || [ "$prev_version" -eq "980" ]; then
75   #echo ">1- Copy your database settings (and proxy server settings if necessary)"
76   #echo "  from '/home/httpd/html/vcddb/classes/VCDConstants.php'"
77   #echo "  to the new '/home/httpd/html/vcddb/classes/VCDConstants.php.pacnew' file."
78   #echo "  Then: mv VCDConstants.php.pacnew VCDConstants.php"
79   #echo
80   #echo ">2- Log into your mysql vcd-db database:"
81   #echo "  mysql -u <db_user> -p <db_catalog>"
82   #echo "  and execute:"
83   #echo "  ALTER TABLE vcd_SourceSites ADD site_classname VARCHAR(20) NULL AFTER site_isFetchable;"
84   #echo "  ALTER TABLE vcd_SourceSites ADD site_image VARCHAR(50) NULL AFTER site_classname;"
85   #echo
86   #echo ">3- Open your browser and go to http://<your host>/vcddb/setup/"
87   #echo "  Then select the UPGRADE button."
88   #echo
89   #echo ">4- After a successfull update, delete the setup folder"
90   #echo "  and chmod 0644 /home/httpd/html/vcddb/classes/VCDConstants.php"
91   #echo "  to prevent any further writing or modification to the file."
92   #fi
94   #if [ "$prev_version" -lt "980" ]; then
95   #echo ">1- First, you should remove this version from your computer:"
96   #echo "     pacman -R vcd-db"
97   #echo ">2- Then, you will have to download an older release from:"
98   #echo "     http://personales.ya.com/vmromanos/arch/pkgs/vcd-db-0.981-1.pkg.tar.gz"
99   #echo "   and upgrade from that version. After that, upgrade again with the latest version."
100   #fi
101   #echo
102   /bin/true
105 # arg 1:  the old package version
106 pre_remove() {
107   /bin/true
110 op=$1
111 shift
113 $op $*