File: get-orig-source

package info (click to toggle)
jam-lib 0.1.20140824-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 920 kB
  • ctags: 1,031
  • sloc: java: 5,345; xml: 52; sh: 18; makefile: 10
file content (27 lines) | stat: -rwxr-xr-x 770 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

COMPRESS=xz

set -e

ORIGNAME=jam-lib
NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
#VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`

mkdir -p ../tarballs
cd ../tarballs
# need to clean up the tarballs dir first because upstream tarball might
# contain a directory with unpredictable name
rm -rf *
git clone --quiet https://github.com/rambaut/${ORIGNAME}.git
cd ${ORIGNAME}
VERSION=0.1.`git log  -n 1 --format="%ad" --date=short | sed 's/-//g'`
cd ..
TARDIR=${NAME}-${VERSION}
mv ${ORIGNAME} ${TARDIR}
rm -rf ${TARDIR}/.git
rm -rf ${TARDIR}/lib
rm -rf ${TARDIR}/src/jam/maconly

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