Codebase list proj-rdnap / c7c94cb
Update get-orig-source script to work from a temp directory. Bas Couwenberg 9 years ago
2 changed file(s) with 34 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
0 proj-rdnap (2008-3) UNRELEASED; urgency=medium
1
2 * Update get-orig-source script to work from a temp directory.
3
4 -- Bas Couwenberg <sebastic@debian.org> Sun, 03 May 2015 17:42:09 +0200
5
06 proj-rdnap (2008-2) unstable; urgency=medium
17
28 * Remove reference to appendix 1 from description.
00 #!/bin/sh
11 # if you need to repack for whatever reason you can
22 # use this script via uscan or directly
3 #
4 # FIXME: currently the code is not conform to Debian Policy
5 # http://www.debian.org/doc/debian-policy/ch-source.html
6 # "get-orig-source (optional)"
7 # This target may be invoked in any directory, ...
8 # --> currently it is assumed the script is called in the
9 # source directory featuring the debian/ dir
3
4 set -e
105
116 COMPRESS=xz
127
13 set -e
148 NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
9
10 PACKAGE=$NAME
11
12 DEBIANDIR=$(readlink -f $(dirname $0))
13 PACKAGEDIR=$(readlink -f $(dirname ${DEBIANDIR}))
14 PARENTDIR=$(readlink -f $(dirname ${PACKAGEDIR}))
15
16 CHANGELOGFILE=${DEBIANDIR}/changelog
17
18 TMPDIR=$(mktemp -d)
19
20 cd ${TMPDIR}
1521
1622 # RDNAPTRANS2008
1723 # https://www.kadaster.nl/web/file?uuid=f7ea740f-0f3c-402a-bf34-896dac7d557f&owner=23cbe925-35ce-4a72-ac8c-a33a0c19ae1e&contentid=9675
2026 # https://www.kadaster.nl/web/show?mode=preview&contentid=9674&id=107118&l_id=17022&webid=26098
2127
2228 if ! echo $@ | grep -q upstream-version ; then
23 VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
24 wget "https://www.kadaster.nl/web/file?uuid=f7ea740f-0f3c-402a-bf34-896dac7d557f&owner=23cbe925-35ce-4a72-ac8c-a33a0c19ae1e&contentid=9675" -O ../RDNAPTRANS2008.zip
29 VERSION=`dpkg-parsechangelog -l"$CHANGELOGFILE" | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
30 wget "https://www.kadaster.nl/web/file?uuid=f7ea740f-0f3c-402a-bf34-896dac7d557f&owner=23cbe925-35ce-4a72-ac8c-a33a0c19ae1e&contentid=9675" -O RDNAPTRANS2008.zip
2531 else
2632 VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${NAME}.*?\1?"`
2733 if echo "$VERSION" | grep -q "upstream-version" ; then
3036 fi
3137 fi
3238
33 mkdir -p ../tarballs
34 cd ../tarballs
35 # need to clean up the tarballs dir first because upstream tarball might
36 # contain a directory with unpredictable name
37 rm -rf *
38
39 unzip ../RDNAPTRANS2008.zip -d RDNAPTRANS2008
39 unzip RDNAPTRANS2008.zip -d RDNAPTRANS2008
4040
4141 # RDNAPTRANS2008.zip is not redistributable!
4242 # The grid correction files for PROJ.4 are shipped in the file NTv2_2008.zip,
5151 mv "${UPSTREAMTARDIR}" "${TARDIR}"
5252 fi
5353
54 GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf ../"$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
55 cd ../
56 rm -rf tarballs
54 ORIGTARFILE="${PACKAGE}_${VERSION}.orig.tar.${COMPRESS}"
55
56 GZIP="--best --no-name" XZ_OPT="-6v" tar --owner=root --group=root --mode=a+rX -caf ${ORIGTARFILE} "${TARDIR}"
57
58 mv ${ORIGTARFILE} ${PARENTDIR}
59
60 rm -rf ${TARDIR}
61 cd -
62 rm -rf ${TMPDIR}
63
64 exit 0