forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PhedexReplicaMonitoring.spec
48 lines (43 loc) · 1.74 KB
/
PhedexReplicaMonitoring.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
### RPM cms PhedexReplicaMonitoring v00.00.16
## INITENV +PATH PYTHONPATH %i/${PYTHON_LIB_SITE_PACKAGES}
%define wmcver 1.1.1.pre4
%define webdoc_files %{installroot}/%{pkgrel}/doc/
%define pkg PhedexReplicaMonitoring
%define wmcpkg WMCore
Source0: git://github.com/dmwm/PhedexReplicaMonitoring?obj=master/%realversion&export=%pkg&output=/%pkg.tar.gz
Source1: git://github.com/dmwm/WMCore?obj=master/%wmcver&export=%{wmcpkg}_%n&output=/%{wmcpkg}_%n.tar.gz
Requires: python py2-py4j py2-stomp java-jdk elasticsearch elasticsearch-hadoop kibana rotatelogs
BuildRequires: py2-sphinx
# RPM macros documentation
# http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html
%prep
#%setup -b 0 -n %pkg
%setup -c
%setup -T -D -a 1
%build
cd %{wmcpkg}_%n
python setup.py build_system -s wmc-wmarchive
%install
cd %{wmcpkg}_%n
python setup.py install_system -s wmc-wmarchive --prefix=%i
cd ../%pkg
mkdir -p %i/${PYTHON_LIB_SITE_PACKAGES}
mkdir -p %i/bin
cp -r src/python/* %i/${PYTHON_LIB_SITE_PACKAGES}
cp src/scripts/*.sh %i/bin
cp -r data %i/
cp -r etc %i/
touch %i/${PYTHON_LIB_SITE_PACKAGES}/WMCore/Services/__init__.py
# Generate dependencies-setup.{sh,csh} so init.{sh,csh} picks full environment.
mkdir -p %i/etc/profile.d
: > %i/etc/profile.d/dependencies-setup.sh
: > %i/etc/profile.d/dependencies-setup.csh
for tool in $(echo %{requiredtools} | sed -e's|\s+| |;s|^\s+||'); do
root=$(echo $tool | tr a-z- A-Z_)_ROOT; eval r=\$$root
if [ X"$r" != X ] && [ -r "$r/etc/profile.d/init.sh" ]; then
echo "test X\$$root != X || . $r/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh
echo "test X\$?$root = X1 || source $r/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh
fi
done
%post
%{relocateConfig}etc/profile.d/dependencies-setup.*sh