File: get-orig-source

package info (click to toggle)
placnet 1.04-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 140 kB
  • sloc: perl: 691; sh: 21; makefile: 8
file content (36 lines) | stat: -rwxr-xr-x 1,321 bytes parent folder | download
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
#!/bin/sh
# if you need to repack for whatever reason you can
# use this script via uscan or directly
#
# FIXME: currently the code is not conform to Debian Policy
#        http://www.debian.org/doc/debian-policy/ch-source.html
#        "get-orig-source (optional)"
#        This target may be invoked in any directory, ...
# --> currently it is assumed the script is called in the
#     source directory featuring the debian/ dir

COMPRESS=xz

set -e
NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`

TARDIR=${NAME}-${VERSION}

mkdir -p ../tarballs
cd ../tarballs
mkdir -p ${TARDIR}
cd ${TARDIR}
wget -q http://master.dl.sourceforge.net/project/placnet/placnet.pl
wget -q http://master.dl.sourceforge.net/project/placnet/makeRefDB.pl
wget -q http://master.dl.sourceforge.net/project/placnet/CHANGES.txt
DOWNLOADVERSION=`grep '^#v[0-9]' placnet.pl | sed 's/^#v//'`
if [ "${VERSION}" != "${DOWNLOADVERSION}" ] ; then
    echo "The downloaded version $DOWNLOADVERSION does not fit the Debian version $VERSION."
    echo "Please adapt debian/changelog."
    exit 1
fi
cd ..

GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
rm -rf ${TARDIR}