Prepare packaging for debian

This commit is contained in:
Laurent Destailleur 2011-07-09 02:41:36 +00:00
parent b5b63513df
commit d85e39d4ee
6 changed files with 45 additions and 130 deletions

View File

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
# Debian install package run: config, preinst, prerm, postinst, postrm # Debian install package run: config, preinst, prerm, postinst, postrm
# #
# lintian package To test a package
#
# dpkg -l list all packages # dpkg -l list all packages
# dpkg -b is to build package # dpkg -b is to build package
# dpkg -c package.deb list content of package # dpkg -c package.deb list content of package

View File

@ -4,17 +4,16 @@ Architecture: all
Maintainer: Laurent Destailleur <eldy@users.sourceforge.net> Maintainer: Laurent Destailleur <eldy@users.sourceforge.net>
Essential: no Essential: no
Installed-Size: 31200 Installed-Size: 31200
Depends: apache2, libapache2-mod-php5, php5, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl Depends: apache2, libapache2-mod-php5, php5, php5-cli, php5-cgi, php5-curl, php5-gd, php5-ldap, php5-mysql, mysql-server, perl
Section: web Section: web
Priority: optional Priority: optional
Recommends: mozilla | netscape Recommends: mozilla | netscape
Homepage: http://www.dolibarr.org Homepage: http://www.dolibarr.org
Description: Dolibarr ERP & CRM Description: An ERP & CRM software to manage your activity.
Dolibarr ERP/CRM is an open source/free software for Dolibarr ERP & CRM is an easy to use open source/free software for small
small and medium companies, foundations or freelances. It includes and medium companies, foundations or freelances. It includes different
different features for Enterprise Resource Planning (ERP) and Customer features for Enterprise Resource Planning (ERP) and Customer Relationship
Relationship Management (CRM) but also other features for different 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:
. .

1
build/deb/copyright Normal file
View File

@ -0,0 +1 @@
See file /usr/share/common-licenses/GPL-2

View File

