-
Notifications
You must be signed in to change notification settings - Fork 2
/
opensm.spec.in
150 lines (127 loc) · 4.27 KB
/
opensm.spec.in
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
%define RELEASE @RELEASE@
%define rel %{?CUSTOM_RELEASE}%{!?CUSTOM_RELEASE:%RELEASE}
%if %{?_with_console_socket:1}%{!?_with_console_socket:0}
%define _enable_console_socket --enable-console-socket
%endif
%if %{?_without_console_socket:1}%{!?_without_console_socket:0}
%define _disable_console_socket --disable-console-socket
%endif
%if %{?_with_perf_mgr:1}%{!?_with_perf_mgr:0}
%define _enable_perf_mgr --enable-perf-mgr
%endif
%if %{?_without_perf_mgr:1}%{!?_without_perf_mgr:0}
%define _disable_perf_mgr --disable-perf-mgr
%endif
# For CHAOS we always want this option.
#%if %{?_with_event_plugin:1}%{!?_with_event_plugin:0}
%define _enable_event_plugin --enable-default-event-plugin
#%endif
#%if %{?_without_event_plugin:1}%{!?_without_event_plugin:0}
#%define _disable_event_plugin --disable-default-event-plugin
#%endif
%if %{?_with_node_name_map:1}%{!?_with_node_name_map:0}
%define _enable_node_name_map --with-node-name-map%{?_with_node_name_map}
%endif
Summary: InfiniBand subnet manager and administration
Name: opensm
Version: @VERSION@
Release: %rel%{?dist}
License: GPLv2 or BSD
Group: System Environment/Daemons
URL: http:https://openfabrics.org/
Source: http:https://www.openfabrics.org/downloads/management/@TARBALL@
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: tcp_wrappers, tcp_wrappers-devel, bison, flex, libibumad-devel, libtool
Requires: %{name}-libs = %{version}-%{release}, logrotate
Requires(post): /sbin/service, /sbin/chkconfig
Requires(preun): /sbin/chkconfig, /sbin/service
%description
OpenSM provides an implementation of an InfiniBand Subnet Manager and
Administration. Such a software entity is required to run for in order
to initialize the InfiniBand hardware (at least one per each
InfiniBand subnet).
%package libs
Summary: Libraries from the opensm package
Group: System Environment/Libraries
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Obsoletes: libopensm, libosmcomp, libosmvendor
%description libs
Shared libraries that are part of the opensm package but are also used by
other applications. If you don't need opensm itself installed, these
libraries can be installed to satisfy dependencies of other applications.
%package devel
Summary: Development files for OpenSM
Group: System Environment/Libraries
Requires: %{name}-libs = %{version}-%{release} libibumad-devel
Obsoletes: libopensm-devel, libosmcomp-devel, libosmvendor-devel
%description devel
Header files for OpenSM.
%package static
Summary: Static version of the opensm libraries
Group: System Environment/Libraries
Requires: %{name}-libs = %{version}-%{release} libibumad-devel
%description static
Static version of the opensm libraries
%prep
%setup -q
%build
%configure \
%{?_enable_console_socket} \
%{?_enable_perf_mgr} \
%{?_enable_event_plugin} \
%{?_enable_node_name_map}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
etc=$RPM_BUILD_ROOT%{_sysconfdir}
mkdir -p ${RPM_BUILD_ROOT}/var/cache/opensm
if [ -f /etc/redhat-release -o -s /etc/redhat-release ]; then
REDHAT="redhat-"
else
REDHAT=""
fi
mkdir -p $etc/{init.d,logrotate.d} $etc/@OPENSM_CONFIG_SUB_DIR@
install -m 755 scripts/${REDHAT}opensm.init $etc/init.d/opensmd
install -D -m 644 scripts/opensm.logrotate $etc/logrotate.d/opensm
install -m 755 scripts/sldd.sh $RPM_BUILD_ROOT%{_sbindir}/sldd.sh
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ $1 = 1 ]; then
/sbin/chkconfig --add opensmd
else
/sbin/service opensmd condrestart
fi
%preun
if [ $1 = 0 ]; then
/sbin/service opensmd stop
/sbin/chkconfig --del opensmd
rm -f /var/cache/opensm/*
fi
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_sbindir}/opensm
%{_sbindir}/osmtest
%{_mandir}/man8/*
%{_mandir}/man5/*
%doc AUTHORS COPYING README doc/performance-manager-HOWTO.txt doc/QoS_management_in_OpenSM.txt doc/opensm_release_notes-3.3.txt
%{_sysconfdir}/init.d/opensmd
%{_sbindir}/sldd.sh
%config(noreplace) %{_sysconfdir}/logrotate.d/opensm
%dir /var/cache/opensm
%dir %{_sysconfdir}/@OPENSM_CONFIG_SUB_DIR@
%files libs
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/infiniband/*
%{_libdir}/*.so
%files static
%defattr(-,root,root,-)
%{_libdir}/*.a