Commit 9cfa3380 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Initial commit for legacy release 7.0.0-0.el7

parent 4c3331d9
#!/bin/bash
# Copyright 2017 CERN. Licensed under LGPLv3+.
# Verbose script
set -x
# Automatic exit on error
set -e
# Display the current working directory
pwd
ls -alt
ls -lRt
# FOR QUICK TESTS
###mkdir -p build; touch build/dummy; exit 0
# Determine the git branch
if [ "$(ls README-*.md | wc -l)" != 1 ]; then echo "ERROR! There should be a single README-<branch>.md file"; exit 1; fi
brn=$(ls README-*.md)
brn=${brn#README-}
brn=${brn%.md}
# ============================================
# === REDHAT branch (el6, el7)
# ============================================
if [ "${brn}" == "el6" ] || [ "${brn}" == "el7" ]; then
# Display current O/S
cat /etc/redhat-release
# Install wget
yum install -y -q wget
yum history
yumid=$(yum history | grep Install | awk '{print $1; exit 0}')
# Extract package name, version and release from the spec file
spc=HEP_OSlibs.spec
if [ "${brn}" == "el6" ]; then spc=HEP_OSlibs_SL6.spec; fi
COLON=$(printf "\x3a") # yaml gives CI errors otherwise...
nam=$(cat ${spc} | egrep "^Name${COLON}" | awk '{print $2}')
vrs=$(cat ${spc} | egrep "^Version${COLON}" | awk '{print $2}')
rls=$(cat ${spc} | egrep "^Release${COLON}" | awk '{split($2,a,"%"); print a[1]}')
dis=$(rpm -E "%{?dist}")
arc64=x86_64 # Hardcoded here (dependency lists are only computed for 64bit packages)
pkg64=${nam}-${vrs}-${rls}${dis}.${arc64}
rpm64=${pkg64}.rpm
rpmsr=${nam}-${vrs}-${rls}${dis}.src.rpm
dep64=${nam}.${arc64}
# Use the output directories of rpmbuild even if rpmbuild is not called in the CI
rpd64=$(rpm -E %_topdir)/RPMS/${arc64}
rpdsr=$(rpm -E %_topdir)/SRPMS
mkdir -p ${rpd64}
mkdir -p ${rpdsr}
# Old el6 or el7 pkg: download from WLCG or SLC6/CC7 and test installation
# Use SLC6/CC7 for el6 releases until 1.0.8 included (WLCG was not yet used)
# Use WLCG for el6 releases from 1.0.9 included and for all el7 releases
# Many releases, including the latest 1.0.20-0.el6 and 7.1.10-0.el7, are only in WLCG
if [ "${brn}" == "el7" ]; then
###url64=http://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/Packages/${rpm64}
###urlsr=http://linuxsoft.cern.ch/cern/centos/7/cern/Source/SPackages/${rpmsr}
url64=http://linuxsoft.cern.ch/wlcg/centos7/x86_64/${rpm64}
urlsr=http://linuxsoft.cern.ch/wlcg/centos7/SRPMS/${rpmsr}
elif [ "${brn}" == "el6" ]; then
vrsmaj=$(echo $vrs | cut -d '.' -f1)
vrsmin=$(echo $vrs | cut -d '.' -f2)
vrspat=$(echo $vrs | cut -d '.' -f3)
if [ "${vrsmaj}" == "1" ] && [ "${vrsmin}" == "0" ] && [[ ${vrspat} < 9 ]]; then
url64=http://linuxsoft.cern.ch/cern/slc6X/extras/x86_64/RPMS/${rpm64}
urlsr=http://linuxsoft.cern.ch/cern/slc6X/extras/SRPMS/${rpmsr}
else
url64=http://linuxsoft.cern.ch/wlcg/sl6/x86_64/${rpm64}
urlsr=http://linuxsoft.cern.ch/wlcg/sl6/SRPMS/${rpmsr}
fi
else
echo "INTERNAL ERROR! Unknown branch '${brn}'"
exit 1
fi
wget -q ${url64} -O ${rpd64}/${rpm64}
wget -q ${urlsr} -O ${rpdsr}/${rpmsr}
# Check that the expected 64-bit meta-package and source rpm have been downloaded
if [ ! -f ${rpd64}/${rpm64} ]; then echo "ERROR! ${rpm64} has not been downloaded"; exit 1; else echo "${rpm64} has been downloaded"; fi
if [ ! -f ${rpdsr}/${rpmsr} ]; then echo "ERROR! ${rpmsr} has not been downloaded"; exit 1; else echo "${rpmsr} has been downloaded"; fi
# Uninstall wget before dumping the packages installed by HEP_OSlibs
yum history -y -q undo ${yumid}
yum history
# Test the installation of the meta-package
# (NB: the correct Docker image must be used for this job!)
# Dump the list of newly installed packages
# (compare packages in O/S before and after installation of meta-package)
rpm -qa --queryformat '%{NAME}.%{ARCH}\n' > tmp0.txt
if ! yum install -y ${rpd64}/${rpm64} > tmplog.txt; then cat tmplog.txt; echo "ERROR! ${rpm64} could not be installed"; exit 1; else echo "${rpm64} has been installed"; fi
rpm -qa --queryformat '%{NAME}.%{ARCH}\n' > tmp1.txt
(! diff tmp0.txt tmp1.txt ) | grep "^>" | grep -v HEP_OSlibs | awk '{split($2,p,"/"); print p[1]}' | sort -u > ./${dep64}.dependencies-installed.txt
# Dump the list of direct dependencies of the meta-package
rpm -qpR ${rpd64}/${rpm64} | egrep -v "^rpmlib\(" | awk -vs64='(x86-64)' -vs32='(x86-32)' '{i64=index($1,s64); i32=index($1,s32); if (i64>0) print substr($1,0,i64-1)".x86_64"; else if (i32>0) print substr($1,0,i32-1)".i686"; else print $1".noarch"}' | sort -u > ./${dep64}.dependencies-direct.txt
# Dump the list of recursive dependencies of the meta-package (tree and flat)
if [ "${brn}" == "el6" ]; then
# [NB On el6, "--queryformat" is ignored by "repoquery --tree-requires"]
repoquery --tree-requires --installed ${pkg64} > ./${dep64}.dependencies-recursive-tree.txt
cat ./${dep64}.dependencies-recursive-tree.txt | awk '{for(i=1;i<=NF;++i) {if($i!="|"&&$i!="\\_"){print $i; break}}}' | grep -v HEP_OSlibs | sort -u | tr ":" " " | awk '{print $NF}' | xargs rpm -q --queryformat '%{NAME}.%{ARCH}\n' | sort -u > ./${dep64}.dependencies-recursive-flat.txt
else
repoquery --tree-requires --installed --queryformat '%{NAME}.%{ARCH} %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' ${pkg64} > ./${dep64}.dependencies-recursive-tree.txt
cat ./${dep64}.dependencies-recursive-tree.txt | awk '{for(i=1;i<=NF;++i) {if($i!="|"&&$i!="\\_"){print $i; break}}}' | grep -v HEP_OSlibs | sort -u > ./${dep64}.dependencies-recursive-flat.txt
fi
# Keep track of the O/S where dependency lists were determined
red=README-dependencies.md
echo "Dependency lists for the 64-bit meta-rpm were determined by installing it on a system running:" > ./${red}
echo "- *$(cat /etc/redhat-release)*" >> ./${red}
# Upload all artifacts
mkdir build
cp ${dep64}*.txt build/
cp ${red} build/
# ============================================
# === ERROR! Unknown branch
# ============================================
else
echo "ERROR! Unknown branch '${brn}'"
exit 1
fi
# Copyright 2017 CERN. Licensed under LGPLv3+.
stages:
- build # build and/or test the meta-package using the appropriate O/S
- deploy # upload the meta-package and all other artifacts
build_el7_job:
image: cern/cc7-base
stage: build
script: ./.gitlab-ci-redhat.sh
only:
- /^*.el7-testing$/
except:
- branches
artifacts:
paths:
- build/
expire_in: 1h
build_el6_job:
image: cern/slc6-base
stage: build
script: ./.gitlab-ci-redhat.sh
only:
- /^*.el6-testing$/
except:
- branches
artifacts:
paths:
- build/
expire_in: 1h
build_ubuntu1704_job:
image: ubuntu:zesty
stage: build
script: ./.gitlab-ci-ubuntu.sh
only:
- /^*.zesty-testing$/
except:
- branches
artifacts:
paths:
- build/
expire_in: 1h
build_ubuntu1604_job:
image: ubuntu:xenial
stage: build
script: ./.gitlab-ci-ubuntu.sh
only:
- /^*.xenial-testing$/
except:
- branches
artifacts:
paths:
- build/
expire_in: 1h
deploy_job:
image: cern/slc6-base
stage: deploy
script:
- ls -alt
- ls -lRt
only:
- /^*.el7-testing$/
- /^*.el6-testing$/
- /^*.zesty-testing$/
- /^*.xenial-testing$/
except:
- branches
artifacts:
paths:
- build/
expire_in: 100 yrs
Copyright 2009-2017 CERN.
HEP_OSlibs is a meta-package with dependencies on hundreds of packages created
by a range of individuals, teams and companies. Each of these packages may come
under a different copyright and licence. This copyright and licence policy for
HEP_OSlibs applies to all the scripts and code developed specifically to
assemble, distribute, install and document the HEP_OSlibs meta-package.
HEP_OSlibs is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later version.
HEP_OSlibs is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
The GNU Lesser General Public License is available at
<https://www.gnu.org/licenses/lgpl-3.0.txt>.
# **HEP_OSlibs meta-package for CentOS7 and CC7**
HEP_OSlibs is a meta-package that captures the Linux OS dependencies
of the software of the four LHC experiments.
On CentOS7, CC7 and other el7 RedHat systems,
this meta-package is released under the name HEP_OSlibs.
## Legacy releases for CentOS7 and CC7 (HEP_OSlibs for el7)
This [README-el7.md](/README-el7.md) is the gitlab documentation page
for legacy HEP_OSlibs releases 7.0.x and 7.1.x for el7,
built before the switch to the new gitlab-based workflow in October 2017.
The meta-package is designed to be installed on CentOS7/CC7 x86_64.
Different policies have been used over time
for the inclusion of 32-bit and 64-bit package-dependencies
in the meta-packages on el7:
- In the 7.0 release series, a single 64-bit meta-package was built,
including both 32-bit and 64-bit package dependencies.
This is the same policy used in HEP_OSlibs_SL6 for el6.
- In releases 7.1.0 to 7.1.9, separate 64-bit and 32-bit meta-packages
were built, including only the respective dependencies.
This was implemented by using ISA macros (`%{__isa}`).
- As of release 7.1.10, only the 64-bit meta-package with 64-bit
package dependencies have been built.
On CentOS7, all LHC experiments run their software in 64-bit mode only.
Legacy releases 7.0.0 to 7.1.9 were prepared using the following simple workflow:
- prepare a new spec file
- build a 64-bit meta-rpm (and a 32-bit meta-rpm where appropriate,
as described above) and the corresponding source rpm,
using `rpmbuild -bb` and `rpmbuild -bs`, respectively
- sign and install the meta-rpm('s) and the source rpm in the WLCG repository
- open a SNOW ticket asking the Linux support team at CERN
to sign and install the meta-rpm('s) and the source rpm in the SLC6 repository
During the migration to gitlab,
the following information has been committed and tagged in the git repository
for every el7 legacy release:
- the spec file for the release, extracted from the corresponding source rpm
- dependency lists for the 64-bit meta-rpm,
determined by installing this meta-package on a system running
a minimal Docker image of `cern/cc7-base` in the gitlab CI
Additional information is also available from the gitlab CI,
but has not been committed and tagged in the git repository.
## Current release: 7.0.0-0.el7
<!-- Throughout this file, all occurrences of "7.0.0-0.el7" are
automatically replaced with the latest tag by the pkg.sh script -->
This [README-el7.md](/README-el7.md) belongs to the documentation
for legacy release [7.0.0-0.el7](/../tree/7.0.0-0.el7).
The x86_64 meta-package for legacy release 7.0.0-0.el7 is available from the
[WLCG](http://linuxsoft.cern.ch/wlcg/centos7/x86_64/) and
[centos/7/cern](http://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/repoview/HEP_OSlibs.html) repositories at CERN:
- download http://linuxsoft.cern.ch/wlcg/centos7/x86_64/HEP_OSlibs-7.0.0-0.el7.cern.x86_64.rpm
- download http://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/Packages/HEP_OSlibs-7.0.0-0.el7.cern.x86_64.rpm
The following information for this release is available in gitlab:
- the spec file used to build the package: <br>
see [HEP_OSlibs.spec](HEP_OSlibs.spec)
- direct dependencies, as a list (from `rpm -qpR`): <br/>
see [HEP_OSlibs.x86_64.dependencies-direct.txt](dependencies/HEP_OSlibs.x86_64.dependencies-direct.txt)
- recursive dependencies, as a list (from `repoquery --tree-requires`): <br/>
see [HEP_OSlibs.x86_64.dependencies-recursive-flat.txt](dependencies/HEP_OSlibs.x86_64.dependencies-recursive-flat.txt)
- installed dependencies, as a list (from `rpm -qa`, before and after installation): <br/>
see [HEP_OSlibs.x86_64.dependencies-installed.txt](dependencies/HEP_OSlibs.x86_64.dependencies-installed.txt)
<!-- GITURL = https://gitlab.cern.ch/avalassi/heposlibs-test -- DO NOT DELETE! -->
The three dependency lists mentioned above, plus the following information,
are also available for download as gitlab CI
[artifacts](https://gitlab.cern.ch/avalassi/heposlibs-test/builds/artifacts/7.0.0-0.el7-testing/browse/build?job=deploy_job):
- recursive dependencies, as a tree (from `repoquery --tree-requires`): <br/>
download [HEP_OSlibs.x86_64.dependencies-recursive-tree.txt](https://gitlab.cern.ch/avalassi/heposlibs-test/builds/artifacts/7.0.0-0.el7-testing/raw/build/HEP_OSlibs.x86_64.dependencies-recursive-tree.txt?job=deploy_job)
## License
Copyright 2009-2017 CERN.
Licensed under [LGPLv3](https://www.gnu.org/licenses/lgpl-3.0.txt) or (at your option) any later version.
See [COPYRIGHT.txt](COPYRIGHT.txt) for more details.
HEP_OSlibs RPM repository
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment