Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

back-port cmsswdata changes from next to stable branch #2215

Merged
merged 3 commits into from Mar 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions cmsswdata-toolfile.spec
Expand Up @@ -20,14 +20,11 @@ cat << \EOF_TOOLFILE > %i/searchpath.xml
<runtime name="CMSSW_DATA_PATH" value="$CMSSWDATA_BASE" type="path"/>
EOF_TOOLFILE

for tool in `echo %requiredtools | tr ' ' '\n' | grep 'data-'` ; do
uctool=`echo $tool | tr '-' '_' | tr '[a-z]' '[A-Z]'`
toolbase=`eval echo \\$${uctool}_ROOT`
if [ "X$toolbase" = X ] ; then exit 1 ; fi
toolver=`basename $toolbase | sed 's|-cms[0-9]*||'`
pack=`echo $tool | sed 's|data-||;s|-|/|'`
for toolbase in `echo %pkgreqs | tr ' ' '\n' | grep 'cms/data-'` ; do
toolver=`basename $toolbase`
pack=`echo $toolbase | cut -d/ -f2 | sed 's|data-||;s|-|/|'`
echo " <flags CMSSW_DATA_PACKAGE=\"$pack=$toolver\"/>" >> %i/etc/scram.d/cmsswdata.xml
echo " <runtime name=\"CMSSW_SEARCH_PATH\" default=\"$toolbase\" type=\"path\"/>" >> %i/searchpath.xml
echo " <runtime name=\"CMSSW_SEARCH_PATH\" default=\"%cmsroot/share/$toolbase\" type=\"path\"/>" >> %i/searchpath.xml
done

cat %i/searchpath.xml >> %i/etc/scram.d/cmsswdata.xml
Expand Down
13 changes: 13 additions & 0 deletions cmsswdata.spec
Expand Up @@ -59,3 +59,16 @@ Requires: data-GeneratorInterface-ReggeGribovPartonMCInterface
%post
echo "%{BaseTool}_ROOT='$CMS_INSTALL_PREFIX/%{pkgrel}'" > $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh
echo "set %{BaseTool}_ROOT='$CMS_INSTALL_PREFIX/%{pkgrel}'" > $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.csh

for DATA_PATH in %directpkgreqs; do
SOURCE=$RPM_INSTALL_PREFIX/%{cmsplatf}/$DATA_PATH
PKG_DATA=$(ls $SOURCE | grep -v etc*)
if [ -d $SOURCE/$PKG_DATA ] ; then
echo "Moving $DATA_PATH in $SHARED"
mkdir -p $RPM_INSTALL_PREFIX/share/$DATA_PATH/$PKG_DATA
rsync -a $SOURCE/$PKG_DATA/ $RPM_INSTALL_PREFIX/share/$DATA_PATH/$PKG_DATA/
rm -rf $SOURCE/$PKG_DATA
ln -fs ../../../../share/$DATA_PATH/$PKG_DATA $SOURCE/$PKG_DATA
fi
done