File: get-orig-source

package info (click to toggle)
lhapdf 5.8.7%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 18,096 kB
  • sloc: fortran: 55,662; sh: 10,220; cpp: 2,033; ansic: 612; python: 488; makefile: 426
file content (41 lines) | stat: -rwxr-xr-x 882 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
37
38
39
40
41
#!/bin/bash

set -e

test $# == 3

URL="http://www.hepforge.org/archive/lhapdf"
VER="$2"

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

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

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

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

tar -xf "$DESTDIR/$UPTAR"

# get PDFsets

mkdir -p "$UPDIR/PDFsets"

for pdf in cteq5l.LHgrid cteq61.LHgrid cteq61.LHpdf MRST2004nlo.LHgrid \
	cteq6ll.LHpdf GRV98nlo.LHgrid MRST2001nlo.LHgrid; do
	wget "$URL/pdfsets/$VER/$pdf" -O "$UPDIR/PDFsets/$pdf"
done

# remove generated source files
rm -f "$UPDIR/pyext/lhapdf.py" "$UPDIR/pyext/lhapdf_wrap.cc" \
	"$UPDIR/src/parmsetup.inc"

mv "$UPDIR" "$ORIGDIR"

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

rm -f "$3"