File: orig-tar.sh

package info (click to toggle)
json-simple 1.1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 276 kB
  • ctags: 206
  • sloc: java: 1,808; xml: 140; sh: 23; makefile: 6
file content (31 lines) | stat: -rwxr-xr-x 992 bytes parent folder | download | duplicates (2)
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
#!/bin/sh -e

# called by uscan with '--upstream-version' <version> <file>
SOURCE_NAME=json-simple
VERSION=$2
EXCLUDE_FILE="$(dirname "$0")/$(basename "$0" .sh).exclude"
if [ -f "${EXCLUDE_FILE}" ]; then
  DEBIAN_VERSION=$VERSION+dfsg1
else
  DEBIAN_VERSION=$VERSION
fi
DEBIAN_SOURCE_DIR=${SOURCE_NAME}-$DEBIAN_VERSION
TAR=${USCAN_DESTDIR:-..}/${SOURCE_NAME}_$DEBIAN_VERSION.orig.tar.bz2
FLAG_FILE="$3"

# Mandatory cleanup
clean () {
  rm -fr ${DEBIAN_SOURCE_DIR} ${FLAG_FILE}
}
trap 'clean' EXIT INT QUIT KILL ABRT

# Get the source tree from SVN
svn export http://json-simple.googlecode.com/svn/tags/tag_release_$(echo $VERSION | sed 's/\./_/g') ${DEBIAN_SOURCE_DIR}
# Build orig tarball
if [ -f "${EXCLUDE_FILE}" ]; then
  tar -c -j -X debian/orig-tar.exclude -f $TAR ${DEBIAN_SOURCE_DIR}/
  echo "${SOURCE_NAME}: Applied DFSG removals and set up tarball to `basename ${TAR}`"
else
  tar -c -j -f $TAR ${DEBIAN_SOURCE_DIR}/
  echo "${SOURCE_NAME}: Set up tarball to `basename ${TAR}`"
fi