Home | History | Annotate | Download | only in sonic
      1 #!/bin/bash
      2 
      3 # Build an original tar-ball for a debian package free of a debian directory and
      4 # .git.
      5 
      6 version=`head -1 debian/changelog | sed 's/.*(//
      7      s/-.*//'`
      8 sed -i "s/LIB_TAG=.*/LIB_TAG=$version/" Makefile
      9 if [ "`basename $PWD`" != "sonic-$version" ]; then
     10     echo "Directory name should be sonic-$version"
     11     exit 1
     12 fi
     13 make clean
     14 make -f debian/rules clean
     15 echo "sonic_${version} (git: `git log -1 --oneline | sed 's/ .*//'`)" > version
     16 git2cl > ChangeLog
     17 cd ..
     18 if ! tar -cvzf sonic_$version.orig.tar.gz --exclude-vcs --exclude=debian sonic-$version; then 
     19     echo "Could not create sonic_$version.orig.tar.gz"
     20     exit 1
     21 fi
     22 echo "Successfully created sonic_$version.orig.tar.gz"
     23