| 1 |
#!/bin/sh |
| 2 |
# script to download and repack source package of maqview |
| 3 |
# It was intended to remove a copy of zlib which is not |
| 4 |
# a simple straightforeward because of use of internal features |
| 5 |
# Thus this script simply removes the .svn dir for the moment |
| 6 |
|
| 7 |
PKG=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'` |
| 8 |
|
| 9 |
if ! echo $@ | grep -q upstream-version ; then |
| 10 |
VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'` |
| 11 |
else |
| 12 |
VERSION=`uscan --verbose --force-download | \ |
| 13 |
grep "Newest version on remote site is .* local version is .*" | \ |
| 14 |
head -n 1 | \ |
| 15 |
sed "s/Newest version on remote site is \([-0-9.]\+\),.*/\1/"` |
| 16 |
if echo "$VERSION" | grep -q "upstream-version" ; then |
| 17 |
echo "Unable to parse version number" |
| 18 |
exit |
| 19 |
fi |
| 20 |
fi |
| 21 |
|
| 22 |
mkdir -p ../tarballs |
| 23 |
cd ../tarballs |
| 24 |
|
| 25 |
UTAR="${PKG}-${VERSION}.tar.gz" |
| 26 |
mv ../${UTAR} . |
| 27 |
tar -xzf ${UTAR} |
| 28 |
|
| 29 |
cd $PKG |
| 30 |
# It is not possible to simply remove the zlib code because it was used |
| 31 |
# the wrong way using internal implementation features which are changed |
| 32 |
# in current zlib in Debian |
| 33 |
# rm -rf zutil.[ch] zlib.h zconf.h uncompr.c trees.[ch] inftrees.[ch] inflate.[ch] inffixed.h inffast.[ch] infback.c gzio.c deflate.[ch] crc32.[ch] compress.c adler32.c |
| 34 |
# remove useless SVN dir |
| 35 |
rm -rf .svn |
| 36 |
cd .. |
| 37 |
|
| 38 |
mv ${PKG} ${PKG}-${VERSION} |
| 39 |
|
| 40 |
GZIP="--best --no-name" tar -czf "$PKG"_"$VERSION".orig.tar.gz "${PKG}-${VERSION}" |
| 41 |
rm -rf "${PKG}-${VERSION}" |