This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
create_packages.sh
executable file
·76 lines (58 loc) · 2.43 KB
/
create_packages.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
THIS=$(dirname ${BASH_SOURCE[0]})
# Check all needed variable are defined
[[ "${LCG_VERSION:?Need to set LCG_VERSION non-empty}" &&
"${FCC_VERSION:?Need to set FCC_VERSION non-empty}" &&
"${PLATFORM:?Need to set PLATFORM non-empty}" ]]
# Detect day if not set
if [[ -z ${weekday+x} ]]; then
export weekday=`date +%a`
fi
if [[ $LCG_VERSION == LCG_* ]]; then
LCG_externals="/cvmfs/sft.cern.ch/lcg/releases/$LCG_VERSION/LCG_*_${PLATFORM}.txt"
else
LCG_externals="/cvmfs/sft.cern.ch/lcg/nightlies/$LCG_VERSION/$weekday/LCG_*_${PLATFORM}.txt"
fi
echo "Using LCG externals from: $LCG_externals"
echo "Modification date: `stat $LCG_externals | grep Modify | tr -s " " | cut -d" " -f2,3`"
python $THIS/create_lcg_package_specs.py --blacklist $THIS/config/packages-${FCC_VERSION}.yaml "$LCG_externals"
cp $THIS/config/packages-default.yaml $WORKSPACE/packages.yaml
# apply some changes
# Replace tbb name
sed -i 's/tbb:/intel-tbb:/' $WORKSPACE/${LCG_VERSION}_packages.yaml
sed -i 's/tbb@/intel-tbb@/' $WORKSPACE/${LCG_VERSION}_packages.yaml
# Replace xerces-c name
sed -i 's/xercesc:/xerces-c:/' $WORKSPACE/${LCG_VERSION}_packages.yaml
sed -i 's/xercesc@/xerces-c@/' $WORKSPACE/${LCG_VERSION}_packages.yaml
# Replace java name
sed -i 's/java:/jdk:/' $WORKSPACE/${LCG_VERSION}_packages.yaml
sed -i 's/java@/jdk@/' $WORKSPACE/${LCG_VERSION}_packages.yaml
# append lcg specs to default packages.yaml
cat $WORKSPACE/${LCG_VERSION}_packages.yaml | tail -n +2 >> $WORKSPACE/packages.yaml
cat $THIS/config/packages-${FCC_VERSION}.yaml >> $WORKSPACE/packages.yaml
# Custom packages
# Gitpython python package
IFS=- read -ra PART <<< "$PLATFORM"
OS="${PART[1]}"
COMPILER="${PART[2]}"
# Set up compiler
python $THIS/get_compiler.py $LCG_externals
lcg_compiler=`cat lcg_compiler.txt`
# Default values
gcc49version=4.9.3
gcc62version=6.2.0
gcc73version=7.3.0
gcc8version=8.3.0
# gcc8 is an abstraction of the full versio (8.2.0, 8.3.0, ...), hence it can point
# to different specific version of gcc-8.X.X
IFS='.' read -ra lcg_compiler_version <<< "$lcg_compiler"
COMPILER_TWO_DIGITS="${lcg_compiler_version[0]}${lcg_compiler_version[1]}"
if [ $COMPILER_TWO_DIGITS == "82" ]; then
gcc8version=8.2.0
fi
export compilerversion=${COMPILER}version
cat << EOF >> $WORKSPACE/packages.yaml
py-gitpython:
buildable: false
paths: {[email protected]%gcc@${!compilerversion} arch=x86_64-${OS}: /cvmfs/fcc.cern.ch/sw/0.8.3/gitpython/lib/python2.7/site-packages}
EOF