File: get-orig-source

package info (click to toggle)
aeskulap 0.2.2b1-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,164 kB
  • sloc: sh: 8,940; cpp: 8,849; ansic: 496; makefile: 316
file content (63 lines) | stat: -rwxr-xr-x 1,960 bytes parent folder | download | duplicates (5)
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
63
#!/bin/sh -e

NAME=aeskulap
UVERSION=0.2.2-beta1
DVERSION=0.2.2b1
UPSTREAMTAR="$NAME"-"$UVERSION".tar.gz
UPSTREAMDIR=`basename $UPSTREAMTAR .tar.gz`

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"
# Also these build-dependencies are needed to be installed to
# run ./configure which is a precondition for "make dist"
BUILDDEPS="libgtkmm-2.4-dev libglademm-2.4-dev libgconfmm-2.6-dev"
missingdepends=`dpkg -l ${BUILDTARBALLDEPENDS} ${BUILDDEPS} | \
    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://www.bms-austria.com/~pipelka/aeskulap/"$UPSTREAMTAR"
fi
tar -xzf "$UPSTREAMTAR"

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

cd "$UPSTREAMDIR"
# remove dcmtk stuff, once we are at it
# Leave the packaging directory untouched even if in Debian context useless
rm -rf COPYING.DCMTK dcmtk
echo "Upstream tarball repackaged without dcmtk at `date`." > NEWS

autoreconf
./configure
make dist
mv "$UPSTREAMDIR".tar.gz ../"$NAME"_"$DVERSION".orig.tar.gz
cd ..
rm -rf "$UPSTREAMDIR"