File: get-orig-source

package info (click to toggle)
libmems 1.6.0%2B4725-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,164 kB
  • sloc: cpp: 21,579; ansic: 4,313; xml: 115; makefile: 107; sh: 26
file content (32 lines) | stat: -rwxr-xr-x 1,074 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# get source for libMems from SVN because there is no source tarball distribution

set -e
NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`

if ! echo $@ | grep -q upstream-version ; then
    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
else
    VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${NAME}.*?\1?"`
    if echo "$VERSION" | grep -q "upstream-version" ; then
        echo "Unable to parse version number"
        exit
    fi
fi

SVNURI="svn://svn.code.sf.net/p/mauve/code/libMems/trunk"
revision=`LANG=C svn info ${SVNURI} | grep "^Last Changed Rev:" | sed 's/Last Changed Rev: *//'`
VERSION=`echo ${VERSION}| sed "s/+[0-9]\+$//"`+${revision}

TARDIR=${NAME}-${VERSION}

mkdir -p ../tarballs
cd ../tarballs
# svn export conserves time stamps of the files, checkout does not
LC_ALL=C svn export ${SVNURI} ${TARDIR} >/dev/null 2>/dev/null

cd ${TARDIR}
cd ..

tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.xz "${TARDIR}"
rm -rf "${NAME}"-"$VERSION"