File: get-orig-source

package info (click to toggle)
figtree 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,884 kB
  • sloc: java: 16,669; xml: 246; sh: 28; makefile: 8
file content (62 lines) | stat: -rwxr-xr-x 1,732 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
# Obtaining the source tarball of FigTree is a bit tricky because here is no
# explicite link to a downloadable tarball on the web page and the source is
# only in SVN

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

cd ..
rm -f  download.html
mkdir -p tarballs
cd tarballs

svn export http://figtree.googlecode.com/svn/trunk/

# FIXME: Replace this by mv once the script is sufficiently tested
cp -a trunk ${PKG}-${VERSION}
cd ${PKG}-${VERSION}

# remove .svn dirs taht do not belong into upstream tarball
find . -type d -name .svn -exec rm -rf \{\} \; 2>/dev/null

# fix some broken permissions
for ext in icns jar java jnilib pdf png psd pdf tif ; do
    find . -type f -name "*.${ext}" -exec chmod 644 \{\} \;
done

# remove unneeded OSes
rm -rf release/Mac release/Windows

# remove jars which are provided as binaries but are not directly needed to build FigTree
#for jar in \
#	    jwt/ \
#	    libquaqua.jnilib \
#	    jdom.jar \
#	    swing-layout.jar \
#	    quaqua-filechooser-only.jar \
#	    quaqua-colorchooser-only.jar \
#	    quaqua.jar \
#	    jam.jar \
#	    jebl.jar \
#	    freehep.jar \
#	    itext.jar \
#        ; do
#    rm -rf lib/$jar
#done
# No particular JAR is needed any more
rm -rf lib/*

cd ..
GZIP="--best --no-name" tar -czf "$PKG"_"$VERSION".orig.tar.gz "$PKG"-"$VERSION"
rm -rf "$PKG"-"$VERSION"
rm -rf trunk