Fix on debian package

This commit is contained in:
Laurent Destailleur 2010-01-06 12:16:20 +00:00
parent fe021c1e24
commit 607d4c6703
4 changed files with 75 additions and 53 deletions

View File

@ -18,22 +18,3 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
Order deny,allow
Allow from all
</DirectoryMatch>
#<DirectoryMatch /usr/share/dolibarr/htdocs/public/adherents/priv_*>
# Options Indexes FollowSymLinks
# AllowOverride All
# Order deny,allow
# Deny from all
#
# AuthType Basic
# Auth_MySQL_Authoritative on
# Auth_MySQL_DB dolibarr
# Auth_MySQL_Password_Table llx_adherent
# Auth_MySQL_Username_Field login
# Auth_MySQL_Password_Field pass
# Auth_MySQL_Encrypted_Passwords off
# AuthName "Adherents"
#
# require valid-user
# satisfy any
#</DirectoryMatch>

View File

@ -58,9 +58,10 @@ case "$1" in
config="/usr/share/dolibarr/htdocs/install/install.forced.php"
cp -p $fileorig $config
# Create conf.php
# Create empty conf.php
if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ]
then
echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php
touch /usr/share/dolibarr/htdocs/conf/conf.php
chown -R www-data.www-data /usr/share/dolibarr/htdocs/conf/conf.php;
chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php;
@ -68,8 +69,8 @@ case "$1" in
#db_reset "dolibarr/webserver"
# Get the web server type.
db_get "dolibarr/webserver" # Read value for webserver.
# Get the web server type (use dbget for interactive mode).
# db_get "dolibarr/webserver" # Read value for webserver.
# webserver="$RET"
webserver="Both"
case $webserver in
@ -78,18 +79,38 @@ case "$1" in
Both) webservers="apache2 apache2-ssl" ;;
*) webservers="" ;;
esac
# Define variable phpver and phpini
. /usr/share/wwwconfig-common/php.get
# Set up web server.
for server in $webservers ; do
echo Complete config of server $server
env_enable
# Add info for PHP (might be obsolete)
typestr='application/x-httpd-php'
extension='.php'
. /usr/share/wwwconfig-common/apache-addtype_all.sh
. /usr/share/wwwconfig-common/apache-php.sh
. /usr/share/wwwconfig-common/apache-run.get
trustuser=$webuser
# Enable PHP module (might be obsolete)
#. /usr/share/wwwconfig-common/apache-php.sh
#echo Result of enabling PHP modules: $status
# Detect webuser and webgroup
webuser=
webgroup=
. /usr/share/wwwconfig-common/apache-run.get
echo Web user.group found is $webuser.$webgroup
if [ -z "$webuser" ] ; then
webuser=www-data
fi
if [ -z "$webgroup" ] ; then
webgroup=www-data
fi
echo Web user.group used is $webuser.$webgroup
#
# That may lead to problems if apache & apache-ssl do
# not have the same user/group.

View File

@ -17,9 +17,15 @@ set -e
# for details, see /usr/share/doc/packaging-manual/
. /usr/share/debconf/confmodule
db_version 2.0
#echo "postrm db_get dolibarr/webserver"
set +e
# We disable set -e to avoid premature end of script if error
db_get "dolibarr/webserver" || true
webserver="$RET"
set -e
export webserver="$RET"
# Allows us to loop and substitute in one pass
case $webserver in
@ -28,12 +34,18 @@ case $webserver in
Both) webservers="apache2 apache2-ssl" ;;
*) webservers="" ;;
esac
includefile=/etc/dolibarr/apache.conf
export includefile=/etc/dolibarr/apache.conf
case "$1" in
purge)
#echo "postrm purge webservers=$webservers includefile=$includefile"
#echo "postrm db_get dolibarr/postrm"
# We disable set -e to avoid premature end of script if error
set +e
db_get "dolibarr/postrm"
set -e
if [ "$RET" = "true" ] ; then
# Get database configuration
dbserver="localhost"
@ -48,27 +60,35 @@ case "$1" in
. /usr/share/wwwconfig-common/${dbtype}-dropuser.sh
. /usr/share/wwwconfig-common/${dbtype}-dropdb.sh
fi
# Remove include files
for server in $webservers ; do
error=""
conffile="/etc/$server/httpd.conf"
# We disable set -e because script apache-uninclude.sh return error if not
set +e
. /usr/share/wwwconfig-common/apache-uninclude.sh
set -e
# if [ "x$error" != "x" ] ;
# then echo $error
# fi
export error=""
export conffile="/etc/$server/httpd.conf"
#echo "postrm conffile=$conffile"
if [ -f $conffile ] ;
then
if [ ! -s $conffile ] ;
then
# We disable set -e to avoid premature end of script if error
set +e
. /usr/share/wwwconfig-common/apache-uninclude.sh
set -e
fi
fi
if [ "$status" = "purge" ] ;
then restart="$restart $server"
fi
done
rm -rf /etc/dolibarr
# Restart
servers="apache2-ssl apache2 mysql"
. /usr/share/wwwconfig-common/restart.sh
if [ -f /usr/share/wwwconfig-common/restart.sh ] ;
then
. /usr/share/wwwconfig-common/restart.sh
fi
# Remove file and conf file
for dir in /usr/share/dolibarr ; do

