File: get-orig-source

package info (click to toggle)
fastjet 3.0.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,404 kB
  • ctags: 3,770
  • sloc: cpp: 21,498; sh: 10,546; fortran: 673; makefile: 527; ansic: 131
file content (32 lines) | stat: -rwxr-xr-x 584 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
32
#!/bin/bash

set -e

test $# == 3

URL="http://www.fastjet.fr/repo/"
VER="$2"

UPTAR="fastjet-$VER.tar.gz"
UPDIR="fastjet-$VER"

ORIGTAR="$(echo "$3" | sed -e 's/\.orig/+dfsg.orig/')"
ORIGDIR="fastjet-$VER+dfsg.orig"

DESTDIR="$(dirname "$ORIGTAR")"

test ! -f "$DESTDIR/$UPTAR" && wget "$URL/$UPTAR" -O "$DESTDIR/$UPTAR"
test -d "$UPDIR" && rm -rf "$UPDIR"

tar -xf "$DESTDIR/$UPTAR"

rm -rf "$UPDIR/plugins/ATLASCone"
rm -rf "$UPDIR/plugins/CDFCones"

mv "$UPDIR" "$ORIGDIR"

test -e "$ORIGTAR" && rm -f "$ORIGTAR"
GZIP=-9 tar --remove-files -zcf "$ORIGTAR" "$ORIGDIR"

rm -f "$3"