[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/doc/rpm-build/ -> build-egw-rpms.sh (source)

   1  #! /bin/bash
   2  # This script work for generating rpms without Root rights
   3  # When you create rmp's with Root rights and you have as example 
   4  # the follow command rm -rf / in your script you are in trouble :-)
   5  #
   6  # Change the path names for ANONCVSDIR and RHBASE to you needs.
   7  # 
   8  # When you would create daily rpm's with update from CVS include
   9  # delete the # sign at the start from the follow lines
  10  # 
  11  # cd $ANONCVSDIR
  12  # cvs update -Pd
  13  # This scipt create auotmaticly signed rpm's
  14  # When you don't want signed rpm's change the follow line from
  15  #
  16  # rpmbuild -bb --sign egroupware-rh.spec             >> $LOGFILE 2>&1
  17  # 
  18  # to
  19  # rpmbuild -bb egroupware-rh.spec                    >> $LOGFILE 2>&1
  20  #  
  21  # in the script
  22  # How to create GPG keys to sign your rpm's you will found in a seperate
  23  # Document
  24  #
  25  # Script changed 2004 May 21 Reiner Jung
  26  # Script changed 2005 Apr 15 by Ralf Becker and Wim Bonis
  27  # 2005 Sep 20 Ralf Becker: disabled fedora 2 build
  28  
  29  BRANCH="-r Version-1_2_0-branch"
  30  #BRANCH=-A
  31  
  32  SPECFILE=`(if test -f /etc/SuSE-release; then echo egroupware-suse-php5.spec; else echo egroupware-fedora.spec; fi)`
  33  SPECFILE=egroupware-suse-php5.spec
  34  SOURCEFILES="egroupware_fedora.tar.bz2 egroupware_suse.tar.bz2 manageheader.php.patch class.uiasyncservice.inc.php.patch"
  35  
  36  CONTRIB="backup browser comic chatty email egwical filescenter forum ftp fudforum headlines icalsrv jinn messenger phpldapadmin projects stocks switchuser tts skel soap xmlrpc"
  37  
  38  for p in $CONTRIB
  39  do
  40     EXCLUDE_CONTRIB="$EXCLUDE_CONTRIB --exclude=egroupware/$p"
  41     ONLY_CONTRIB="$ONLY_CONTRIB egroupware/$p"
  42  done
  43  
  44  ####
  45  #
  46  # Some changes for bitrock missing and delete from fedora package is not needed
  47  #
  48  ###                                                                                                                             
  49  PACKAGENAME=`grep "%define packagename" $SPECFILE | cut -f3 -d' '`
  50  VERSION=`grep "%define egwversion" $SPECFILE | cut -f3 -d' '`
  51  PACKAGING=`grep "%define packaging" $SPECFILE | cut -f3 -d' '`
  52                                                                                                                               
  53  HOMEBUILDDIR=`whoami`
  54  #which account to use for checkouts and updates, after that the tree is made anonymous anyway, to allow users to update
  55  #CVSACCOUNT=ext:lkneschke
  56  #CVSACCOUNT=pserver:anonymous
  57  ANONCVSDIR=/tmp/build_root/egroupware
  58  RHBASE=$HOME/rpm
  59  SRCDIR=$RHBASE/SOURCES
  60  SPECDIR=$RHBASE/SPECS
  61  LOGFILE=$RHBASE/LOG/build-$PACKAGENAME-$VERSION-$PACKAGING.log
  62  VIRUSSCAN=$SPECDIR/clamav_scan-$PACKAGENAME-$VERSION-$PACKAGING.log
  63  MD5SUM=$SRCDIR/md5sum-$PACKAGENAME-$VERSION-$PACKAGING.txt
  64  
  65  mkdir -p $RHBASE/SOURCES $RHBASE/SPECS $RHBASE/BUILD $RHBASE/SRPMS $RHBASE/RPMS $RHBASE/LOG $ANONCVSDIR
  66  
  67  cp *.spec $RHBASE/SPECS/
  68  cp $SOURCEFILES $RHBASE/SOURCES/
  69  echo "Starting build process of - $PACKAGENAME $VERSION"                             >  $LOGFILE
  70  echo ""                                            >> $LOGFILE 2>&1
  71  date                                                                        >> $LOGFILE 2>&1
  72  cd $ANONCVSDIR
  73      
  74  #[ "$CVSACCOUNT" = 'pserver:anonymous' ] && CVS_RSH="ssh" cvs -d:$CVSACCOUNT@cvs.sourceforge.net:/cvsroot/egroupware login
  75  
  76  if [ ! -d egroupware/phpgwapi ]    # new checkout
  77  then
  78      echo -n "Creating a new checkout ... "            >> $LOGFILE 2>&1
  79      svn checkout http://svn.egroupware.org/egroupware/branches/1.2/aliases/all ./
  80  else                                        # updating an existing checkout in the build-root
  81      echo -n "Updating existing checkout ... "            >> $LOGFILE 2>&1
  82      svn update
  83  fi
  84  
  85  cd $ANONCVSDIR
  86  
  87  echo "done"                                        >> $LOGFILE 2>&1
  88  
  89  echo -n "Change the direcory rights back ... "                        >> $LOGFILE 2>&1
  90  find . -type d -exec chmod 775 {} \;
  91  find . -type f -exec chmod 644 {} \;
  92  echo "done"                                        >> $LOGFILE 2>&1
  93  
  94  echo -n "Starting anti virus scan ... "                            >> $LOGFILE 2>&1
  95  test -x /usr/bin/clamscan && /usr/bin/clamscan --quiet -r $ANONCVSDIR --log=$VIRUSSCAN
  96  echo "done"                                        >> $LOGFILE 2>&1
  97  
  98  cd $ANONCVSDIR
  99  echo -n "building tar.gz ... "                                >> $LOGFILE 2>&1
 100  tar czf $SRCDIR/$PACKAGENAME-$VERSION-$PACKAGING.tar.gz $EXCLUDE_CONTRIB egroupware      2>&1 | tee -a $LOGFILE
 101  tar czf $SRCDIR/$PACKAGENAME-contrib-$VERSION-$PACKAGING.tar.gz $ONLY_CONTRIB         >> $LOGFILE 2>&1
 102  echo "done"                                        >> $LOGFILE 2>&1
 103  
 104  echo -n "building tar.bz2 ... "                                     >> $LOGFILE 2>&1
 105  tar cjf $SRCDIR/$PACKAGENAME-$VERSION-$PACKAGING.tar.bz2 $EXCLUDE_CONTRIB egroupware    >> $LOGFILE 2>&1
 106  tar cjf $SRCDIR/$PACKAGENAME-contrib-$VERSION-$PACKAGING.tar.bz2 $ONLY_CONTRIB         >> $LOGFILE 2>&1
 107  echo "done"                                        >> $LOGFILE 2>&1
 108  
 109  echo -n "building zip ... "                                >> $LOGFILE 2>&1
 110  find $ONLY_CONTRIB > /tmp/exclude.list
 111  zip -q -r -9 $SRCDIR/$PACKAGENAME-$VERSION-$PACKAGING.zip egroupware -x@/tmp/exclude.list    >> $LOGFILE 2>&1
 112  zip -q -r -9 $SRCDIR/$PACKAGENAME-contrib-$VERSION-$PACKAGING.zip $ONLY_CONTRIB     >> $LOGFILE 2>&1
 113  echo "done"                                        >> $LOGFILE 2>&1
 114  
 115  echo "Building tar.gz, tar.bz and zip archives finnished"                >> $LOGFILE 2>&1
 116  
 117  echo "Create the md5sum file for tar.gz, tar.bz, zip ($MD5SUM)"                >> $LOGFILE 2>&1
 118  echo "Build signed source files"                                >> $LOGFILE 2>&1
 119  echo "---------------------------------------"                              >> $LOGFILE 2>&1
 120  
 121  for f in $VERSION-$PACKAGING.tar.gz contrib-$VERSION-$PACKAGING.tar.gz $VERSION-$PACKAGING.tar.bz2 contrib-$VERSION-$PACKAGING.tar.bz2 $VERSION-$PACKAGING.zip contrib-$VERSION-$PACKAGING.zip
 122  do
 123      echo "md5sum from file $PACKAGENAME-$f is:"                     >> $MD5SUM  
 124      md5sum $SRCDIR/$PACKAGENAME-$f | cut -f1 -d' '                     >> $MD5SUM  2>&1
 125      echo "---------------------------------------"                             >> $MD5SUM  2>&1
 126      echo " "                                        >> $MD5SUM  2>&1
 127  
 128      echo "Build signed source files"                            >> $LOGFILE 2>&1
 129      rm -f $SRCDIR/$PACKAGENAME-$f.gpg                         >> $LOGFILE 2>&1
 130      gpg --local-user packager@egroupware.org -s $SRCDIR/$PACKAGENAME-$f         >> $LOGFILE 2>&1
 131  done
 132  echo "------------------------------------------"                              >> $LOGFILE 2>&1
 133  echo "End Build md5sum of tar.gz, tar.bz, zip"                              >> $LOGFILE 2>&1
 134  echo "End build of signed of tar.gz, tar.bz, zip"                           >> $LOGFILE 2>&1
 135  echo "------------------------------------------"                              >> $LOGFILE 2>&1
 136  
 137  echo "sign the md5sum file"                                >> $LOGFILE 2>&1
 138  rm -f $MD5SUM.asc                                    >> $LOGFILE 2>&1
 139  gpg --local-user packager@egroupware.org --clearsign $MD5SUM                >> $LOGFILE 2>&1
 140  echo "---------------------------------------"                              >> $LOGFILE 2>&1
 141  
 142  echo "delete the original md5sum file"                            >> $LOGFILE 2>&1
 143  rm -rf $MD5SUM                                           >> $LOGFILE 2>&1
 144  echo "---------------------------------------"                              >> $LOGFILE 2>&1
 145  
 146  cd $SPECDIR
 147  if test -f /etc/SuSE-release; then 
 148      echo -n "Building SUSE10.0 PHP4 RPM's ... "                    >> $LOGFILE 2>&1
 149      rpmbuild -ba --sign egroupware-suse-php4.spec                    2>&1 | tee $RHBASE/LOG/egroupware-suse-php4.log
 150      echo "done"                                    >> $LOGFILE 2>&1
 151      echo -n "Building SUSE10.0 PHP5 RPM's ... "                    >> $LOGFILE 2>&1
 152      rpmbuild -ba --sign egroupware-suse-php5.spec                    2>&1 | tee $RHBASE/LOG/egroupware-suse-php5.log
 153      echo "done"                                    >> $LOGFILE 2>&1
 154  else
 155      echo -n "Building Fedora Core4 RPM's ... "                    >> $LOGFILE 2>&1
 156      rpmbuild -ba --sign egroupware-fedora4.spec                    2>&1 | tee $RHBASE/LOG/egroupware-fedora4.log
 157      echo "done"                                    >> $LOGFILE 2>&1
 158  fi
 159  echo "Building of $PACKAGENAME $VERSION finnished"                    >> $LOGFILE 2>&1


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7