forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmssw-osenv.spec
43 lines (34 loc) · 1.25 KB
/
cmssw-osenv.spec
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
### RPM cms cmssw-osenv 240903.0
## NOCOMPILER
## NO_VERSION_SUFFIX
# ***Do not change minor number of the above version. ***
%define commit 9e83f8bfe574077556190dadff1a9aeed2dfb00b
%define branch master
# We do not use a revision explicitly, because revisioned packages do not get
# updated automatically when there are dependencies.
%define fakerevision %(echo %realversion | cut -d. -f1)
Source0: git://github.com/cms-sw/cmssw-osenv.git?obj=%{branch}/%{commit}&export=cmssw-osenv&output=/cmssw-osenv-%{commit}.tgz
%prep
%setup -n %{n}
%build
%install
rm -rf tests .gitignore
mkdir -p %{i}/common
mv * %{i}/common
%post
cd ${RPM_INSTALL_PREFIX}/%{pkgrel}
mkdir -p ${RPM_INSTALL_PREFIX}/common ${RPM_INSTALL_PREFIX}/etc/%{pkgname}
#Check if a newer revision is already installed
if [ -f ${RPM_INSTALL_PREFIX}/etc/%{pkgname}/version ] ; then
oldrev=$(cat ${RPM_INSTALL_PREFIX}/etc/%{pkgname}/version )
if [ ${oldrev} -ge %{fakerevision} ] ; then
exit 0
fi
fi
for file in $(find . -name '*' -type f -path '*/common/*') ; do
cp -f ${file} ${RPM_INSTALL_PREFIX}/${file}
done
for file in $(find . -name '*' -type l -path '*/common/*') ; do
cp -pRf ${file} ${RPM_INSTALL_PREFIX}/${file}
done
echo %{fakerevision} > ${RPM_INSTALL_PREFIX}/etc/%{pkgname}/version