From d85e39d4ee9cda2a2de2517248b7c453fb415601 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Jul 2011 02:41:36 +0000 Subject: [PATCH] Prepare packaging for debian --- build/deb/config | 2 + build/deb/control | 13 +++-- build/deb/copyright | 1 + build/deb/rules | 100 +------------------------------------ build/deb/templates | 12 ++--- build/makepack-dolibarr.pl | 47 +++++++++++------ 6 files changed, 45 insertions(+), 130 deletions(-) create mode 100644 build/deb/copyright diff --git a/build/deb/config b/build/deb/config index 74220322386..e006ebda186 100644 --- a/build/deb/config +++ b/build/deb/config @@ -1,6 +1,8 @@ #!/bin/sh # Debian install package run: config, preinst, prerm, postinst, postrm # +# lintian package To test a package +# # dpkg -l list all packages # dpkg -b is to build package # dpkg -c package.deb list content of package diff --git a/build/deb/control b/build/deb/control index 819a8b1668e..19eb51664e7 100644 --- a/build/deb/control +++ b/build/deb/control @@ -4,17 +4,16 @@ Architecture: all Maintainer: Laurent Destailleur Essential: no 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 Priority: optional Recommends: mozilla | netscape Homepage: http://www.dolibarr.org -Description: Dolibarr ERP & CRM - Dolibarr ERP/CRM is an open source/free software for - small and medium companies, foundations or freelances. It includes - different features for Enterprise Resource Planning (ERP) and Customer - Relationship Management (CRM) but also other features for different - activities. +Description: An ERP & CRM software to manage your activity. + Dolibarr ERP & CRM is an easy to use open source/free software for small + and medium companies, foundations or freelances. It includes different + features for Enterprise Resource Planning (ERP) and Customer Relationship + Management (CRM) but also other features for different activities. . Dolibarr features are activated by modules. Most common modules are: . diff --git a/build/deb/copyright b/build/deb/copyright new file mode 100644 index 00000000000..74752ea4864 --- /dev/null +++ b/build/deb/copyright @@ -0,0 +1 @@ +See file /usr/share/common-licenses/GPL-2 \ No newline at end of file diff --git a/build/deb/rules b/build/deb/rules index 6ac50a11ba1..df233257ac4 100644 --- a/build/deb/rules +++ b/build/deb/rules @@ -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 -# for making Debian pakcage is build/makepack-dolibarr.pl +# Sample debian/rules # - -# 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 +# This script is not used, so is empty. diff --git a/build/deb/templates b/build/deb/templates index 703aa9fc2db..82fcaa1ba48 100644 --- a/build/deb/templates +++ b/build/deb/templates @@ -1,6 +1,6 @@ Template: dolibarr/configuration/note Type: note -Description: Package configuration 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 @@ -19,15 +19,9 @@ Description: Which Web Server are you running? Dolibarr supports any web server with PHP 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. +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. @@ -71,7 +65,7 @@ Description: Please, retype the password to access the DB: Template: dolibarr/db/user/password/mismatch Type: text -Description: Passwords mismatch. +Description: Passwords mismatch The DB access passwords you inserted mismatch. Please, try again. Template: dolibarr/db/admin/name diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 5ad1e1653b3..799a17c5ff4 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------- # \file build/makepack-dolibarr.pl # \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 #---------------------------------------------------------------------------- @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { 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)"; @@ -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/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/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/freetype6.dll`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/zlib1.dll`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php_writeexcel/php.bmp`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/php_writeexcel/php.bmp`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/fonts/utils/freetype6.dll`; + $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 @@ -402,7 +406,7 @@ if ($nboftargetok) { $ret=`$cmd`; 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"; $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') { $newbuild = $BUILD; - $newbuild =~ s/(dev|alpha)/0/gi; # dev - $newbuild =~ s/beta/1/gi; # beta - $newbuild =~ s/rc./2/gi; # rc - if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale - # now newbuild is 0-0 or 0-3 for example + $newbuild =~ s/(dev|alpha)/1/gi; # dev + $newbuild =~ s/beta/2/gi; # beta + $newbuild =~ s/rc./3/gi; # rc + if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale + # now newbuild is 0-1 or 0-4 for example print "Version is $MAJOR.$MINOR.$newbuild\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/rollup`; $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 $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"`; 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=`chmod 444 $BUILDROOT/$PROJECT.tmp/usr/share/applications/dolibarr.desktop`; + print "Create directory $BUILDROOT/$PROJECT.tmp/usr/share/pixmaps\n"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/pixmaps"`; 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=`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"; $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"; - $ret=`cp "$SOURCE/COPYRIGHT" "$BUILDROOT/$PROJECT.tmp/DEBIAN/copyright"`; + print "Copy copyright file into $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/copyright\n"; + $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"; $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp/usr/share/$PROJECT/documents"`; @@ -514,8 +527,10 @@ if ($nboftargetok) { $ret=`chmod -R 555 $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/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"; $olddir=getcwd(); chdir("$BUILDROOT");