File: get-orig-source

package info (click to toggle)
libpal-java 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 3,456 kB
  • ctags: 9,112
  • sloc: java: 45,715; makefile: 120; xml: 36; sh: 22
file content (30 lines) | stat: -rwxr-xr-x 931 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
29
30
#!/bin/sh
# unpack libpal-java tarball to get rid of several binaries

set -e
NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
UPSTREAMNAME=`echo $NAME | sed 's/lib\(.*\)-java/\1/'`

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.]\+\) .*${UPSTREAMNAME}.*?\1?"`
    if echo "$VERSION" | grep -q "upstream-version" ; then
        echo "Unable to parse version number"
        exit
    fi
fi

TARDIR=pal-1.5.1
mkdir -p ../tarballs/${TARDIR}
cd ../tarballs
mv ../${TARDIR}-src.zip .
cd ${TARDIR}
unzip -q ../${TARDIR}-src.zip

# Remove code which is not needed
rm -rf src/org doc/COPYRIGHT-org.w3c.dom.html doc/.*html*
cd ..

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