From eba04fd34bf6c0ec414a0967c08c36b1d565b1b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Jul 2011 18:06:36 +0000 Subject: [PATCH] Work on 3.1 packaging --- build/.cvsignore | 3 ++ build/deb/README | 2 +- build/deb/postrm | 51 +++++++++++++++------------- build/makepack-dolibarr.pl | 42 +++++++++++++++++------ build/rpm/README | 10 ++---- build/rpm/dolibarr.spec | 27 +++++---------- build/rpm/install.forced.php.install | 5 +-- htdocs/install/etape5.php | 3 +- 8 files changed, 77 insertions(+), 66 deletions(-) diff --git a/build/.cvsignore b/build/.cvsignore index 830b8b91924..53dd6ee2abd 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -14,3 +14,6 @@ version-phpsane.txt makepack-phpsane.conf html *.deb +*.dsc +*.tar.gz +*.changes diff --git a/build/deb/README b/build/deb/README index 76be8f1596c..edb46ffd5a3 100644 --- a/build/deb/README +++ b/build/deb/README @@ -49,5 +49,5 @@ For first ITP submission of Dolibarr, bug id was 634783. - Call for a mentor on ML debian-mentors to upload packages - Once package is uploaded, following URL are available: -http://packages.qa.debian.org/package +http://packages.qa.debian.org/package.html http://bugs.debian.org/package diff --git a/build/deb/postrm b/build/deb/postrm index 95f27de27dd..9eae81b022b 100644 --- a/build/deb/postrm +++ b/build/deb/postrm @@ -30,6 +30,7 @@ apachefileorig="/usr/share/dolibarr/build/deb/apache.conf" apacheconfig="/etc/dolibarr/apache.conf" #config="/usr/share/dolibarr/htdocs/conf/conf.php" config="/etc/dolibarr/conf.php" +lockfile="/usr/share/dolibarr/install.lock" export webserver="" @@ -43,6 +44,32 @@ esac case "$1" in + + # Call when we upgrade + upgrade) + ;; + + # Call when we uninstall + remove) + rm -f $lockfile + + # Remove include files + export restart="" + for server in $webservers ; do + export conffile="/etc/$server/conf.d/dolibarr.conf" + if [ -f $conffile ] ; + then + echo Delete link $conffile + rm -f $conffile + status=purge + fi + + if [ "x$status" = "xpurge" ] ; + then restart="$restart $server" + fi + done + ;; + # Call when we uninstall and purge purge) echo "postrm purge webservers=$webservers apacheconfig=$apacheconfig" @@ -198,30 +225,6 @@ case "$1" in #db_purge ;; - # Call when we uninstall - remove) - rm -f /usr/share/dolibarr/install.lock - - # Remove include files - export restart="" - for server in $webservers ; do - export conffile="/etc/$server/conf.d/dolibarr.conf" - if [ -f $conffile ] ; - then - echo Delete link $conffile - rm -f $conffile - status=purge - fi - - if [ "x$status" = "xpurge" ] ; - then restart="$restart $server" - fi - done - ;; - - upgrade) - ;; - failed-upgrade|abort-install|abort-upgrade|disappear) ;; diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index a791fd3f828..ae04a704e10 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.123 2011/07/30 14:56:12 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.127 2011/07/31 18:06:36 eldy Exp $ # \author (c)2004-2011 Laurent Destailleur #---------------------------------------------------------------------------- @@ -11,7 +11,7 @@ use Cwd; $PROJECT="dolibarr"; $MAJOR="3"; $MINOR="1"; -$BUILD="0-dev"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate +$BUILD="0-beta"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate $RPMSUBVERSION="auto"; # auto use value found into BUILD @LISTETARGET=("TGZ","ZIP","RPM","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages @@ -48,7 +48,7 @@ if (-d "/usr/src/RPM") { use vars qw/ $REVISION $VERSION /; -$REVISION='$Revision: 1.123 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.127 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -274,6 +274,10 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/barcode/php-barcode/fonts/Veranda*.ttf`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/fckeditor/fckeditor.py`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`; $ret=`rm -fr $BUILDROOT/$PROJECT/dev/licence`; @@ -410,14 +414,19 @@ if ($nboftargetok) { } if ($target eq 'RPM') { # Linux only - $ARCH='i386'; + #$ARCH='i386'; + $ARCH='noarch'; if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; } $newbuild = $BUILD; - $newbuild =~ s/(dev|alpha)/0/gi; # dev - $newbuild =~ s/beta/1/gi; # beta - $newbuild =~ s/rc./2/gi; # rc + # For fedora + $newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev + $newbuild =~ s/beta/0.2.beta1/gi; # beta + $newbuild =~ s/rc./0.3.rc1/gi; # rc if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale - # now newbuild is 0-0 or 0-3 for example + #$newbuild =~ s/(dev|alpha)/0/gi; # dev + #$newbuild =~ s/beta/1/gi; # beta + #$newbuild =~ s/rc./2/gi; # rc + #if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale $REL1 = $newbuild; $REL1 =~ s/-.*$//gi; if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; } print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; @@ -435,6 +444,7 @@ if ($nboftargetok) { print "Remove other files\n"; $ret=`rm -f $BUILDROOT/$FILENAMETGZ2/htdocs/includes/barcode/php-barcode/genbarcode/genbarcode`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/README`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/aps`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`; @@ -472,6 +482,10 @@ if ($nboftargetok) { print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm into $DESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\n"; $cmd="mv \"$RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\" \"$DESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\""; $ret=`$cmd`; + print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm into $DESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\n"; + $cmd="mv \"$RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\" \"$DESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\""; + $ret=`$cmd`; + next; } @@ -675,7 +689,7 @@ if ($nboftargetok) { $ret=`cp -f "$SOURCE/build/deb/compat" "$BUILDROOT/$PROJECT.tmp/debian/compat"`; $ret=`cp -f "$SOURCE/build/deb/format" "$BUILDROOT/$PROJECT.tmp/debian/source/format"`; $ret=`cp -fr "$SOURCE/build/deb/po" "$BUILDROOT/$PROJECT.tmp/debian/po"`; - $ret=`rm -fr "$SOURCE/build/deb/po/CVS"`; + $ret=`rm -fr "$BUILDROOT/$PROJECT.tmp/debian/po/CVS"`; # Add files also required to build binary package with dpkg-buildpackages $ret=`cp -f "$SOURCE/build/deb/config" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/deb/postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; @@ -696,12 +710,18 @@ if ($nboftargetok) { if ($OS =~ /windows/i) { print "Move *_all.deb to $DESTI\n"; - $ret=`mv "$BUILDROOT/*_all.deb" "$DESTI/"`; + $ret=`mv $BUILDROOT/*_all.deb "$DESTI/"`; + $ret=`mv $BUILDROOT/*.dsc "$DESTI/"`; + $ret=`mv $BUILDROOT/*.tar.gz "$DESTI/"`; + $ret=`mv $BUILDROOT/*.changes "$DESTI/"`; } else { print "Move *_all.deb to $DESTI\n"; - $ret=`mv "$BUILDROOT/*_all.deb" "$DESTI/"`; + $ret=`mv $BUILDROOT/*_all.deb "$DESTI/"`; + $ret=`mv $BUILDROOT/*.dsc "$DESTI/"`; + $ret=`mv $BUILDROOT/*.tar.gz "$DESTI/"`; + $ret=`mv $BUILDROOT/*.changes "$DESTI/"`; } next; } diff --git a/build/rpm/README b/build/rpm/README index 99a1bb3552c..c157a195c03 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -10,8 +10,6 @@ with format RPM (for Redhat, Mandriva, ...). # This is standard command to work on Debian packaging: # -# rpmlint file.rpm Test a package -# # On Fedora # rpm -i --test dolibarr-...rpm To list dependencies of RPM # yum install dolibarr-...rpm To install package and dependencies @@ -42,9 +40,7 @@ different features for Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) but also for different other activities. I am author of other already packaged OpenSources packages (awstats) but this is my first package to maintain myself. So i'm seeking a sponsor. + - Edit field "Block" and add FE-NEEDSPONSOR -- Check bug is into database by searching with id on https://bugzilla.redhat.com/ -- Install fedora packager tools: yum install fedora-packager -- Setup fedora packagers tools: fedora-packager-setup -- Send your package: koji build --scratch f16 path_to_source_RPM -- Check if package is available: http://koji.fedoraproject.org/koji/ \ No newline at end of file + +- Check bug is into database by searching with id on https://bugzilla.redhat.com/ \ No newline at end of file diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index 708546cf263..1754220c6c7 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -48,7 +48,7 @@ AutoReqProv: no %description -An easy to use CRM & ERP open source/free software for small +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 for different other activities. @@ -56,7 +56,7 @@ Dolibarr was designed to provide only features you need and be easy to use. %description -l es -Un software ERP y CRM open source/gratis para pequeñas y +Dolibarr ERP y CRM es un software open source/gratis para pequeñas y medianas empresas, asociaciones o autónomos. Incluye diferentes funcionalidades para la Planificación de Recursos Empresariales (ERP) y Gestión de la Relación con los Clientes (CRM) así como para para otras @@ -65,13 +65,13 @@ solamente las funcionalidades que necesita y haciendo hincapié en su facilidad de uso. %description -l fr -Logiciel ERP & CRM de gestion de PME/PMI, autoentrepreneurs, +Dolibarr ERP & CRM est un logiciel de gestion de PME/PMI, autoentrepreneurs, artisans ou associations. Il permet de gérer vos clients, prospect, fournisseurs, devis, factures, comptes bancaires, agenda, campagne emailings et bien d'autres choses dans une interface pensée pour la simplicité. %description -l it -Un programma gestionale open source e gratuito per piccole e medie +Dolibarr è un programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti. Include varie funzionalità per Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno @@ -101,7 +101,6 @@ mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/doc mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/htdocs mkdir -p $RPM_BUILD_ROOT/var/www/dolibarr/scripts -# %{_datadir} = /usr/share mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps cp doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/dolibarr.png mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications @@ -154,8 +153,6 @@ export installfileorig="$targetdir/build/rpm/install.forced.php.install" export installconfig="%{_sysconfdir}/dolibarr/install.forced.php" export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf" export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf" -export sefileorig="$targetdir/build/rpm/file_contexts.dolibarr" -export seconfig="%{_sysconfdir}/selinux/targeted/contexts/files/file_contexts.dolibarr" #config="/usr/share/dolibarr/htdocs/conf/conf.php" config="%{_sysconfdir}/dolibarr/conf.php" lockfile="/usr/share/dolibarr/install.lock" @@ -221,7 +218,7 @@ then chmod -R 660 $config fi -# Create config file for apache $apacheconfig +# Create a config file $apacheconfig if [ ! -f $apacheconfig ]; then echo Create dolibarr web server config file $apacheconfig cp $apachefileorig $apacheconfig @@ -229,15 +226,7 @@ if [ ! -f $apacheconfig ]; then chmod go-w $apacheconfig fi -# Create config file for se $seconfig -if [ ! -f $seconfig ]; then - echo Create se config file $seconfig - cp $sefileorig $seconfig -# chmod a-x $apacheconfig -# chmod go-w $apacheconfig -fi - -# Create a config link dolibarr.conf +# Create a config link dolibarr.conf for Fedora or Redhat if [ ! -f $apachelink ]; then echo Create dolibarr web server config link $apachelink ln -fs $apacheconfig $apachelink @@ -370,5 +359,5 @@ rmdir $targetdir/doc >/dev/null 2>&1 #rmdir $targetdir/htdocs >/dev/null 2>&1 # Already removed by rpm %changelog -* Wed Jul 31 2011 Laurent Destailleur 3.1.0-0.2.beta1 -- Initial version (#723326) +* Wed Jul 31 2011 Laurent Destailleur 3.1.0 +- Initial upstream (#723326) diff --git a/build/rpm/install.forced.php.install b/build/rpm/install.forced.php.install index 5f390270b51..f01e5303ce0 100755 --- a/build/rpm/install.forced.php.install +++ b/build/rpm/install.forced.php.install @@ -3,10 +3,11 @@ $force_install_noedit=2; $force_install_message='KeepDefaultValuesDeb'; $force_install_main_data_root='/usr/share/dolibarr/documents'; $force_install_type='mysqli'; +$force_install_dbserver='localhost'; $force_install_port='3306'; -$force_install_database='dolibarr'; +$force_install_database='dolibarrrpm'; $force_install_createdatabase='1'; -$force_install_databaselogin='dolibarrmysql'; +$force_install_databaselogin='dolibarrrpm'; $force_install_databasepass=''; $force_install_createuser='1'; $force_install_databaserootlogin='__SUPERUSERLOGIN__'; diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 0c1c03cfdd9..0037190af06 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -24,7 +24,7 @@ * \file htdocs/install/etape5.php * \ingroup install * \brief Last page of upgrade or install process - * \version $Id: etape5.php,v 1.105 2011/07/31 11:56:43 eldy Exp $ + * \version $Id: etape5.php,v 1.106 2011/07/31 13:28:45 eldy Exp $ */ include_once("./inc.php"); @@ -364,7 +364,6 @@ elseif (preg_match('/upgrade/i',$action)) if (! empty($force_install_lockinstall)) { // Upgrade is finished, we create the lock file - $lockfile="../../install.lock"; $fp = @fopen($lockfile, "w"); if ($fp) {