forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conddbdata-rpm-build.file
35 lines (28 loc) · 980 Bytes
/
conddbdata-rpm-build.file
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
### FILE conddbdata-rpm-build.file
%define realname %(echo %n | cut -d- -f2,3 | tr '-' '/')
%define realsub %(echo %n | cut -d- -f2)
%define cvsrepo cvs://:pserver:[email protected]:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e
%if "%{?dataDir:set}" != "set"
%define dataDir data
%endif
Source: %{cvsrepo}&tag=-r%{realversion}&module=%{realname}/%dataDir&export=%realsub&output=/src.tar.gz
#Source: download-url
%prep
%setup -n %realsub
%build
download_cmd=`which wget 2> /dev/null || echo ""`
if [ "X$download_cmd" = X ] ; then
download_cmd=`which curl 2> /dev/null || echo ""`
if [ "X$download_cmd" = X ] ; then
echo "ERROR: Unable to find wget or curl shell command to download" && exit 1
else
download_cmd="curl -L -f -q -s -O {}"
fi
else
download_cmd="wget --no-check-certificate {}"
fi
cd ../%realname/%dataDir
cat download.url | xargs -I "{}" $download_cmd
/bin/rm download.url
%install
/bin/cp -r %{_builddir}/%realsub %i