Skip to content
Snippets Groups Projects
Select Git revision
  • d8927dda7f1e4bd1d89a3e04311373f02bce4f08
  • 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
  • user avatar
    ballen4705 authored
    git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@1928 4ea69e1a-61f1-4043-bf83-b5c94c648137
    d8927dda
    History
    do_release 2.82 KiB
    #!/bin/bash -ev
    #
    # do a smartmontools release
    # (C) 2003-4 Bruce Allen <ballen4705@users.sourceforge.net>, 
    #          Guido Guenther <agx@sigxcpu.org>
    # $Id: do_release,v 1.32 2004/09/05 21:04:56 ballen4705 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
    
    USECVS=1
    
    KEYID=0x9BB19A22
    
    if [ -f /etc/redhat-release ]; then
      RPM_BASE=/usr/src/redhat/
    else
      RPM_BASE=/usr/src/rpm/
    fi
    SOURCES=$RPM_BASE/SOURCES/
    
    setup_cvs()
    {
      CVS_SERVER=fakevalue
      unset CVS_SERVER || echo "can't unset CVS_SERVER=$CVS_SERVER"
      CVS_RSH=ssh
      CVSROOT=:ext:ballen4705@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 ..
    cp build/smartmontools-$VERSION.tar.gz $SOURCES
    
    # build rpm
    rpmbuild -ba --sign smartmontools.spec
    
    # remove source tarball
    rm -f $SOURCES/smartmontools-$VERSION.tar.gz
    
    # 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
    
    mv -f $RPM_BASE/RPMS/i386/smartmontools-$VERSION-*.i386.rpm .
    mv -f $RPM_BASE/SRPMS/smartmontools-$VERSION-*.src.rpm .
    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 aclocal.m4 missing *.bak