Debian Codegraph @

debian/get-orig-source

raw symbols SCIP
1 #!/bin/sh -e
2 # creating source tarbal for abacas which comes as plain Perl file
3 # and needs to be putin to a tarball
4
5 PKG=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
6
7 if ! echo $@ | grep -q upstream-version ; then
8 # if called manually run uscan to obtain file and version number
9 # VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
10 VERSION=`uscan --verbose --force-download | \
11 grep "Newest version on remote site is .* local version is .*" | \
12 head -n 1 | \
13 sed "s/Newest version on remote site is \([-0-9.]\+\),.*/\1/"`
14 else
15 # If called by uscan
16 VERSION=`echo $@ | sed 's?^.*--upstream-version \([0-9.]\+\) .*abacas.*?\1?'`
17 if echo "$VERSION" | grep -q "upstream-version" ; then
18 echo "Unable to parse version number"
19 exit
20 fi
21 fi
22
23 #if [ "$VERSION" = "" ] ; then
24 # VERSION=`ls ../${PKG}.*.pl | sed "s/.*$PKG\.\(.*\)\.pl/\1/"`
25 #fi
26
27 mkdir -p ../tarballs/${PKG}-${VERSION}
28 cd ../tarballs
29
30 # Rename perl file (without .pl suffix) and fix perl path
31 sed -e '1s?/usr/local/bin/perl?/usr/bin/perl?' \
32 -e "s/^${PKG}.pl/${PKG}/" \
33 ../${PKG}.${VERSION}.pl > ${PKG}-${VERSION}/${PKG}
34 touch -r ../${PKG}.${VERSION}.pl ${PKG}-${VERSION}/${PKG}
35 rm -f ../${PKG}.${VERSION}.pl
36
37 cd ${PKG}-${VERSION}
38 wget -q -N http://abacas.sourceforge.net/Manual.html
39 sed -i -e 's?index.html">Home?http://abacas.sourceforge.net/&?' \
40 -e 's?documentation.html">Documentation?http://abacas.sourceforge.net/&?' \
41 -e 's/perl abacas\.pl/abacas/' \
42 -e 's/abacas\.pl/abacas/' \
43 Manual.html
44 wget -q -N http://abacas.sourceforge.net/style.css
45 cd ..
46
47 GZIP="--best --no-name" tar -czf "$PKG"_"$VERSION".orig.tar.gz "$PKG"-"$VERSION"
48 rm -rf "$PKG"-"$VERSION"