[Erp5-report] r7845 - /spec/mandriva/2006.0/build-spec

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jun 19 12:32:24 CEST 2006


Author: kevin
Date: Mon Jun 19 12:32:20 2006
New Revision: 7845

URL: http://svn.erp5.org?rev=7845&view=rev
Log:
Adapt script to the new repository structure.
Modifiy some string printing.
Add a description.

Modified:
    spec/mandriva/2006.0/build-spec

Modified: spec/mandriva/2006.0/build-spec
URL: http://svn.erp5.org/spec/mandriva/2006.0/build-spec?rev=7845&r1=7844&r2=7845&view=diff
==============================================================================
--- spec/mandriva/2006.0/build-spec (original)
+++ spec/mandriva/2006.0/build-spec Mon Jun 19 12:32:20 2006
@@ -1,4 +1,11 @@
 #!/bin/bash
+
+################################################
+# This script build a RPM package of one ERP5 zope Products (the one given as $NAME parameter).
+# The script get the latest ERP5 code from the SVN repository. To build the RPM, the latest spec
+# file from Nexedi's repository is downloaded and automatically updated (release number,
+# product version, changelog).
+################################################
 
 PARAMS=1
 
@@ -6,10 +13,9 @@
 # and where we want to store the source code from svn
 SVN_PATH="/home/$USER/svn"
 RPM_PATH="/home/$USER/rpm"
-REPOSIT="https://svn.erp5.org/repos/public/erp5/trunk/products"
-
-# TODO: The spec repository should be moved from /ERP5/spec to /spec/Mandriva in the SVN repository
-SPEC_REPOSITORY="ERP5/spec"
+REPOSIT="https://svn.erp5.org/repos/public"
+PROD_REPOSITORY="erp5/trunk/products"
+SPEC_REPOSITORY="spec/mandriva/2006.0"
 
 
 # Those variables are used to build the change log
@@ -34,12 +40,13 @@
 
   NAME=$1
   shift
-  echo Starting Building $NAME
+  echo == Start the building of $NAME Product RPM ==
 
   # Retrieve the version in the source code as anonymous user to be sure we get published code only
-  cd $SVN_PATH && svn checkout $REPOSIT/$NAME && cd -
+  echo -- Checkout $NAME from SVN --
+  cd $SVN_PATH && svn checkout $REPOSIT/$PROD_REPOSITORY/$NAME && cd -
   VERSION=`awk '{print $2}' $SVN_PATH/$NAME/VERSION.txt`
-  echo Building --$NAME-- Version --$VERSION--
+  echo -- Pack $NAME v$VERSION --
   rm -rf $SVN_PATH/$NAME-$VERSION/
   mkdir -p $SVN_PATH/$NAME-$VERSION
   cp -a $SVN_PATH/$NAME $SVN_PATH/$NAME-$VERSION
@@ -60,40 +67,41 @@
   # Get data from the previous spec file commited in the SVN repository
   ####################
 
+  SPEC_FILE="zope-$NAME.spec"
+
   # Now we will regenerate a spec file skeleton based on the one stored in the SVN.
   # This spec file need to be modified by hand to get
   cd $SVN_PATH
-  rm -rf $NAME.spec
-  wget --no-check-certificate $REPOSIT/$SPEC_REPOSITORY/$NAME.spec
-  SVN_SPEC_FILE="$NAME.spec"
+  rm -f $SPEC_FILE
+  wget --no-check-certificate $REPOSIT/$SPEC_REPOSITORY/$SPEC_FILE
 
   # Get summary and required packages
-  SUMMARY=`grep "^Summary*" $SVN_SPEC_FILE`
-  REQUIRES=`grep "^Requires*" $SVN_SPEC_FILE`
+  SUMMARY=`grep "^Summary*" $SPEC_FILE`
+  REQUIRES=`grep "^Requires*" $SPEC_FILE`
 
   # Get the description and changelog from the previous spec file
