forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPHEDEX-admin.spec
107 lines (97 loc) · 3.43 KB
/
PHEDEX-admin.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
### RPM cms PHEDEX-admin 4.2.2
# Dummy line to force a rebuild
## INITENV +PATH PERL5LIB %i/perl_lib
%define downloadn %(echo %n | cut -f1 -d-)
%define downloadp %(echo %n | cut -f2 -d- | tr '[a-z]' '[A-Z]')
%define downloadt %(echo %realversion | tr '.' '_')
%define setupdir %{downloadn}-%{downloadp}_%{downloadt}
Source: https://github.com/dmwm/PHEDEX/archive/%{downloadp}_%{downloadt}.tar.gz
# Oracle libs
Requires: oracle oracle-env
# perl libs
Requires: p5-time-hires p5-text-glob p5-compress-zlib p5-dbi
Requires: p5-dbd-oracle p5-xml-parser p5-poe p5-poe-component-child
Requires: p5-log-log4perl p5-log-dispatch p5-log-dispatch-filerotate
Requires: p5-params-validate p5-monalisa-apmon
Requires: p5-clone p5-json-xs p5-mail-rfc822-address
Requires: p5-crypt-ssleay
# Actually, it is p5-xml-parser that requires this, but it doesn't configure itself correctly
# This is so it gets into our dependencies-setup.sh
Requires: expat
# Provided by system perl
Provides: perl(HTML::Entities)
Provides: perl(DB_File)
Provides: perl(Date::Manip)
Provides: perl(XML::LibXML)
# Fake provide of twitter client; needs to be installed manually
Provides: perl(Net::Twitter::Lite)
%prep
%setup -n %{setupdir}
rm -rf Build
rm -rf Contrib
rm -rf Documentation/ACAT2008
rm -rf Documentation/DC04PostMortem
rm -rf Documentation/DC04Stats
rm -rf Documentation/Grid2005
rm -rf Documentation/Updates
rm -rf Documentation/WebConfig
rm -rf Documentation/WebSite
rm -rf Documentation/WhitePapers
rm -rf Migration
rm -rf perl_lib/DMWMMON
rm -f perl_lib/PHEDEX/.project
rm -f perl_lib/PHEDEX/CLI/FakeAgent.pm
rm -f perl_lib/PHEDEX/CLI/SiteDataInfo.pm
rm -rf perl_lib/PHEDEX/Namespace/SpaceCountCommon.pm
rm -rf perl_lib/PHEDEX/Namespace/*/spacecount.pm
rm -rf perl_lib/PHEDEX/Testbed
rm -rf perl_lib/PHEDEX/Tests
rm -rf perl_lib/PHEDEX/Web/API
rm -rf perl_lib/PHEDEX/Web/{C,D,F,U}*
rm -rf perl_lib/PHEDEX/Web/S{pooler,QLSpace}.pm
rm -rf PhEDExWeb
rm -f Schema/GenPartitions.pl
rm -f Schema/Oracle{Init,}Spacemon.sql
rm -f Schema/Setup-Role-Access.pl
rm -rf Testbed
rm -rf Tests
rm -rf Toolkit/Management
rm -rf Toolkit/Peers
rm -rf Toolkit/Test
rm -f Utilities/AuthMapper.pl
rm -f Utilities/CheckPhEDExContactUsercert.py
rm -f Utilities/GetNodeIds
rm -f Utilities/RequestAdministartion.pl
rm -f Utilities/RequestPhEDExContactUsercert.py
rm -f Utilities/RoleMap.txt
rm -f Utilities/RoleMapper.pl
rm -f Utilities/RouterControl
rm -f Utilities/spacecount
rm -f Utilities/spacemon
rm -f Utilities/spacemon-read-from-datasvc
rm -f Utilities/spacemon-test
rm -f Utilities/stacc
rm -rf Utilities/testSpace
rm -f Utilities/WebServiceWrite.pl
%build
%install
mkdir -p %i/etc
tar -cf - * | (cd %i && tar -xf -)
# Set permissions
chmod 755 %i/Utilities/*
# Copy dependencies to dependencies-setup.sh
mkdir -p %i/etc/profile.d
for x in %pkgreqs; do
case $x in /* ) continue ;; esac
p=%{instroot}/%{cmsplatf}/$(echo $x | sed 's/\([^+]*\)+\(.*\)+\([A-Z0-9].*\)/\1 \2 \3/' | tr ' ' '/')
echo ". $p/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
echo "source $p/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
done
# Make "env.sh" = "init.sh" for legacy configs
echo ". %i/etc/profile.d/init.sh" > %i/etc/profile.d/env.sh
echo "source %i/etc/profile.d/init.csh" > %i/etc/profile.d/env.csh
%post
%{relocateConfig}etc/profile.d/env.sh
%{relocateConfig}etc/profile.d/env.csh
%{relocateConfig}etc/profile.d/dependencies-setup.sh
%{relocateConfig}etc/profile.d/dependencies-setup.csh