xref: /trueos/contrib/ofed/management/opensm/opensm.spec.in (revision 8fe640108653f13042f1b15213769e338aa524f6)
1%define RELEASE @RELEASE@
2%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
3%if %{?_with_console_socket:1}%{!?_with_console_socket:0}
4%define _enable_console_socket --enable-console-socket
5%endif
6%if %{?_without_console_socket:1}%{!?_without_console_socket:0}
7%define _disable_console_socket --disable-console-socket
8%endif
9
10%if %{?_with_perf_mgr:1}%{!?_with_perf_mgr:0}
11%define _enable_perf_mgr --enable-perf-mgr
12%endif
13%if %{?_without_perf_mgr:1}%{!?_without_perf_mgr:0}
14%define _disable_perf_mgr --disable-perf-mgr
15%endif
16
17%if %{?_with_event_plugin:1}%{!?_with_event_plugin:0}
18%define _enable_event_plugin --enable-event-plugin
19%endif
20%if %{?_without_event_plugin:1}%{!?_without_event_plugin:0}
21%define _disable_event_plugin --disable-event-plugin
22%endif
23
24Summary: InfiniBand subnet manager and administration
25Name: opensm
26Version: @VERSION@
27Release: %rel%{?dist}
28License: GPLv2 or BSD
29Group: System Environment/Daemons
30URL: http://openfabrics.org/
31Source: http://www.openfabrics.org/downloads/management/@TARBALL@
32BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
33BuildRequires: libibumad-devel, libtool
34Requires: %{name}-libs = %{version}-%{release}, logrotate
35Requires(post): /sbin/service, /sbin/chkconfig
36Requires(preun): /sbin/chkconfig, /sbin/service
37
38%description
39OpenSM provides an implementation of an InfiniBand Subnet Manager and
40Administration. Such a software entity is required to run for in order
41to initialize the InfiniBand hardware (at least one per each
42InfiniBand subnet).
43
44%package libs
45Summary: Libraries from the opensm package
46Group: System Environment/Libraries
47Requires(post): /sbin/ldconfig
48Requires(postun): /sbin/ldconfig
49Obsoletes: libopensm, libosmcomp, libosmvendor
50
51%description libs
52Shared libraries that are part of the opensm package but are also used by
53other applications.  If you don't need opensm itself installed, these
54libraries can be installed to satisfy dependencies of other applications.
55
56%package devel
57Summary: Development files for OpenSM
58Group: System Environment/Libraries
59Requires: %{name}-libs = %{version}-%{release} libibumad-devel
60Obsoletes: libopensm-devel, libosmcomp-devel, libosmvendor-devel
61
62%description devel
63Header files for OpenSM.
64
65%package static
66Summary: Static version of the opensm libraries
67Group: System Environment/Libraries
68Requires: %{name}-libs = %{version}-%{release} libibumad-devel
69
70%description static
71Static version of the opensm libraries
72
73%prep
74%setup -q
75
76%build
77%configure \
78        %{?_enable_console_socket} \
79        %{?_disable_console_socket} \
80        %{?_enable_perf_mgr} \
81        %{?_disable_perf_mgr} \
82        %{?_enable_event_plugin} \
83        %{?_disable_event_plugin}
84make %{?_smp_mflags}
85
86%install
87rm -rf $RPM_BUILD_ROOT
88make DESTDIR=$RPM_BUILD_ROOT install
89rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
90etc=$RPM_BUILD_ROOT%{_sysconfdir}
91mkdir -p ${RPM_BUILD_ROOT}/var/cache/opensm
92if [ -f /etc/redhat-release -o -s /etc/redhat-release ]; then
93    REDHAT="redhat-"
94else
95    REDHAT=""
96fi
97mkdir -p $etc/{init.d,logrotate.d} $etc/@OPENSM_CONFIG_SUB_DIR@
98install -m 755 scripts/${REDHAT}opensm.init $etc/init.d/opensmd
99install -D -m 644 scripts/opensm.logrotate $etc/logrotate.d/opensm
100install -m 755 scripts/sldd.sh $RPM_BUILD_ROOT%{_sbindir}/sldd.sh
101
102%clean
103rm -rf $RPM_BUILD_ROOT
104
105%post
106if [ $1 = 1 ]; then
107    /sbin/chkconfig --add opensmd
108else
109    /sbin/service opensmd condrestart
110fi
111
112%preun
113if [ $1 = 0 ]; then
114    /sbin/service opensmd stop
115    /sbin/chkconfig --del opensmd
116    rm -f /var/cache/opensm/*
117fi
118
119%post libs -p /sbin/ldconfig
120%postun libs -p /sbin/ldconfig
121
122%files
123%defattr(-,root,root,-)
124%{_sbindir}/opensm
125%{_sbindir}/osmtest
126%{_mandir}/man8/*
127%doc AUTHORS COPYING README doc/performance-manager-HOWTO.txt doc/QoS_management_in_OpenSM.txt doc/opensm_release_notes-3.2.txt
128%{_sysconfdir}/init.d/opensmd
129%{_sbindir}/sldd.sh
130%config(noreplace) %{_sysconfdir}/logrotate.d/opensm
131%dir /var/cache/opensm
132%dir %{_sysconfdir}/@OPENSM_CONFIG_SUB_DIR@
133
134%files libs
135%defattr(-,root,root,-)
136%{_libdir}/*.so.*
137
138%files devel
139%defattr(-,root,root,-)
140%{_includedir}/infiniband/*
141%{_libdir}/*.so
142
143%files static
144%defattr(-,root,root,-)
145%{_libdir}/*.a
146
147