Bladeren bron

upgrading package: drupal 5.7 -> 6.0

Ralf S. Engelschall 17 jaren geleden
bovenliggende
commit
c40851b4b4
3 gewijzigde bestanden met toevoegingen van 411 en 660 verwijderingen
  1. 14 15
      drupal/drupal-apache.conf
  2. 31 25
      drupal/drupal-setup.sh
  3. 366 620
      drupal/drupal.spec

+ 14 - 15
drupal/drupal-apache.conf

@@ -5,9 +5,10 @@
 ServerRoot             @l_prefix@
 ServerAdmin            root@@l_hostname@.@l_domainname@
 ServerName             @l_hostname@.@l_domainname@
+ServerTokens           Prod
 User                   @l_rusr@
 Group                  @l_rgrp@
-Listen                 127.0.0.1:80
+Listen                 127.0.0.1:8080
 
 #   runtime files
 PidFile                @l_prefix@/var/drupal/run/apache.pid
@@ -74,27 +75,25 @@ BrowserMatch "JDK/1\.0"        force-response-1.0
     </Directory>
 </IfModule>
 
-#   configure Drupal
+#   configure PHP for Drupal
 AddType           application/x-httpd-php .php
-php_admin_flag    magic_quotes_gpc   0
-php_admin_flag    register_globals   0
-php_admin_flag    session.auto_start 0
+php_admin_flag    magic_quotes_gpc      off
+php_admin_flag    register_globals      off
+php_admin_flag    session.auto_start    off
+php_admin_flag    session.save_handler  user
+php_admin_flag    session.cache_limiter none
+php_admin_flag    error_reporting       E_ALL   
+php_admin_value   memory_limit          16M
+
+#   configure Drupal
 DocumentRoot      @l_prefix@/share/drupal
 DirectoryIndex    index.php
 ErrorDocument     404 /index.php
 ExpiresByType     text/html A1
-<Directory        "@l_prefix@/share/drupal">
+<Directory        @l_prefix@/share/drupal>
     Options       -Indexes +FollowSymLinks
-    AllowOverride None
+    AllowOverride All
     Order         allow,deny
     Allow         from all
-    RewriteEngine on
-    RewriteCond   %{REQUEST_FILENAME} !-f
-    RewriteCond   %{REQUEST_FILENAME} !-d
-    RewriteRule   ^(.*)$ index.php?q=$1 [L,QSA]
-    <Files ~ "(\.(inc|module|pl|sh|sql|theme|engine|xtmpl)|Entries|Repositories|Root|scripts|updates)$">
-        Order     deny,allow
-        Deny      from all
-    </Files>
 </Directory>
 

+ 31 - 25
drupal/drupal-setup.sh

@@ -1,35 +1,41 @@
 #!/bin/sh
 ##
-##  drupal-setup
+##  drupal-setup.sh -- Drupal RDBMS Setup Utility
 ##
 
-#   determine MySQL administrator username/password
-username=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\
+#   database configuration
+db_name="drupal"
+db_user="drupal"
+db_pass="drupal"
+
+#   determine RDBMS-specific details
+db_suser=`grep "^user" @l_prefix@/etc/mysql/my.pwd |\
           sed -e 's;^user[^=]*= *;;' -e 's; *$;;'`
-password=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\
+db_spass=`grep "^password" @l_prefix@/etc/mysql/my.pwd |\
           sed -e 's;^password[^=]*= *;;' -e 's; *$;;'`
 
-#   create the MySQL database for Drupal
-@l_prefix@/bin/mysqladmin --user=$username --password=$password create drupal
-@l_prefix@/bin/mysql --user=$username --password=$password mysql <<EOF
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES \
-      ON drupal.* \
-      TO drupal@localhost IDENTIFIED BY 'drupal';
-FLUSH PRIVILEGES;
-EOF
-
-#   configure settings.php accordingly
-@l_prefix@/lib/openpkg/shtool subst --quiet \
-    -e 's|^\( *\$db_url\) *=.*$|\1 = "mysql://drupal:drupal@localhost/drupal";|' \
-    @l_prefix@/share/drupal/sites/default/settings.php
+#   dispatch operation
+cmd="${1:-"install"}"
+case "$cmd" in
+    install )
+        #   create the database
+        @l_prefix@/bin/mysqladmin --user="$db_suser" --password="$db_spass" create "$db_name"
+        ( echo "GRANT ALL PRIVILEGES ON $db_name.* TO $db_user@localhost IDENTIFIED BY '$db_pass';"
+          echo "FLUSH PRIVILEGES;"
+        ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
 
-#   check php script memory limit
-d=`sed <@l_prefix@/etc/apache/apache-php.ini -e 's/ *;.*$//' | awk -F= '/^memory_limit/ { print $2 }' | sed -e 's/M//'`
-[ $d -lt 16 ] && echo "please consider increasing memory_limit to 16M or more in @l_prefix@/etc/apache/apache-php.ini"
+        #   activate configuration directory 
+        #   (is automatically deactivated by installer afterwards)
+        chmod 777 @l_prefix@/share/drupal/sites/default
+        ;;
+    uninstall )
+        #   remove the database
+        ( echo "DROP DATABASE $db_name;"
+        ) | @l_prefix@/bin/mysql --user="$db_suser" --password="$db_spass" mysql
 
-#   further instructions for the user
-d=`awk <@l_prefix@/etc/drupal/drupal-apache.conf '/^Listen/ { print $2 }'`
-echo "configure IP address in \"@l_prefix@/etc/drupal/drupal-apache.conf\""
-echo "run \"@l_prefix@/bin/openpkg rc drupal start\""
-echo "visit http://$d/install.php"
+        #   remove the generated configuration
+        rm -f @l_prefix@/share/drupal/sites/default/settings.php
+        rm -f @l_prefix@/var/drupal/files/*
+        ;;
+esac
 

File diff suppressed because it is too large
+ 366 - 620
drupal/drupal.spec