Skip to content

Commit

Permalink
Merge pull request #900 from degano/data_fireworks_geometry_70X
Browse files Browse the repository at this point in the history
Update Fireworks Geometry data files and include github script.
  • Loading branch information
aledegano committed Jul 29, 2014
2 parents 74870ea + 3fdf2c0 commit 057e422
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
7 changes: 5 additions & 2 deletions data-Fireworks-Geometry.spec
@@ -1,2 +1,5 @@
### RPM cms data-Fireworks-Geometry V06-13-20
## IMPORT data-cmssw-package-build
### RPM cms data-Fireworks-Geometry V07-02-00

%prep

## IMPORT data-build-github
41 changes: 41 additions & 0 deletions data-build-github.file
@@ -0,0 +1,41 @@
### FILE data-build-github.file
## NOCOMPILER

%build

DOWNLOAD_TOOL=$(basename $(which curl || which wget || echo "none"))
DOWNLOAD_FILE=%{realversion}.tar.gz
DEST_DIR=%{i}/$(echo "%{n}" | sed -e "s/data-//g;s/-/\//g")/data
GIT_REPO=$(echo "%{n}" | sed -e "s/data-//g")
GIT_URL=https://github.com/cms-data/${GIT_REPO}/archive/${DOWNLOAD_FILE}
mkdir -p ${DEST_DIR}
pushd ${DEST_DIR}

case "${DOWNLOAD_TOOL}" in
curl)
# cURL does not download empty files, touch file before downloading
touch ${DOWNLOAD_FILE}
curl -L -O -k $GIT_URL
;;
wget)
wget --no-check-certificate --no-verbose $GIT_URL
;;
none)
echo "Unsupported download tool. Could not locate curl or wget. Contact package maintainer."
exit 1
;;
esac

tar xzvf ${DOWNLOAD_FILE} --strip 1
rm ${DOWNLOAD_FILE}
popd

find %{i} -type d -exec chmod 0755 {} \;
find %{i} -type f -exec chmod 0644 {} \;

%install

%post
%define base_tool %(echo "%{n}" | tr '[a-z-]' '[A-Z_]')
echo "%{base_tool}_ROOT='${CMS_INSTALL_PREFIX}/%{pkgrel}'" > ${RPM_INSTALL_PREFIX}/%{pkgrel}/etc/profile.d/init.sh
echo "set %{base_tool}_ROOT='${CMS_INSTALL_PREFIX}/%{pkgrel}'" > ${RPM_INSTALL_PREFIX}/%{pkgrel}/etc/profile.d/init.csh

0 comments on commit 057e422

Please sign in to comment.