blob: 6535635f1977c99b8d4fa51d2511afe36e774213 [file] [log] [blame]
Bill Cox45278692010-12-20 15:05:23 -05001#!/bin/bash
2
3# Build an original tar-ball for a debian package free of a debian directory and
4# .git.
5
6version=`head -1 debian/changelog | sed 's/.*(//
Bill Cox743d4ee2011-01-09 14:27:59 -05007 s/-.*//'`
Bill Cox6c5e34d2011-01-12 13:57:25 -05008sed -i "s/LIB_TAG=.*/LIB_TAG=$version/" Makefile
Bill Cox45278692010-12-20 15:05:23 -05009if [ "`basename $PWD`" != "sonic-$version" ]; then
10 echo "Directory name should be sonic-$version"
11 exit 1
12fi
13make clean
14make -f debian/rules clean
Bill Cox59b4dc82011-01-09 12:01:36 -050015echo "sonic_${version} (git: `git log -1 --oneline | sed 's/ .*//'`)" > version
Bill Cox0e01d012011-04-18 10:55:43 -040016git2cl > ChangeLog
Bill Cox45278692010-12-20 15:05:23 -050017cd ..
18if ! 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
21fi
Bill Cox45278692010-12-20 15:05:23 -050022echo "Successfully created sonic_$version.orig.tar.gz"