forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmsLHEtoEOSManager.tmpl
30 lines (24 loc) · 948 Bytes
/
cmsLHEtoEOSManager.tmpl
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
### RPM cms cmsLHEtoEOSManager @VERSION@00
## NOCOMPILER
## NO_VERSION_SUFFIX
%define commit @COMMIT@
Source0: https://raw.githubusercontent.com/cms-sw/cmssw/%{commit}/GeneratorInterface/LHEInterface/scripts/cmsLHEtoEOSManager.py
%prep
%if "%{v}" != "%{realversion}"
echo "ERROR: %{v} does not match %{realversion}. Please update version number for %{n}."
exit 1
%endif
%build
%install
cp %{_sourcedir}/cmsLHEtoEOSManager.py %{i}
chmod +x %{i}/cmsLHEtoEOSManager.py
%post
#Check if a newer revision is already installed
if [ -f ${RPM_INSTALL_PREFIX}/etc/%{pkgname}/version ] ; then
if [ $(cat ${RPM_INSTALL_PREFIX}/etc/%{pkgname}/version) -ge %{realversion} ] ; then
exit 0
fi
fi
mkdir -p $RPM_INSTALL_PREFIX/share/overrides/bin ${RPM_INSTALL_PREFIX}/etc/%{pkgname}
cp ${RPM_INSTALL_PREFIX}/%{pkgrel}/cmsLHEtoEOSManager.py $RPM_INSTALL_PREFIX/share/overrides/bin
echo %{realversion} > ${RPM_INSTALL_PREFIX}/etc/%{pkgname}/version