File: get-orig-source

package info (click to toggle)
volpack 1.0b3-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,948 kB
  • sloc: ansic: 12,201; sh: 9,078; makefile: 91; csh: 76
file content (60 lines) | stat: -rwxr-xr-x 1,647 bytes parent folder | download | duplicates (7)
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
#!/bin/sh -e

NAME=volpack
VERSION=1.0b3
UPSTREAMTAR="$NAME"-"$VERSION".tar.Z
UPSTREAMDIR=`basename $UPSTREAMTAR .tar.Z`

patchname=get-orig-source_patch
patchfile="$patchname"
if [ ! -f "$patchfile" ] ; then
    if [ -d debian -a -f "debian/$patchname" ] ; then
	patchfile="debian/$patchname"
    else
	echo "File not found: $patchname"
	exit -1
    fi
fi
patchfile="`pwd`/$patchfile"

# To rebuild the new upstream tarball you need these
# packages installed.  This will be checked later on.
# The rationale behind this dependency is that the
# script should work for later upstream releases as well
# and thus a simple patch for Makefile.am and
# configure.in would not work
BUILDTARBALLDEPENDS="autoconf automake libtool libgconf2-dev intltool"
missingdepends=`dpkg -l ${BUILDTARBALLDEPENDS} | \
    grep -v -e "^ii" -e "^|" -e "^++" -e "^ " -e "^..[^[:space:]]" | \
    sed 's/^[a-z][a-z][[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+.*/\1/'`

if [ "$missingdepends" != "" ] ; then
    echo "Please install the following packages to rebuild the upstream source tarball:"
    echo $missingdepends
    exit -1
fi

mkdir -p ../tarballs
cd ../tarballs

if [ ! -f "$UPSTREAMTAR" ] ; then
    wget http://graphics.stanford.edu/software/volpack/"$UPSTREAMTAR"
fi
tar -xzf "$UPSTREAMTAR"

# Apply patch that removes dcmtk stuff from Makefile.in and configure.in
patch -p0 < "$patchfile"

cd "$UPSTREAMDIR"
chmod 755 makeopts

# gettextize --force --copy
libtoolize --force --copy
aclocal 
automake --add-missing --force-missing --gnu
autoconf
./configure
make dist
mv "$UPSTREAMDIR".tar.gz ../"$NAME"_"$VERSION".orig.tar.gz
cd ..
rm -rf "$UPSTREAMDIR"