File: get-orig-source

package info (click to toggle)
libjloda-java 0.0%2B20161018-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,040 kB
  • ctags: 5,386
  • sloc: java: 38,958; xml: 48; sh: 20; makefile: 11
file content (28 lines) | stat: -rwxr-xr-x 976 bytes parent folder | download
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
#!/bin/sh -e

COMPRESS=xz

NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
ONAME=`echo $NAME | sed 's/lib\(.*\)-java/\1/'`
MVERSION=`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/danielhuson/${ONAME} ${NAME}
cd $NAME
VERSION=${MVERSION}+`date -d @$(git show --format="%at" | head -n1) +%Y%m%d`
# for esthetical reasons set file timestamps (if git-restore-mtime is installed)
git restore-mtime || true
cd ..
TARDIR=${NAME}-${VERSION}
mv ${NAME} ${TARDIR}
rm -rf ${TARDIR}/.git
rm -rf ${TARDIR}/jars/batik*
rm -rf ${TARDIR}/jars/Jama-*
find ${TARDIR} -name .DS_Store -delete

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