]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ofed/management/opensm/opensm.spec.in
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ofed / management / opensm / opensm.spec.in
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
24 Summary: InfiniBand subnet manager and administration
25 Name: opensm
26 Version: @VERSION@
27 Release: %rel%{?dist}
28 License: GPLv2 or BSD
29 Group: System Environment/Daemons
30 URL: http://openfabrics.org/
31 Source: http://www.openfabrics.org/downloads/management/@TARBALL@
32 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
33 BuildRequires: libibumad-devel, libtool
34 Requires: %{name}-libs = %{version}-%{release}, logrotate
35 Requires(post): /sbin/service, /sbin/chkconfig
36 Requires(preun): /sbin/chkconfig, /sbin/service
37
38 %description
39 OpenSM provides an implementation of an InfiniBand Subnet Manager and
40 Administration. Such a software entity is required to run for in order
41 to initialize the InfiniBand hardware (at least one per each
42 InfiniBand subnet).
43
44 %package libs
45 Summary: Libraries from the opensm package
46 Group: System Environment/Libraries
47 Requires(post): /sbin/ldconfig
48 Requires(postun): /sbin/ldconfig
49 Obsoletes: libopensm, libosmcomp, libosmvendor
50
51 %description libs
52 Shared libraries that are part of the opensm package but are also used by
53 other applications.  If you don't need opensm itself installed, these
54 libraries can be installed to satisfy dependencies of other applications.
55
56 %package devel
57 Summary: Development files for OpenSM
58 Group: System Environment/Libraries
59 Requires: %{name}-libs = %{version}-%{release} libibumad-devel
60 Obsoletes: libopensm-devel, libosmcomp-devel, libosmvendor-devel
61
62 %description devel
63 Header files for OpenSM.
64
65 %package static
66 Summary: Static version of the opensm libraries
67 Group: System Environment/Libraries
68 Requires: %{name}-libs = %{version}-%{release} libibumad-devel
69
70 %description static
71 Static 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}
84 make %{?_smp_mflags}
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88 make DESTDIR=$RPM_BUILD_ROOT install
89 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
90 etc=$RPM_BUILD_ROOT%{_sysconfdir}
91 mkdir -p ${RPM_BUILD_ROOT}/var/cache/opensm
92 if [ -f /etc/redhat-release -o -s /etc/redhat-release ]; then
93     REDHAT="redhat-"
94 else
95     REDHAT=""
96 fi
97 mkdir -p $etc/{init.d,logrotate.d} $etc/@OPENSM_CONFIG_SUB_DIR@
98 install -m 755 scripts/${REDHAT}opensm.init $etc/init.d/opensmd
99 install -D -m 644 scripts/opensm.logrotate $etc/logrotate.d/opensm
100 install -m 755 scripts/sldd.sh $RPM_BUILD_ROOT%{_sbindir}/sldd.sh
101
102 %clean
103 rm -rf $RPM_BUILD_ROOT
104
105 %post
106 if [ $1 = 1 ]; then
107     /sbin/chkconfig --add opensmd
108 else
109     /sbin/service opensmd condrestart
110 fi
111
112 %preun
113 if [ $1 = 0 ]; then
114     /sbin/service opensmd stop
115     /sbin/chkconfig --del opensmd
116     rm -f /var/cache/opensm/*
117 fi
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