diff --git a/debian/apache.conf b/debian/apache.conf
new file mode 100644
index 00000000000..bb53eda54c9
--- /dev/null
+++ b/debian/apache.conf
@@ -0,0 +1,48 @@
+Alias /dolibarr /usr/share/dolibarr
+
+
+ Options +FollowSymLinks +Indexes
+
+ ErrorDocument 401 /public/error-401.html
+
+
+ php_flag magic_quotes_gpc Off
+ php_flag track_vars On
+ php_flag register_globals On
+
+
+
+
+
+ AllowOverride All
+ Order deny,allow
+ Allow from all
+
+
+
+ AllowOverride All
+ Order deny,allow
+ Allow from all
+
+
+#
+# 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
+#
+#
+
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 00000000000..d678d0a703a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+dolibarr (0.6.0-1) unstable; urgency=low
+
+ * initial version
+
+ -- Loic Dachary (OuoU) Sat, 6 Sep 2003 02:49:31 +0200
diff --git a/debian/conf.php b/debian/conf.php
new file mode 100644
index 00000000000..951ab0f2e8b
--- /dev/null
+++ b/debian/conf.php
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/debian/control b/debian/control
new file mode 100644
index 00000000000..71f8fba85a5
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,18 @@
+Source: dolibarr
+Section: web
+Priority: optional
+Maintainer: Loic Dachary (OuoU)
+Build-Depends: debhelper (>> 4.0.0),
+Standards-Version: 3.5.8
+
+Package: dolibarr
+Section: web
+Architecture: all
+Depends: apache, wwwconfig-common (>= 0.0.7), php4, php4-mysql, php4-curl, php4-pear, libapache-mod-auth-mysql, debconf, perl
+Description: Company account management software.
+ Dolibarr is a small and simple Web interface with ERP and CRM
+ capabilities. It is designed for small companies and freelancers, and
+ can be used to deal with the bills and documentation required for
+ company management.
+
+
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 00000000000..ede912f06a7
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,26 @@
+This package was debianized by Loic Dachary (OuoU) on
+Sat, 6 Sep 2003 02:49:31 +0200.
+
+It was downloaded from http://nongnu.org/download/dolibarr/
+
+Upstream Author: Rodolphe Quiedeville
+
+Copyright:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 dated June, 1991.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
diff --git a/debian/dolibarr.config b/debian/dolibarr.config
new file mode 100644
index 00000000000..48af0da316b
--- /dev/null
+++ b/debian/dolibarr.config
@@ -0,0 +1,119 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+
+db_version 2.0
+
+if [ "$1" = "reconfigure" ] ; then
+ # Rotate old configuration
+ config="/etc/dolibarr/apache.conf"
+ for i in $(seq 8 -1 0) ; do
+ if [ -f ${config}.$i ]
+ then mv ${config}.$i ${config}.$(($i +1))
+ fi
+ done
+ mv ${config} ${config}.0
+fi
+step=0
+finished="false"
+
+db_capb backup
+while ! $finished ; do
+ skip="false"
+ forward=1
+ backward=1
+ password=""
+ confirm=""
+ case $step in
+ 0) # Prompt user for notes.
+ db_beginblock
+ db_input low "dolibarr/configuration/note" || true
+ db_endblock
+ backward=0
+ ;;
+ 1) # Ask for web server type.
+ db_input medium "dolibarr/webserver" || true
+ ;;
+ 2) # Ask on wich host the DBMS is installed.
+ db_input critical "dolibarr/db/host" || true
+ # Skip previous step.
+ backward=1
+ ;;
+ 3) # Get the database administrator name and password.
+ db_beginblock
+ db_input critical "dolibarr/db/admin/name" || true
+ db_input critical "dolibarr/db/admin/password" || true
+ db_endblock
+ # Skip previous step.
+ backward=1
+ ;;
+ 4) # Ask for DB name.
+ db_input critical "dolibarr/db/name" || true
+ ;;
+ 5) # Get the DBMS account username
+ db_input critical "dolibarr/db/user/name" || true
+ ;;
+ 6) # Get the DBMS account password
+ db_fset "dolibarr/db/user/password/mismatch" "seen" "false" || true
+ db_beginblock
+ db_input critical "dolibarr/db/user/password" || true
+ db_input critical "dolibarr/db/user/password/confirm" || true
+ db_endblock
+ ;;
+ 7) # Check if passwords match.
+ db_get "dolibarr/db/user/password"
+ password="$RET"
+ db_get "dolibarr/db/user/password/confirm"
+ confirm="$RET"
+ if [ "$password" != "$confirm" ] ; then
+ # Reset the template used
+ db_reset "dolibarr/db/user/password" || true
+ db_fset "dolibarr/db/user/password" "seen" "false" || true
+ db_reset "dolibarr/db/user/password/confirm" || true
+ db_fset "dolibarr/db/user/password/confirm" "seen" "false" || true
+ # Promt the user
+ db_input critical "dolibarr/header/password/mismatch" || true
+ # Do one step back anyway.
+ forward=-1
+ else
+ # Do not prompt, go to the next step.
+ skip="true"
+ fi
+ ;;
+ 8) # Ask for deleting all the database on package purge.
+ db_input medium "dolibarr/postrm" || true
+ onsuccess='finished="true"'
+ # Skip previous step
+ backward=2
+ ;;
+ *)
+ skip="true"
+ message="Unknown step #$tep."
+ if [ $step -lt 0 ] ; then
+ step=-1
+ elif [ $step -gt 11 ] ; then
+ finished="true"
+ fi
+ ;;
+ esac
+
+ if $skip ; then
+ next=$(($step + 1))
+ eval $onsuccess
+ onsuccess=''
+ else
+ db_title "dolibarr" || true
+ if db_go ; then
+ next=$(($step + $forward))
+ eval $onsuccess
+ onsuccess=''
+ else
+ next=$(($step - $backward))
+ onsuccess=''
+ fi
+ fi
+ step=$next
+done
+
+db_stop
+exit 0
diff --git a/debian/dolibarr.docs b/debian/dolibarr.docs
new file mode 100644
index 00000000000..30d29dea9be
--- /dev/null
+++ b/debian/dolibarr.docs
@@ -0,0 +1 @@
+doc/*
diff --git a/debian/dolibarr.files b/debian/dolibarr.files
new file mode 100644
index 00000000000..a75e2371260
--- /dev/null
+++ b/debian/dolibarr.files
@@ -0,0 +1,2 @@
+etc
+usr
diff --git a/debian/dolibarr.postinst b/debian/dolibarr.postinst
new file mode 100644
index 00000000000..515bd0d82bb
--- /dev/null
+++ b/debian/dolibarr.postinst
@@ -0,0 +1,124 @@
+#! /bin/sh
+# postinst script for dolibarr
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * `configure'
+# * `abort-upgrade'
+# * `abort-remove' `in-favour'
+#
+# * `abort-deconfigure' `in-favour'
+# `removing'
+#
+# for details, see /usr/share/doc/packaging-manual/
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+case "$1" in
+ configure)
+ config="/etc/dolibarr/apache.conf"
+
+ # Get the web server type.
+ db_get "dolibarr/webserver"
+ webserver="$RET"
+ case $webserver in
+ Apache) webservers="apache" ;;
+ Apache-SSL) webservers="apache-ssl" ;;
+ Both) webservers="apache apache-ssl" ;;
+ *) webservers="" ;;
+ esac
+ . /usr/share/wwwconfig-common/php.get
+ . /usr/share/wwwconfig-common/apache-run.get
+ # Set up web server.
+ for server in $webservers ; do
+ trustuser=$wwwuser
+ includefile="/etc/dolibarr/apache.conf"
+ . /usr/share/wwwconfig-common/apache-include_all.sh
+ test "$status" = "uncomment" -o "$status" = "include" && restart="$server $restart"
+ for index in index.php; do
+ . /usr/share/wwwconfig-common/apache-index_all.sh
+ test "$status" = "added" && restart="$server $restart"
+ done
+ done
+
+ chown -R www-data.www-data /usr/share/dolibarr
+
+ #
+ # Pear
+ #
+ if [ ! -f /usr/bin/php ] ; then ln -s /usr/bin/php4 /usr/bin/php ; fi
+ pear install Archive_Tar || true
+ pear install Console_Getopt || true
+ pear install PEAR || true
+ pear install Auth || true
+ pear install DB || true
+
+ #
+ # Database
+ #
+ db_get "dolibarr/db/setup/skip"
+ if [ "$RET" = "false" ] ; then
+ db_get "dolibarr/db/host"
+ dbserver="$RET"
+ db_get "dolibarr/db/name"
+ dbname="$RET"
+ db_get "dolibarr/db/admin/name"
+ dbadmin="$RET"
+ db_get "dolibarr/db/admin/password"
+ dbadmpass="$RET"
+ db_get "dolibarr/db/user/name"
+ dbuser="$RET"
+ db_get "dolibarr/db/user/password"
+ dbpass="$RET"
+ dbtype="mysql"
+ # User may have choosen to continue anyway
+ # with the configuration, so:
+ if [ "$dbtype" = "mysql" ] ; then
+ . /usr/share/wwwconfig-common/${dbtype}-createuser.sh
+ . /usr/share/wwwconfig-common/${dbtype}-createdb.sh
+ echo $error
+ fi
+ sqlfile=/usr/lib/dolibarr/mysql.sql
+ perl -pi -e "s/'admin','admin'/'$dbuser','$dbpass'/" $sqlfile
+ . /usr/share/wwwconfig-common/${dbtype}-exec.sh
+ fi
+
+ perl -pi -e "s/Auth_MySQL_DB.*/Auth_MySQL_DB '$dbname'/" /etc/dolibarr/apache.conf
+ perl -pi -e "s/Auth_MySQL_Username_Field.*/Auth_MySQL_Username_Field '$dbuser'/" /etc/dolibarr/apache.conf
+ perl -pi -e "s/Auth_MySQL_Password_Field.*/Auth_MySQL_Password_Field '$dbpass'/" /etc/dolibarr/apache.conf
+
+ if grep DBHOST /usr/share/dolibarr/conf/conf.php > /dev/null
+ then
+ perl -pi -e "s/DBHOST/$dbserver/" /usr/share/dolibarr/conf/conf.php
+ perl -pi -e "s/DBNAME/$dbname/" /usr/share/dolibarr/conf/conf.php
+ perl -pi -e "s/DBUSER/$dbuser/" /usr/share/dolibarr/conf/conf.php
+ perl -pi -e "s/DBPASS/$dbpass/" /usr/share/dolibarr/conf/conf.php
+ fi
+
+ # Reset passwords
+ db_reset "dolibarr/db/user/password"
+
+ servers="apache-ssl apache mysql"
+ . /usr/share/wwwconfig-common/restart.sh
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+db_stop
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/dolibarr.postrm b/debian/dolibarr.postrm
new file mode 100644
index 00000000000..011d79b1223
--- /dev/null
+++ b/debian/dolibarr.postrm
@@ -0,0 +1,89 @@
+#! /bin/sh
+# postrm script for dolibarr
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * `remove'
+# * `purge'
+# * `upgrade'
+# * `failed-upgrade'
+# * `abort-install'
+# * `abort-install'
+# * `abort-upgrade'
+# * `disappear' overwrit>r>
+# for details, see /usr/share/doc/packaging-manual/
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+db_get "dolibarr/webserver" || true
+webserver="$RET"
+
+# Allows us to loop and substitute in one pass
+case $webserver in
+ Apache) webservers="apache" ;;
+ Apache-SSL) webservers="apache-ssl" ;;
+ Both) webservers="apache apache-ssl" ;;
+ *) webservers="" ;;
+esac
+includefile=/etc/dolibarr/apache.conf
+
+case "$1" in
+ purge)
+ db_get "dolibarr/postrm"
+ if [ "$RET" = "true" ] ; then
+ # Get database configuration
+ db_get "dolibarr/db/user/name"
+ dbuser="$RET"
+ db_get "dolibarr/db/user/password"
+ dbpass="$RET"
+ db_get "dolibarr/db/host"
+ dbserver="$RET"
+ db_get "dolibarr/db/name"
+ dbname="$RET"
+ db_get "dolibarr/db/admin/name"
+ dbadmin="$RET"
+ db_get "dolibarr/db/admin/password"
+ dbadmpass="$RET"
+ dbtype="mysql"
+
+ . /usr/share/wwwconfig-common/${dbtype}-dropuser.sh
+ . /usr/share/wwwconfig-common/${dbtype}-dropdb.sh
+
+ fi
+
+ rm -rf /etc/dolibarr
+ for server in $webservers ; do
+ conffile="/etc/$server/httpd.conf"
+ . /usr/share/wwwconfig-common/apache-uninclude.sh
+ if [ "$status" = "purge" ] ;
+ then restart="$restart $server"
+ fi
+ done
+
+ servers="apache-ssl apache mysql"
+ . /usr/share/wwwconfig-common/restart.sh
+
+ for dir in /usr/share/dolibarr ; do
+ if [ -d ${dir} ] ; then rm -rf ${dir} ; fi
+ done
+ ;;
+ remove)
+ ;;
+ upgrade)
+ ;;
+ failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+db_stop
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/dolibarr.templates b/debian/dolibarr.templates
new file mode 100644
index 00000000000..928cf05feef
--- /dev/null
+++ b/debian/dolibarr.templates
@@ -0,0 +1,94 @@
+Template: dolibarr/configuration/note
+Type: note
+Description: Package configuration note.
+ 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
+ setup, for example:
+ .
+ http://localhost/dolibarr/install.php
+ .
+ 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
+ configuration process only supports Apache and Apache-SSL.
+
+Template: dolibarr/db/setup/skip
+Type: boolean
+Default: false
+Description: DB setup skipped.
+ DB setup will be skipped.
+
+Template: dolibarr/db
+Type: text
+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.
+
+Template: dolibarr/db/host
+Type: string
+Default: localhost
+Description: Please, insert dolibarr DB host name:
+ This should be the host-name or IP address 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.
+
+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.
+
+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
+ provided, to access the DB.
+
+Template: dolibarr/db/user/password/confirm
+Type: password
+Description: Please, retype the password to access the DB:
+ Please insert the DB access password again. If the password you are going to
+ retype mismatch the previous inserted one, I'll ask you to insert them again.
+
+Template: dolibarr/db/user/password/mismatch
+Type: text
+Description: Passwords mismatch.
+ The DB access passwords you inserted mismatch. Please, try again.
+
+Template: dolibarr/db/admin/name
+Type: string
+Description: Please, insert the DBMS administrator user-name:
+ This user-name will be used to access the DBMS to create (if needed):
+ .
+ (1) The DB
+ (2) The new DBMS account that dolibarr will use to access the DB
+ .
+ It should be 'root' for MySql.
+
+Template: dolibarr/db/admin/password
+Type: password
+Description: Please, insert the DBMS administrator password (if any):
+ This is the password that will be used along with the DBMS administrator
+ user-name.
+ .
+ NOTE: This password will not be asked twice, since it's not a new password.
+
+Template: dolibarr/postrm
+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 the dolibarr package will be completely removed from the system?
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 00000000000..efe92a5e696
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,96 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=3
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+build: configure-stamp build-stamp
+build-stamp:
+ dh_testdir
+
+ # Add here commands to compile the package.
+
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ @# Add here commands to install the package into debian/tmp
+
+ install --mode=644 -D --group=www-data --owner=www-data \
+ debian/apache.conf \
+ debian/dolibarr/etc/dolibarr/apache.conf
+
+ mkdir -p debian/dolibarr/usr/share/dolibarr
+ cp -rp htdocs/* debian/dolibarr/usr/share/dolibarr
+ mkdir -p debian/dolibarr/usr/share/dolibarr/document
+ install --mode 644 --group=www-data --owner=www-data debian/conf.php debian/dolibarr/usr/share/dolibarr/conf/conf.php
+ chmod -R 644 debian/dolibarr/usr/share/dolibarr
+ find debian/dolibarr/usr/share/dolibarr -type d | xargs chmod 755
+
+ find debian/dolibarr -name CVS | xargs rm -fr
+
+ mkdir -p debian/dolibarr/usr/lib/dolibarr
+ install --mode=444 mysql/mysql.sql debian/dolibarr/usr/lib/dolibarr/mysql.sql
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+# dh_movefiles
+
+ dh_installdebconf
+ dh_installdocs
+# dh_installexamples
+# dh_installmenu
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_installinit
+# dh_installcron
+ dh_installman
+# dh_installinfo
+# dh_undocumented
+# dh_installchangelogs
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+# dh_makeshlibs
+ dh_installdeb
+# dh_perl
+# dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure