Enhance debian installer

This commit is contained in:
Laurent Destailleur 2011-06-18 22:55:44 +00:00
parent a3a0eab986
commit c10d651b4c
5 changed files with 103 additions and 36 deletions

View File

@ -1,6 +1,20 @@
Alias /dolibarr /usr/share/dolibarr/htdocs # Apache config file for Dolibarr
<DirectoryMatch /usr/share/dolibarr/htdocs> <IfModule mod_alias.c>
Alias /dolibarr /usr/share/dolibarr/htdocs
</IfModule>
# You can also use phpLDAPadmin as a VirtualHost
# <VirtualHost *:*>
# ServerName mydolibarrhostname.com
# ServerAdmin root@example.com
# DocumentRoot /usr/share/dolibarr/
# ErrorLog logs/ldap.example.com-error.log
# CustomLog logs/ldap.example.com-access.log common
# </VirtualHost>
<Directory /usr/share/dolibarr/htdocs>
DirectoryIndex index.php
Options +FollowSymLinks +Indexes Options +FollowSymLinks +Indexes
ErrorDocument 401 /public/error-401.php ErrorDocument 401 /public/error-401.php
@ -11,10 +25,38 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
php_flag register_globals Off php_flag register_globals Off
</IfModule> </IfModule>
</DirectoryMatch> <IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
php_flag register_globals Off
</IfModule>
<DirectoryMatch /usr/share/dolibarr/htdocs/public/>
# OPTIMIZE: To use gzip compressed files (for Dolibarr already compressed files).
# Note that constant MAIN_OPTIMIZE_SPEED must have a value with bit 0 set.
#AddType text/javascript .jgz
#AddEncoding gzip .jgz
# OPTIMIZE: To use gzip compression (on the fly).
# Note that you must also enable the module mod_deflate.
# You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set.
#TODO
# OPTIMIZE: To use cache on static pages (A259200 = 1 month).
# Note that you must also enable the module mod_expires.
#ExpiresActive On
#ExpiresByType image/x-icon A2592000
#ExpiresByType image/gif A2592000
#ExpiresByType image/png A2592000
#ExpiresByType image/jpeg A2592000
#ExpiresByType text/css A2592000
#ExpiresByType text/javascript A2592000
#ExpiresByType application/x-javascript A2592000
#ExpiresByType application/javascript A2592000
</Directory>
<Directory /usr/share/dolibarr/htdocs/public/>
AllowOverride All AllowOverride All
Order deny,allow Order deny,allow
Allow from all Allow from all
</DirectoryMatch> </Directory>

View File

@ -16,7 +16,8 @@ Description: Dolibarr ERP & CRM
Relationship Management (CRM) but also other features for different Relationship Management (CRM) but also other features for different
activities. activities.
. .
Dolibarr features are activated by modules. Most common modules are Dolibarr features are activated by modules. Most common modules are:
.
* Products and services catalog * Products and services catalog
* Stock management * Stock management
* Bank accounts management * Bank accounts management

View File

@ -26,13 +26,13 @@ echo Run the dolibarr postinst script
case "$1" in case "$1" in
configure) configure)
# Copy include for apache.conf # Copy apache.conf file into target directory
fileorig="/usr/share/dolibarr/build/deb/apache.conf" fileorig="/usr/share/dolibarr/build/deb/apache.conf"
config="/etc/dolibarr/apache.conf" config="/etc/dolibarr/apache.conf"
mkdir -p /etc/dolibarr mkdir -p /etc/dolibarr
cp -p $fileorig $config cp -p $fileorig $config
# Create install.forced.php # Create install.forced.php into Dolibarr install directory
fileorig="/usr/share/dolibarr/build/deb/install.forced.php.install" fileorig="/usr/share/dolibarr/build/deb/install.forced.php.install"
config="/usr/share/dolibarr/htdocs/install/install.forced.php" config="/usr/share/dolibarr/htdocs/install/install.forced.php"
superuserlogin='' superuserlogin=''
@ -55,7 +55,7 @@ case "$1" in
chmod -R 775 /var/lib/dolibarr/documents; chmod -R 775 /var/lib/dolibarr/documents;
chmod -R g+s /var/lib/dolibarr/documents; chmod -R g+s /var/lib/dolibarr/documents;
# Create empty conf.php # Create an empty conf.php with permission to web server
if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ]
then then
echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php echo Create empty file /usr/share/dolibarr/htdocs/conf/conf.php
@ -113,10 +113,14 @@ case "$1" in
# #
chown -R $webuser.$webgroup /usr/share/dolibarr chown -R $webuser.$webgroup /usr/share/dolibarr
includefile="/etc/dolibarr/apache.conf" # Put contet of conf file into apache httpd.conf main file (/etc/apache2/httpd.conf)
#echo "$includefile $server" #includefile="/etc/dolibarr/apache.conf"
. /usr/share/dolibarr/build/deb/apache-include_all.sh #. /usr/share/dolibarr/build/deb/apache-include_all.sh
test "$status" = "uncomment" -o "$status" = "include" && restart="$server $restart" #test "$status" = "uncomment" -o "$status" = "include" && restart="$server $restart"
# Add link to config file
echo Setup web server $webservers to add dolibarr config file
ln -fs /etc/dolibarr/apache.conf /etc/apache2/conf.d
# (useless) # (useless)
#for index in index.php; do #for index in index.php; do
@ -155,10 +159,12 @@ case "$1" in
servers="apache2-ssl apache2 mysql" servers="apache2-ssl apache2 mysql"
if [ -f /usr/share/wwwconfig-common/restart.sh ] ; if [ -f /usr/share/wwwconfig-common/restart.sh ] ;
then then
echo Restart web servers running /usr/share/wwwconfig-common/restart.sh
. /usr/share/wwwconfig-common/restart.sh . /usr/share/wwwconfig-common/restart.sh
else else
# Another way to restart # Another way to restart
for server in $servers ; do for server in $servers ; do
echo Restart web server $server
if [ -x /usr/sbin/invoke-rc.d ]; then if [ -x /usr/sbin/invoke-rc.d ]; then
# This on works with Debian (5.05,...) and Ubuntu (9.10,10.04,...) # This on works with Debian (5.05,...) and Ubuntu (9.10,10.04,...)
invoke-rc.d $server reload || true invoke-rc.d $server reload || true
@ -168,7 +174,9 @@ case "$1" in
done done
fi fi
echo "Launch Dolibarr on page http://localhost/dolibarr/ to complete the installation and use Dolibarr." echo ----------
echo "Call Dolibarr page http://localhost/dolibarr/ to complete the installation and use Dolibarr."
echo ----------
;; ;;
abort-upgrade|abort-remove|abort-deconfigure) abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -40,6 +40,7 @@ esac
export includefile=/etc/dolibarr/apache.conf export includefile=/etc/dolibarr/apache.conf
case "$1" in case "$1" in
# Call when we uninstall and purge
purge) purge)
echo "postrm purge webservers=$webservers includefile=$includefile" echo "postrm purge webservers=$webservers includefile=$includefile"
@ -148,27 +149,38 @@ case "$1" in
# Remove include files # Remove include files
for server in $webservers ; do for server in $webservers ; do
export error=""
export conffile="/etc/$server/httpd.conf" # Old usage
echo "postrm conffile=$conffile" #export conffile="/etc/$server/httpd.conf"
if [ -f $conffile ] ; #export error=""
then #echo "postrm conffile=$conffile"
if [ -s $conffile ] ; #if [ -f $conffile ] ;
then #then
echo postrm remove dolibarr include from /etc/dolibarr/apache.conf # if [ -s $conffile ] ;
# We disable set -e to avoid premature end of script if error # then
set +e # echo postrm remove dolibarr include from /etc/dolibarr/apache.conf
GREP="Include[[:space:]]\+$includefile\b" # # We disable set -e to avoid premature end of script if error
if grep -e "$GREP" $conffile > /dev/null 2>&1; then # set +e
log="${log}Include of $includefile found in $conffile file, purging." # GREP="Include[[:space:]]\+$includefile\b"
status=purge # if grep -e "$GREP" $conffile > /dev/null 2>&1; then
grep -v -e "$GREP" < $conffile > $conffile.purg # log="${log}Include of $includefile found in $conffile file, purging."
mv $conffile.purg $conffile # status=purge
fi # grep -v -e "$GREP" < $conffile > $conffile.purg
# We restore blocking errors # mv $conffile.purg $conffile
set -e # fi
fi # # We restore blocking errors
fi # set -e
# fi
#fi
# New usage
export conffile="/etc/$server/conf.d/dolibarr.conf"
if [ -f $conffile ] ;
then
rm $conffile
status=purge
fi
if [ "$status" = "purge" ] ; if [ "$status" = "purge" ] ;
then restart="$restart $server" then restart="$restart $server"
fi fi
@ -217,10 +229,14 @@ case "$1" in
db_purge db_purge
;; ;;
# Call when we uninstall
remove) remove)
echo "postrm Force remove of /usr/share/dolibarr/htdocs/install" echo "postrm Force remove of /usr/share/dolibarr/htdocs/install"
rm -fr /usr/share/dolibarr/htdocs/install rm -fr /usr/share/dolibarr/htdocs/install
echo "postrm Force remove of /usr/share/dolibarr/htdocs/conf"
rm -fr /usr/share/dolibarr/htdocs/conf
#echo "postrm Remove menu entry and image" #echo "postrm Remove menu entry and image"
#fileorig="/usr/share/applications/dolibarr.desktop" #fileorig="/usr/share/applications/dolibarr.desktop"
#rm -f $fileorig #rm -f $fileorig

View File

@ -2,7 +2,7 @@
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# \file build/makepack-dolibarr.pl # \file build/makepack-dolibarr.pl
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe) # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe)
# \version $Revision$ # \version $Id$
# \author (c)2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> # \author (c)2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------