File: get-orig-source.sh

package info (click to toggle)
libticables 1.3.4+dfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,368 kB
  • ctags: 2,309
  • sloc: sh: 11,957; ansic: 11,866; makefile: 153; sed: 16
file content (28 lines) | stat: -rwxr-xr-x 883 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
#!/bin/sh
#
# C.f. http://anonscm.debian.org/viewvc/debichem/unstable/openbabel/debian/get-orig-source.sh
#

set -ex

UPSTREAM_VERSION=$2
ORIG_TARBALL=$3

REAL_TARBALL=`readlink -f ${ORIG_TARBALL}`

WORKING_DIR=`dirname ${ORIG_TARBALL}`

ORIG_TARBALL_DFSG=`echo ${ORIG_TARBALL} | sed -e "s/\(${UPSTREAM_VERSION}\)\(\.orig\)/\1+dfsg\2/g"`
ORIG_TARBALL_DIR=`echo ${ORIG_TARBALL_DFSG} | sed -e "s/_\(${UPSTREAM_VERSION}\)/-\1/g" -e "s/\.tar\.bz2//g"`
ORIG_TARBALL_DIR_STRIP=`basename ${ORIG_TARBALL_DIR}`

mkdir -p ${ORIG_TARBALL_DIR}
tar --directory=${ORIG_TARBALL_DIR} --strip 1 -xjf ${REAL_TARBALL} || exit 1
rm -f ${ORIG_TARBALL} ${REAL_TARBALL}

# delete binaries:
find ${ORIG_TARBALL_DIR} -name "*.sys" -o -name "*.exe" -o -name "*.o" -o -name "*.exp" | xargs rm

tar --remove-files --directory ${WORKING_DIR} -cjf ${ORIG_TARBALL_DFSG} ${ORIG_TARBALL_DIR_STRIP} || exit 1

exit 0