@ -1,100 +1,4 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# #
# This script is not used. The script used to build the root # Sample debian/rules
# for making Debian pakcage is build/makepack-dolibarr.pl
# #
# This script is not used, so is empty.
# 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/dolibarr
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/htdocs
mkdir -p debian/dolibarr/usr/share/dolibarr/documents
chmod -R 644 debian/dolibarr/usr/share/dolibarr
find debian/dolibarr/usr/share/dolibarr -type d | xargs chmod 755
find debian/dolibarr \( -name CVS -o -name .cvsignore \) | xargs rm -fr
mkdir -p debian/dolibarr/usr/lib/dolibarr
cp -rp scripts/* debian/dolibarr/usr/lib/dolibarr
# 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

View File

@ -1,6 +1,6 @@
Template: dolibarr/configuration/note Template: dolibarr/configuration/note
Type: note Type: note
Description: Package configuration 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 following configuration steps, I'm going to prompt you for the passwords that
Dolibarr uses for web configuration and some default values for the Dolibarr uses for web configuration and some default values for the
@ -19,15 +19,9 @@ Description: Which Web Server are you running?
Dolibarr supports any web server with PHP capabilities, but this Dolibarr supports any web server with PHP capabilities, but this
configuration process only supports Apache and Apache-SSL. 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 Template: dolibarr/db
Type: text 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 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. which the DBMS server is installed, the type (i.e. MySql), the DB name, the DBMS administrator user-name, etc.
@ -71,7 +65,7 @@ Description: Please, retype the password to access the DB:
Template: dolibarr/db/user/password/mismatch Template: dolibarr/db/user/password/mismatch
Type: text Type: text
Description: Passwords mismatch. Description: Passwords mismatch
The DB access passwords you inserted mismatch. Please, try again. The DB access passwords you inserted mismatch. Please, try again.
Template: dolibarr/db/admin/name Template: dolibarr/db/admin/name

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, aps) # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
# \version $Id: makepack-dolibarr.pl,v 1.105 2011/06/26 11:41:50 eldy Exp $ # \version $Id: makepack-dolibarr.pl,v 1.106 2011/07/09 02:41:37 eldy Exp $
# \author (c)2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> # \author (c)2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") {
use vars qw/ $REVISION $VERSION /; use vars qw/ $REVISION $VERSION /;
$REVISION='$Revision: 1.105 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $REVISION='$Revision: 1.106 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1;
$VERSION="1.0 (build $REVISION)"; $VERSION="1.0 (build $REVISION)";
@ -277,9 +277,13 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS*`; $ret=`rm -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; $ret=`rm -fr $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/freetype6.dll`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/php_writeexcel/php.bmp`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/zlib1.dll`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/freetype6.dll`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php_writeexcel/php.bmp`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/zlib1.dll`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/pfm2afm`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/ttf2ufm`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils/pfm2afm`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils/ttf2ufm`;
} }
# Build package for each target # Build package for each target
@ -402,7 +406,7 @@ if ($nboftargetok) {
$ret=`$cmd`; $ret=`$cmd`;
print "Remove other files\n"; print "Remove other files\n";
$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/*.dll $BUILDROOT/$FILENAMETGZ2/*/*.dll $BUILDROOT/$FILENAMETGZ2/*/*/*.dll $BUILDROOT/$FILENAMETGZ2/*/*/*/*.dll $BUILDROOT/$FILENAMETGZ2/*/*/*/*/*.dll $BUILDROOT/$FILENAMETGZ2/*/*/*/*/*/*.dll $BUILDROOT/$FILENAMETGZ2/*/*/*/*/*/*/*.dll`; $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/htdocs/includes/barcode/php-barcode/genbarcode/genbarcode`;
print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n"; print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n";
$ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`; $ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`;
@ -436,11 +440,11 @@ if ($nboftargetok) {
if ($target eq 'DEB') { if ($target eq 'DEB') {
$newbuild = $BUILD; $newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/0/gi; # dev $newbuild =~ s/(dev|alpha)/1/gi; # dev
$newbuild =~ s/beta/1/gi; # beta $newbuild =~ s/beta/2/gi; # beta
$newbuild =~ s/rc./2/gi; # rc $newbuild =~ s/rc./3/gi; # rc
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale
# now newbuild is 0-0 or 0-3 for example # now newbuild is 0-1 or 0-4 for example
print "Version is $MAJOR.$MINOR.$newbuild\n"; print "Version is $MAJOR.$MINOR.$newbuild\n";
print "Remove target $FILENAMEDEB.deb...\n"; print "Remove target $FILENAMEDEB.deb...\n";
@ -475,6 +479,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/tshirt`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/tshirt`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/rollup`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/doc/rollup`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/test`;
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/includes/barcode/php-barcode/genbarcode/genbarcode`;
# To remove once stable # To remove once stable
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/htdocs/theme/bureau2crea`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/htdocs/htdocs/theme/bureau2crea`;
@ -493,17 +498,25 @@ if ($nboftargetok) {
$ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/applications"`;
print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n"; print "Copy desktop file into $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop\n";
$ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`; $ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop"`;
$ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`;
print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`;
print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n"; print "Copy pixmap file into $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm\n";
$ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`; $ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm"`;
$ret=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps/dolibarr.xpm`;
print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT"`;
print "Copy README file into $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; print "Copy README file into $BUILDROOT/$PROJECT.tmp/DEBIAN\n";
$ret=`cp "$SOURCE/README" "$BUILDROOT/$PROJECT.tmp/DEBIAN/README"`; $ret=`cp "$SOURCE/README" "$BUILDROOT/$PROJECT.tmp/DEBIAN/README"`;
$ret=`cp "$SOURCE/README" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/README"`;
print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n";
$ret=`cp "$SOURCE/COPYRIGHT" "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright"`; $ret=`cp "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright" "$BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright"`;
$ret=`gzip -c $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/ChangeLog > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.Debian.gz`;
print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n"; print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents\n";
$ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`;
@ -514,7 +527,9 @@ if ($nboftargetok) {
$ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`; $ret=`chmod -R 555 $BUILDROOT/$PROJECT.tmp`;
$ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`; $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp`;
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`; $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents`;
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`; $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/DEBIAN`;
$ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`;
$ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`;
print "Go to directory $BUILDROOT\n"; print "Go to directory $BUILDROOT\n";
$olddir=getcwd(); $olddir=getcwd();