-  L_SECTIONS=`grep -hn "#----------------------------------------------------------------------" $SVN_SPEC_FILE | sed -e "s/:/ /g" | awk '{print $1}'`
+  L_SECTIONS=`grep -hn "#----------------------------------------------------------------------" $SPEC_FILE | sed -e "s/:/ /g" | awk '{print $1}'`
   L_DESC_START=`echo $L_SECTIONS | awk '{print $1}'`
   L_DESC_STOP=` echo $L_SECTIONS | awk '{print $2}'`
   L_CHANGELOG=` echo $L_SECTIONS | awk '{print $3}'`
   L_CORE_START=$L_DESC_STOP
   L_CORE_STOP=$L_CHANGELOG
-  L_TOTAL=`wc -l $SVN_SPEC_FILE | awk '{print $1}'`
+  L_TOTAL=`wc -l $SPEC_FILE | awk '{print $1}'`
   DESC_HEAD=`expr $L_DESC_STOP - 1`
   DESC_TAIL=`expr $L_DESC_STOP - $L_DESC_START - 2`
   CORE_HEAD=`expr $L_CORE_STOP - 1`
   CORE_TAIL=`expr $L_CORE_STOP - $L_CORE_START - 1`
   CLOG_TAIL=`expr $L_TOTAL - $L_CHANGELOG - 1`
 
-  DESCRIPTION=`head -n $DESC_HEAD $SVN_SPEC_FILE | tail -n $DESC_TAIL`
-  SPEC_CORE=`head -n $CORE_HEAD $SVN_SPEC_FILE | tail -n $CORE_TAIL`
-  CHANGELOG=`tail -n $CLOG_TAIL $SVN_SPEC_FILE`
+  DESCRIPTION=`head -n $DESC_HEAD $SPEC_FILE | tail -n $DESC_TAIL`
+  SPEC_CORE=`head -n $CORE_HEAD $SPEC_FILE | tail -n $CORE_TAIL`
+  CHANGELOG=`tail -n $CLOG_TAIL $SPEC_FILE`
 
   TODAY=`env LC_TIME=en date +"%a %b %d %Y"`
 
   # Increase the rpm release number if needed
-  PREVIOUS_VERSION=`grep "^%define version*" $SVN_SPEC_FILE | awk '{print $3}'`
-  PREVIOUS_REL=`grep "^%define release*" $SVN_SPEC_FILE | awk '{print $3}'`
+  PREVIOUS_VERSION=`grep "^%define version*" $SPEC_FILE | awk '{print $3}'`
+  PREVIOUS_REL=`grep "^%define release*" $SPEC_FILE | awk '{print $3}'`
   if test "x$VERSION" = "x$PREVIOUS_VERSION"; then
     RELEASE=`expr $PREVIOUS_REL + 1`
   else
@@ -103,7 +111,7 @@
 
 
   ####################
-  # Build the spec file using the following template
+  # Build the spec file using the following template and previous SVN data
   ####################
 
   echo "%define product $NAME
@@ -141,15 +149,15 @@
 $CHANGELOG" >> $TMP_SPEC
 
   # now we can replace the spec file
-  rm -f $RPM_PATH/SPECS/$NAME.spec
-  mv -f $TMP_SPEC $RPM_PATH/SPECS/$NAME.spec
+  rm -f $RPM_PATH/SPECS/$SPEC_FILE
+  mv -f $TMP_SPEC $RPM_PATH/SPECS/$SPEC_FILE
 
-  # rpmbuild -ba $RPM_PATH/SPECS/$NAME.spec
+  # rpmbuild -ba $RPM_PATH/SPECS/$SPEC_FILE
 
-  # A rpmlint can be launch here.
+  # TODO: launch rpmlint here.
 
   echo "-------------"
-  echo "Please commit the new $NAME.spec file in the Nexedi repository ($REPOSIT)"
+  echo "Please commit the new $SPEC_FILE file in $REPOSIT/$SPEC_REPOSITORY"
   echo "-------------"
 
 done




More information about the Erp5-report mailing list