Bill Cox | 4527869 | 2010-12-20 15:05:23 -0500 | [diff] [blame] | 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/.*(// |
Bill Cox | 743d4ee | 2011-01-09 14:27:59 -0500 | [diff] [blame] | 7 | s/-.*//'` |
Bill Cox | 6c5e34d | 2011-01-12 13:57:25 -0500 | [diff] [blame^] | 8 | sed -i "s/LIB_TAG=.*/LIB_TAG=$version/" Makefile |
Bill Cox | 4527869 | 2010-12-20 15:05:23 -0500 | [diff] [blame] | 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 |
Bill Cox | 59b4dc8 | 2011-01-09 12:01:36 -0500 | [diff] [blame] | 15 | echo "sonic_${version} (git: `git log -1 --oneline | sed 's/ .*//'`)" > version |
Bill Cox | 4527869 | 2010-12-20 15:05:23 -0500 | [diff] [blame] | 16 | cd .. |
| 17 | if ! tar -cvzf sonic_$version.orig.tar.gz --exclude-vcs --exclude=debian sonic-$version; then |
| 18 | echo "Could not create sonic_$version.orig.tar.gz" |
| 19 | exit 1 |
| 20 | fi |
Bill Cox | 4527869 | 2010-12-20 15:05:23 -0500 | [diff] [blame] | 21 | echo "Successfully created sonic_$version.orig.tar.gz" |