From 3f60fbeb9997e16c421421f210f70768f16c3692 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Jul 2011 13:17:03 +0000 Subject: [PATCH] Work on 3.1 packaging --- build/.cvsignore | 2 -- build/deb/README | 2 +- build/deb/postrm | 51 +++++++++++++--------------- build/makepack-dolibarr.pl | 8 ++--- build/rpm/README | 31 ++++++++++++----- build/rpm/dolibarr.spec | 9 ++--- build/rpm/install.forced.php.install | 1 - htdocs/install/etape5.php | 3 +- 8 files changed, 53 insertions(+), 54 deletions(-) diff --git a/build/.cvsignore b/build/.cvsignore index a0dfb0ff8cd..830b8b91924 100644 --- a/build/.cvsignore +++ b/build/.cvsignore @@ -14,5 +14,3 @@ version-phpsane.txt makepack-phpsane.conf html *.deb -*.dsc -*.tar.gz diff --git a/build/deb/README b/build/deb/README index edb46ffd5a3..76be8f1596c 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.html +http://packages.qa.debian.org/package http://bugs.debian.org/package diff --git a/build/deb/postrm b/build/deb/postrm index 9eae81b022b..95f27de27dd 100644 --- a/build/deb/postrm +++ b/build/deb/postrm @@ -30,7 +30,6 @@ 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="" @@ -44,32 +43,6 @@ 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" @@ -225,6 +198,30 @@ 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 32db31561bc..2b5e9ba380b 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.125 2011/07/31 15:31:32 eldy Exp $ +# \version $Id: makepack-dolibarr.pl,v 1.124 2011/07/31 13:17:03 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.125 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; +$REVISION='$Revision: 1.124 $'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="1.0 (build $REVISION)"; @@ -274,10 +274,6 @@ 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`; diff --git a/build/rpm/README b/build/rpm/README index f65f12cbb35..f20bf91db72 100644 --- a/build/rpm/README +++ b/build/rpm/README @@ -5,15 +5,24 @@ RPM Package tools This directory contains files used by makepack-dolibarr.pl script to build a package, ready to be distributed, -with format RPM (for Redhat, Mandriva, ...). +with format RPM (for Redhat, OpenSuse, Mandriva, ...). -# This is standard command to work on Debian packaging: +# This is standard command to work on RPM packaging: +# +# yum -y install rpmlint +# yum -y install hunspell-en hunspell-es hunspell-fr hunspell-it +# +# rpmlint file.rpm Test a package +# mock -r fedora-15-i386 --rebuild ../SRPMS/hello-2.7-1.fc15.src.rpm # # On Fedora # rpm -i --test dolibarr-...rpm To list dependencies of RPM # yum install dolibarr-...rpm To install package and dependencies -# yum erase dolibarr To remove package +# yum erase dolibarr To remove package +# chcon -R -h -t httpd_sys_script_rw_t /file To add temporary context rw for httpd on /file +# semanage fcontext -a -t httpd_sys_script_rw_t "/dir/(.*)?" To add persistent context rw for httpd on /dir (this add file_contexts.local) +# restorecon -R -v /file Restore values into files (cancel chcon, validate semanage) # # On OpenSuse # yast --install dolibarr-...rpm To install package and dependencies @@ -27,18 +36,22 @@ with format RPM (for Redhat, Mandriva, ...). To submit a package to Fedora: - +- Create account on bugzilla.redhat.com +- Create account on fedoraproject.org +- Create SRPMS package. +- Upload package onf http://fedorapeople.org - Create a bug with form https://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&format=fedora-review This is example of content of review field (used for Bug 723326): -Spec URL: http://www.dolibarr.org/files/fedora/dolibarr.spec -SRPM URL: http://www.dolibarr.org/files/fedora/dolibarr-3.1.0-0.src.rpm +SRPMS URL: http://www.dolibarr.org/files/fedora/dolibarr-x.y.z-xxx.src.rpm Description: 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. 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/ \ No newline at end of file +- 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 diff --git a/build/rpm/dolibarr.spec b/build/rpm/dolibarr.spec index c3c6d731cfb..090b8e3547d 100644 --- a/build/rpm/dolibarr.spec +++ b/build/rpm/dolibarr.spec @@ -20,7 +20,7 @@ Vendor: Dolibarr dev team URL: http://www.%{name}.org Source: /usr/src/RPM/SOURCES/%{name}-%{version}.tgz -BuildArch: noarch +#BuildArch: noarch #BuildArchitectures: noarch BuildRoot: /tmp/%{name}-buildroot #Icon: dolibarr_logo1.gif @@ -345,17 +345,12 @@ then fi # Removed dirs after apache restart -echo Removed remaining $apacheconfig +echo Removed remaining dirs rm -f $apacheconfig -echo Removed remaining $config rm -f $config -echo Removed remaining $installconfig rm -f $installconfig -echo Removed remaining $lockfile rm -f $lockfile -echo Removed remaining dir $targetdir/doc rmdir $targetdir/doc >/dev/null 2>&1 -echo Removed remaining dir $targetdir/htdocs rmdir $targetdir/htdocs >/dev/null 2>&1 %changelog diff --git a/build/rpm/install.forced.php.install b/build/rpm/install.forced.php.install index f01e5303ce0..fafdc2df676 100755 --- a/build/rpm/install.forced.php.install +++ b/build/rpm/install.forced.php.install @@ -3,7 +3,6 @@ $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='dolibarrrpm'; $force_install_createdatabase='1'; diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 0037190af06..0c1c03cfdd9 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.106 2011/07/31 13:28:45 eldy Exp $ + * \version $Id: etape5.php,v 1.105 2011/07/31 11:56:43 eldy Exp $ */ include_once("./inc.php"); @@ -364,6 +364,7 @@ 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) {