Skip to content
Snippets Groups Projects
Select Git revision
  • dc29c1224e877dc6c8156f40e53042f06a42173f
  • master default
  • trunk
  • RELEASE_6_5_DRIVEDB
  • RELEASE_6_6_DRIVEDB
  • RELEASE_7_0_DRIVEDB
  • RELEASE_7_2_DRIVEDB
  • RELEASE_7_3_DRIVEDB
  • RELEASE_6_0_DRIVEDB
  • RELEASE_6_1_DRIVEDB
  • RELEASE_6_2_DRIVEDB
  • RELEASE_6_3_DRIVEDB
  • RELEASE_6_4_DRIVEDB
  • tags/RELEASE_7_4
  • tags/RELEASE_7_3
  • RELEASE_5_41_DRIVEDB
  • RELEASE_5_42_DRIVEDB
  • RELEASE_5_43_DRIVEDB
  • tags/RELEASE_7_2
  • tags/RELEASE_7_1
  • tags/RELEASE_7_0
  • RELEASE_5_40_DRIVEDB
22 results

do_release

Blame
  • do_release 2.54 KiB
    #!/bin/bash -ev
    #
    # do a smartmontools release
    # (C) 2003-6 Bruce Allen <ballen4705@users.sourceforge.net>, 
    #          Guido Guenther <agx@sigxcpu.org>
    # $Id: do_release,v 1.40 2006/12/19 19:25:42 chrfranke Exp $
    
    # Notes on generating releases:
    # (1) update NEWS
    # (2) update CHANGELOG -- put in release number
    # (3) update release number in configure.in and smartmontools.spec
    # (4) update internal changelog in smartmontools.spec
    # (5) to test, set USECVS below to 0
    # (6) when satisfied, set USECVS below to 1
    
    USECVS=1
    
    KEYID=0x841ABAE8
    
    setup_cvs()
    {
      CVS_SERVER=fakevalue
      unset CVS_SERVER || echo "can't unset CVS_SERVER=$CVS_SERVER"
      CVS_RSH=ssh
      CVSROOT=:ext:ballen4705@smartmontools.cvs.sourceforge.net:/cvsroot/smartmontools
    }
    
    get_release()
    {
      VERSION=`grep 'AC_INIT' configure.in | awk '{ print $2 }' | sed s/,//g`
      RELEASE="RELEASE_${VERSION//\./_}"
      echo "Version: $VERSION"
      echo "Release: $RELEASE"
    }
    
    inc_release()
    {
      MINOR=`echo $VERSION | cut -d. -f2`
      MAJOR=`echo $VERSION | cut -d. -f1`
      PERL_OLD=$MAJOR\\.$MINOR
      ((MINOR++))
      NEW_VERSION=$MAJOR.$MINOR
      PERL_NEW=$MAJOR\\.$MINOR	
      NEW_RELEASE="RELEASE_${NEW_VERSION//\./_}"
      echo "New Version: $NEW_VERSION"
      echo "New Release: $NEW_RELEASE"
    }
    
    # run automake/autoconf
    if [ -f Makefile ] ; then
      make distcheck || exit 1
      make clean
      make distclean
      rm -f Makefile configure
    fi
    
    smartmontools_release_date=`date -u +"%Y/%m/%d"`
    smartmontools_release_time=`date -u +"%T %Z"`
    cat configure.in  | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
    cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.in
    rm -f configure.tmp
    
    ./autogen.sh
    
    get_release
    
    # tag CVS version
    if [ $USECVS -ne 0 ] ; then
        setup_cvs
        cvs commit -m "Release $VERSION $RELEASE"
        cvs tag -d $RELEASE 
        cvs tag $RELEASE
    fi
    
    # build .tar.gz
    rm -rf build
    mkdir build
    cd build
    ../configure
    make distcheck || exit 1
    cd ..
    
    # increase release number:
    inc_release
    if [ $USECVS -ne 0 ] ; then
        perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.in
        perl -p -i.bak -e "s/Version:\t$PERL_OLD/Version:\t$PERL_NEW/" smartmontools.spec
    fi
    
    cp -f build/smartmontools-$VERSION.tar.gz .
    if [ "$KEYID" ]; then
      gpg --default-key $KEYID --armor --detach-sign ./smartmontools-$VERSION.tar.gz
    fi
    
    # cleanup
    rm -rf autom4te.cache build/ config.h.in Makefile.in examplescripts/Makefile.in \
           depcomp mkinstalldirs install-sh configure config.guess config.sub \
           aclocal.m4 missing *.bak