View File

@ -1,22 +1,22 @@
Template: dolibarr/configuration/note
Type: note
Description: Package configuration note.
dolibarr can be and should be configured entirely via web, so, in the
Dolibarr can be and should be configured entirely via web, so, in the
following configuration steps, I'm going to prompt you for the passwords that
dolibarr uses for web configuration and some default values for the
application startup. Then you should point your browser to the dolibarr
Dolibarr uses for web configuration and some default values for the
application startup. Then you should point your browser to the Dolibarr
setup, for example:
.
http://localhost/dolibarr/install.php
.
continue the configuration, fill the database and let dolibarr be aware of
continue the configuration, fill the database and let Dolibarr be aware of
the installed modules.
Template: dolibarr/webserver
Type: select
Choices: Apache, Apache-ssl, Both, None
Description: Which Web Server are you running?
dolibarr supports any web server with CGI capabilities, but this
Dolibarr supports any web server with PHP capabilities, but this
configuration process only supports Apache and Apache-SSL.
Template: dolibarr/db/setup/skip
@ -27,7 +27,7 @@ Description: DB setup skipped.
Template: dolibarr/db
Type: text
Description: dolibarr DB setup NOTE.
Description: Dolibarr DB setup NOTE.
Now you should specify the DBMS settings. You must provide the host name on
which the DBMS server is installed, the type (i.e. MySql), the DB name, the DBMS administrator user-name, etc.
@ -42,25 +42,25 @@ Template: dolibarr/db/port
Type: string
Default: 3306
Description: Please, insert your database port:
This should be the port value that dolibarr will use to access
This should be the port value that Dolibarr will use to access
the DB.
Template: dolibarr/db/name
Type: string
Default: dolibarr
Description: Please, insert dolibarr DB name:
This is the name of the DB that dolibarr will use.
Description: Please, insert Dolibarr database name:
This is the name of the database that Dolibarr will use.
Template: dolibarr/db/user/name
Type: string
Default: dolibarr
Description: Please, insert the DBMS user-name to access the DB:
This is the user-name that dolibarr will use to access the DB.
This is the user-name that Dolibarr will use to access the DB.
Template: dolibarr/db/user/password
Type: password
Description: Please, insert the password to access the DB:
This is the password that dolibarr will use, along with user-name you
This is the password that Dolibarr will use, along with user-name you
provided, to access the DB.
Template: dolibarr/db/user/password/confirm
@ -80,8 +80,8 @@ Default: root
Description: Please, insert the DBMS administrator user-name:
This user-name will be used to access the DBMS to create (if needed):
.
(1) The new dolibarr database
(2) The new database account that dolibarr will use to access the DB
(1) The new Dolibarr database
(2) The new database account that Dolibarr will use to access the DB
.
It should be 'root' for MySql.
@ -98,5 +98,5 @@ Type: boolean
Default: true
Description: Delete *ALL*?
Datas subjected to this question are the DBMS account, the DB and the
dolibarr users ang group files. Do I have to delete *ALL* datas whenever
the dolibarr package will be completely removed from the system?
Dolibarr users ang group files. Do I have to delete *ALL* datas whenever
the Dolibarr package will be completely removed from the system?