From e5d564b40f65303c2b281b384ec124bcadfd85e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Mon, 30 Jan 2012 00:42:47 +0100 Subject: [PATCH] Work on debian package --- build/debian/changelog | 2 +- build/debian/install | 4 +- build/debian/rules | 76 ++++++++++++++++++++++++++++++++++++++ build/launchpad/README | 16 ++++---- build/makepack-dolibarr.pl | 65 +------------------------------- 5 files changed, 90 insertions(+), 73 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index 152492e7ad7..3b1aeb0907f 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -6,4 +6,4 @@ dolibarr (3.2.0+nmu1) unstable; urgency=low -- Dolibarr team <contact@dolibarr.org> Mon, 10 Aug 2011 12:00:00 +0100 -# For a changelog file dedicated to users, see /usr/share/doc/dolibarr/UserChangeLog.gz file. \ No newline at end of file +# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz \ No newline at end of file diff --git a/build/debian/install b/build/debian/install index 6562bda4a37..911d25cae8a 100755 --- a/build/debian/install +++ b/build/debian/install @@ -1,8 +1,10 @@ debian/dolibarr.desktop usr/share/applications debian/dolibarr.xpm usr/share/pixmaps +ChangeLog usr/share/doc/dolibarr +README usr/share/doc/dolibarr build/debian/apache.conf etc/dolibarr build/debian/lighttpd.conf etc/dolibarr build usr/share/dolibarr dev usr/share/dolibarr htdocs usr/share/dolibarr -scripts usr/share/dolibarr \ No newline at end of file +scripts usr/share/dolibarr diff --git a/build/debian/rules b/build/debian/rules index 280ba8fde47..04247898209 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -30,6 +30,82 @@ binary-indep: dh $@ clean: + # Delete files + rm -f .buildpath + rm -fr .cache + rm -fr .git + rm -f .gitmodules + rm -f .gitignore + rm -fr .project + rm -fr .settings + rm -f build.xml + rm -f pom.xml + rm -f README.md + + rm -f htdocs/install/mssql/README + rm -f htdocs/install/mysql/README + rm -f htdocs/install/pgsql/README + + rm -fr dev/codesniffer + rm -fr dev/codetemplates + rm -fr dev/dbmodel + rm -fr dev/initdata + rm -fr dev/iso-normes + rm -fr dev/ldap + rm -fr dev/licence + rm -fr dev/mail + rm -fr dev/phpcheckstyle + rm -fr dev/phpunit + rm -fr dev/security + rm -fr dev/spec + rm -fr dev/test + rm -fr dev/uml + rm -fr dev/xdebug + rm -f dev/dolibarr_changes.txt + rm -f dev/README + rm -f doc/images/dolibarr_screenshot2.png + rm -f doc/images/dolibarr_screenshot3.png + rm -f doc/images/dolibarr_screenshot4.png + rm -f doc/images/dolibarr_screenshot5.png + rm -f doc/images/dolibarr_screenshot6.png + rm -f doc/images/dolibarr_screenshot7.png + rm -f doc/images/dolibarr_screenshot8.png + rm -f doc/images/dolibarr_screenshot9.png + rm -f doc/images/dolibarr_screenshot10.png + rm -f doc/images/dolibarr_screenshot11.png + rm -f doc/images/dolibarr_screenshot12.png + + rm -fr test + + # Licence files are included into copyright file. + rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt + rm -fr htdocs/includes/phpexcel/license.txt + rm -f htdocs/includes/tcpdf/LICENSE.TXT + + rm -fr htdocs/includes/jquery/plugins/lightbox + rm -fr htdocs/includes/jquery/plugins/jstree + rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF + rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip + rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33 + rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919 + rm -fr htdocs/includes/tcpdf/fonts/utils + + rm -fr build/aps + rm -fr build/dmg + rm -fr build/doap + rm -fr build/exe + rm -fr build/launchpad + rm -fr build/live + rm -fr build/patch + rm -fr build/perl + rm -fr build/rpm + rm -fr build/zip + rm -fr htdocs/includes/ckeditor + rm -fr htdocs/includes/fonts + rm -fr htdocs/includes/geoip + rm -fr htdocs/includes/nusoap + rm -fr htdocs/includes/odtphp/zip/pclzip + dh $@ binary-arch: diff --git a/build/launchpad/README b/build/launchpad/README index b4428216dd5..1fdb6cddb32 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -12,7 +12,7 @@ a package onto LaunchPad # To install all packagers tools: # apt-get install bzr-builder bzr pbuilder -To submit a package on LaunchPad: +# Init local working env - Create account on launchpad.org - Create Project - Link project to official SCM server @@ -20,7 +20,13 @@ To submit a package on LaunchPad: - Run from command line: bzr launchpad-login yourlogin bzr whoami "Your Name <email@email.com>" -- Create a Bazzar directory +- Create a file /.pbuilderrc with content + COMPONENTS="main universe multiverse restricted" +- Create chroot ubuntu env + sudo pbuilder create + +# Init package tools for launchpad +- Create a Bazaar directory mkdir bzr - Create debian directory and upload it onto bzr branch ~yourlogin/dolibarr/debian cd bzr @@ -29,7 +35,7 @@ To submit a package on LaunchPad: bzr init cp -pr dolibarr_root/debian bzr/debian bzr add debian - bzr commit + bzr commit -m "Init" bzr push lp:~eldy/dolibarr/debian or download it from launchpad bazaar: cd bzr @@ -44,10 +50,6 @@ To submit a package on LaunchPad: cd bzr bzr dailydeb dolibarr.recipe working-dir This will create a directory "working-dir" with dolibarr sources and will add sources from ~eldy/dolibarr/debian -- Create a file /.pbuilderrc with content - $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build -- Create chroot ubuntu env - sudo pbuilder create - Test package sources sudo pbuilder build <working-dir>/<project>_<version>.dsc diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 64bfbc60b9c..21a0f53096c 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -280,7 +280,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/install.lock`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`; @@ -322,7 +321,6 @@ 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 -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/fckeditor`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/flot/LICENSE.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/lightbox`; @@ -335,8 +333,6 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`; - # Removed because not stable yet - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/bureau2crea`; } # Build package for each target @@ -560,23 +556,6 @@ if ($nboftargetok) { $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\""; $ret=`$cmd`; -# print "Fix filefunc.inc.php, install/inc.php, support/inc.php\n"; -# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/filefunc.inc.php\" | -# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/htdocs/filefunc.inc.php\""; -# $ret=`$cmd`; -# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/install/inc.php\" | -# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/htdocs/install/inc.php\""; -# $ret=`$cmd`; -# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/support/inc.php\" | -# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' | -# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$PROJECT.tmp/htdocs/support/inc.php\""; -# $ret=`$cmd`; - print "Remove other files\n"; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README`; @@ -613,54 +592,13 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/perl`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`; - # We remove embedded libraries or fonts + # We remove embedded libraries or fonts (this is also inside rules file, target clean) $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/fonts`, $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/geoip`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/nusoap`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/odtphp/zip/pclzip`; - # Prepare binary package (init DEBIAN dir) - #print "Create directory $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; - #$ret=`mkdir "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - #print "Copy $SOURCE/build/debian/xxx to $BUILDROOT/$PROJECT.tmp/DEBIAN\n"; - #$ret=`cp -f "$SOURCE/build/debian/config" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - #$ret=`cp -f "$SOURCE/build/debian/postinst" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - #$ret=`cp -f "$SOURCE/build/debian/postrm" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - #$ret=`cp -f "$SOURCE/build/debian/templates" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - #$ret=`cp -fr "$SOURCE/build/debian/po" "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - - # changelog (to build binary package directly without sources. Useless if we build from sources) - #$ret=`gzip -9 -c "$SOURCE/build/debian/changelog" > $BUILDROOT/$PROJECT.tmp/usr/share/doc/$PROJECT/changelog.gz`; - - #print "Edit version in file $BUILDROOT/$PROJECT.tmp/DEBIAN/control\n"; - #open (SPECFROM,"<$SOURCE/build/debian/control.debianbin") || die "Error"; - #open (SPECTO,">$BUILDROOT/$PROJECT.tmp/DEBIAN/control") || die "Error"; - #while (<SPECFROM>) { - # $_ =~ s/__VERSION__/$MAJOR.$MINOR.$newbuild/; - # print SPECTO $_; - #} - #close SPECFROM; - #close SPECTO; - #print "Version set to $MAJOR.$MINOR.$newbuild\n"; - - #$cmd="find $BUILDROOT/$PROJECT.tmp/DEBIAN -type f -exec chmod 755 {} \\; "; - #$ret=`$cmd`; - #$ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/control`; - #$ret=`chmod 644 $BUILDROOT/$PROJECT.tmp/DEBIAN/templates`; - - # Creation of binary package (to build without sources) - # Enable this to build a binary package without building sources first - #print "Go into directory $BUILDROOT\n"; - #chdir("$BUILDROOT"); - #$cmd="dpkg -b $BUILDROOT/$PROJECT.tmp $BUILDROOT/${FILENAMEDEB}_all.deb"; - #print "Launch DEB build ($cmd)\n"; - #$ret=`$cmd`; - #print $ret."\n"; - #$ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/DEBIAN"`; - #$ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/doc"`; - #exit; - # Prepare source package (init debian dir) print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n"; $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; @@ -685,7 +623,6 @@ if ($nboftargetok) { $ret=`cp -f "$SOURCE/build/debian/postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/templates" "$BUILDROOT/$PROJECT.tmp/debian"`; - # Set owners and permissions print "Set owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; -- GitLab