forked from xcat2/xcat-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxCAT-SoftLayer.spec
90 lines (73 loc) · 3.15 KB
/
xCAT-SoftLayer.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
Summary: Utilities to make xCAT work in a SoftLayer environment
Name: xCAT-SoftLayer
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System
Source: xCAT-SoftLayer-%{version}.tar.gz
Packager: IBM Corp.
Vendor: IBM Corp.
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%ifos linux
BuildArch: noarch
%endif
Requires: xCAT-server
# perl-ExtUtils-MakeMaker, perl-CPAN, perl-Test-Harness are only available in rhel.
# When this rpm supports being installed in sles, need to add these to xcat-dep.
# perl-SOAP-Lite is already in xcat-dep
Requires: perl-ExtUtils-MakeMaker perl-CPAN perl-Test-Harness perl-SOAP-Lite
Provides: xCAT-SoftLayer = %{epoch}:%{version}
%description
xCAT-SoftLayer provides Utilities to make xCAT work in a SoftLayer environment. This package should be installed on your management server
# %define VERBOSE %(if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ];then echo 1; else echo 0; fi)
# %define NOVERBOSE %(if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ];then echo 0; else echo 1; fi)
# %define NOVERBOSE %{?VERBOSE:1}%{!?VERBOSE:0}
%prep
# %if %NOVERBOSE
# echo NOVERBOSE is on
# set +x
# %elseif
# set -x
# %endif
%setup -q -n xCAT-SoftLayer
%build
# Convert pods to man pages and html pages
./xpod2man
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/python
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/python/xcat
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/install
#mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-SoftLayer
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install
cp -p -R share/xcat/install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/install/
cp -d bin/* $RPM_BUILD_ROOT/%{prefix}/bin
chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
cp -d lib/python/xcat/* $RPM_BUILD_ROOT/%{prefix}/lib/python/xcat/
#cp -d postscripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
#chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts/*
cp -d si-post-install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install/*
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-SoftLayer
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-SoftLayer/*
cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/*
cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/*
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
#%doc LICENSE.html
%{prefix}
%post
# We are shipping the postscripts in a sysclone dir and then copying them to /install/postscripts here,
# because we want to allow base xcat to eventually ship them and not conflict on the file name/path