fdfb48
%define _hardened_build 1
fdfb48
%global __remake_config 1
fdfb48
fdfb48
Name: opensm
fdfb48
Version: 3.3.21
fdfb48
Release: 2%{?dist}
fdfb48
Summary: OpenIB InfiniBand Subnet Manager and management utilities
fdfb48
License: GPLv2 or BSD
fdfb48
Url: https://github.com/linux-rdma/opensm
fdfb48
Source0: https://github.com/linux-rdma/opensm/releases/download/%{version}/%{name}-%{version}.tar.gz
fdfb48
Source2: opensm.logrotate
fdfb48
Source4: opensm.sysconfig
fdfb48
Source5: opensm.service
fdfb48
Source6: opensm.launch
fdfb48
Source7: opensm.rwtab
fdfb48
Patch0: opensm-3.3.13-prefix.patch
fdfb48
Patch1: 0001-Use-precision-specifier-for-scanf.patch
fdfb48
Patch2: 0002-osm_helper.c-Fix-lsea_str_fixed_width-OVERRUN-issue.patch
fdfb48
Patch3: 0003-osm_helper.c-Make-50-string-proper-fixed-width-in-ls.patch
fdfb48
Patch4: 0004-main.c-Remove-NO_EFFECT-code.patch
fdfb48
Patch5: 0005-osm_-link_mgr-trap_rcv-.c-Check-the-return-value-of-.patch
fdfb48
BuildRequires: libibumad-devel, libtool, bison, flex, byacc, systemd, gcc
fdfb48
%if %{__remake_config}
fdfb48
BuildRequires: libtool, autoconf, automake
fdfb48
%endif
fdfb48
Requires: %{name}-libs%{?_isa} = %{version}-%{release}, logrotate, rdma
fdfb48
Requires(post): systemd
fdfb48
Requires(preun): systemd
fdfb48
Requires(postun): systemd
fdfb48
fdfb48
%description
fdfb48
OpenSM is the OpenIB project's Subnet Manager for Infiniband networks.
fdfb48
The subnet manager is run as a system daemon on one of the machines in
fdfb48
the infiniband fabric to manage the fabric's routing state.  This package
fdfb48
also contains various tools for diagnosing and testing Infiniband networks
fdfb48
that can be used from any machine and do not need to be run on a machine
fdfb48
running the opensm daemon.
fdfb48
fdfb48
%package libs
fdfb48
Summary: Libraries used by opensm and included utilities
fdfb48
fdfb48
%description libs
fdfb48
Shared libraries for Infiniband user space access
fdfb48
fdfb48
%package devel
fdfb48
Summary: Development files for the opensm-libs libraries
fdfb48
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
fdfb48
fdfb48
%description devel
fdfb48
Development environment for the opensm libraries
fdfb48
fdfb48
%package static
fdfb48
Summary: Static version of the opensm libraries
fdfb48
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
fdfb48
%description static
fdfb48
Static version of opensm libraries
fdfb48
fdfb48
%prep
fdfb48
%setup -q
fdfb48
%patch0 -p1
fdfb48
%patch1 -p1
fdfb48
%patch2 -p1
fdfb48
%patch3 -p1
fdfb48
%patch4 -p1
fdfb48
%patch5 -p1
fdfb48
fdfb48
%build
fdfb48
%if %{__remake_config}
fdfb48
./autogen.sh
fdfb48
%endif
fdfb48
%configure --with-opensm-conf-sub-dir=rdma CFLAGS="$CFLAGS -fno-strict-aliasing"
fdfb48
make %{?_smp_mflags}
fdfb48
cd opensm
fdfb48
./opensm -c ../opensm-%{version}.conf
fdfb48
fdfb48
%install
fdfb48
make install DESTDIR=%{buildroot}
fdfb48
# remove unpackaged files from the buildroot
fdfb48
rm -f %{buildroot}%{_libdir}/*.la
fdfb48
rm -fr %{buildroot}%{_sysconfdir}/init.d
fdfb48
install -D -m644 opensm-%{version}.conf %{buildroot}%{_sysconfdir}/rdma/opensm.conf
fdfb48
install -D -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/opensm
fdfb48
install -D -m644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/opensm
fdfb48
install -D -m644 %{SOURCE5} %{buildroot}%{_unitdir}/opensm.service
fdfb48
install -D -m755 %{SOURCE6} %{buildroot}%{_libexecdir}/opensm-launch
fdfb48
install -D -m644 %{SOURCE7} %{buildroot}%{_sysconfdir}/rwtab.d/opensm
fdfb48
mkdir -p ${RPM_BUILD_ROOT}/var/cache/opensm
fdfb48
install -m 755 scripts/sldd.sh %{buildroot}%{_sbindir}/sldd.sh
fdfb48
fdfb48
%post
fdfb48
%systemd_post opensm.service
fdfb48
fdfb48
%preun
fdfb48
%systemd_preun opensm.service
fdfb48
fdfb48
%postun
fdfb48
if [ -d /var/cache/opensm ]; then
fdfb48
	rm -fr /var/cache/opensm
fdfb48
fi
fdfb48
%systemd_postun_with_restart opensm.service
fdfb48
fdfb48
%post libs -p /sbin/ldconfig
fdfb48
fdfb48
%postun libs -p /sbin/ldconfig
fdfb48
fdfb48
%files
fdfb48
%dir /var/cache/opensm
fdfb48
%{_sbindir}/*
fdfb48
%{_mandir}/*
fdfb48
%{_unitdir}/*
fdfb48
%{_libexecdir}/*
fdfb48
%config(noreplace) %{_sysconfdir}/logrotate.d/opensm
fdfb48
%config(noreplace) %{_sysconfdir}/rdma/opensm.conf
fdfb48
%config(noreplace) %{_sysconfdir}/sysconfig/opensm
fdfb48
%{_sysconfdir}/rwtab.d/opensm
fdfb48
%doc AUTHORS ChangeLog INSTALL README NEWS doc/performance-manager-HOWTO.txt doc/QoS_management_in_OpenSM.txt doc/partition-config.txt doc/opensm-sriov.txt doc/current-routing.txt doc/opensm_release_notes-3.3.txt
fdfb48
%license COPYING
fdfb48
fdfb48
%files libs
fdfb48
%{_libdir}/lib*.so.*
fdfb48
fdfb48
%files devel
fdfb48
%{_libdir}/lib*.so
fdfb48
%{_includedir}/infiniband
fdfb48
fdfb48
%files static
fdfb48
%{_libdir}/lib*.a
fdfb48
fdfb48
%changelog
fdfb48
* Wed Feb 13 2019 Honggang Li <honli@redhat.com> - 3.3.21-2
fdfb48
- Fix a few defects
fdfb48
- Resolves: bz1668201
fdfb48
fdfb48
* Mon Jan 21 2019 Honggang Li <honli@redhat.com> - 3.3.21-1
fdfb48
- Rebase to latest upstream release 3.3.21
fdfb48
- Resolves: bz1535978, bz1653660
fdfb48
fdfb48
* Tue Jun 19 2018 Honggang Li <honli@redhat.com> - 3.3.20-3
fdfb48
- Fix BuildRequires
fdfb48
- Resolves: bz1567528
fdfb48
fdfb48
* Wed Nov  1 2017 Honggang Li <honli@redhat.com> - 3.3.20-2
fdfb48
- Fix up preuninstall script
fdfb48
- Resolves: bz1508334
fdfb48
fdfb48
* Mon Oct 16 2017 Honggang Li <honli@redhat.com> - 3.3.20-1
fdfb48
- Cleanup the spec file
fdfb48
- Rebase to latest upstream release 3.3.20
fdfb48
- Resolves: bz1456524
fdfb48
fdfb48
* Fri Jun 05 2015 Doug Ledford <dledford@redhat.com> - 3.3.19-1
fdfb48
- Update to latest upstream release
fdfb48
- Build on s390
fdfb48
- Related: bz1186159
fdfb48
fdfb48
* Fri Oct 17 2014 Doug Ledford <dledford@redhat.com> - 3.3.18-2
fdfb48
- Fix an issue found by rpmdiff
fdfb48
- Related: bz1061587
fdfb48
fdfb48
* Thu Oct 09 2014 Doug Ledford <dledford@redhat.com> - 3.3.18-1
fdfb48
- Update to latest upstream release
fdfb48
- Resolves: bz1061587, bz1042745, bz884555, bz948475
fdfb48
fdfb48
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.3.15-7
fdfb48
- Mass rebuild 2013-12-27
fdfb48
fdfb48
* Mon Mar 25 2013 Doug Ledford <dledford@redhat.com> - 3.3.15-6
fdfb48
- Oops, forgot to remove the -B option to opensm when starting it
fdfb48
fdfb48
* Mon Mar 25 2013 Doug Ledford <dledford@redhat.com> - 3.3.15-5
fdfb48
- Drop the old sysv init script
fdfb48
- Fix opensm-launch to restart opensm in a loop.  This works around the
fdfb48
  fact that systemd starts opensm so early that we very well might not have
fdfb48
  sync on the link yet.  Without the physical link being up, opensm exits
fdfb48
  immediately.  This way opensm will get restarted every 30 seconds until
fdfb48
  sync is active on the link or until the opensm service is stopped.
fdfb48
- Always install the newly generated opensm-%%{version}.conf as opensm.conf
fdfb48
- Make the launch work properly in the event that no GUIDs are set and
fdfb48
  there are no numbered config files
fdfb48
fdfb48
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.15-4
fdfb48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
fdfb48
fdfb48
* Wed Dec 05 2012 Doug Ledford <dledford@redhat.com> - 3.3.15-3
fdfb48
- Fix startup on read only root
fdfb48
- Update default config file
fdfb48
- Resolves: bz817591
fdfb48
fdfb48
* Wed Dec 05 2012 Doug Ledford <dledford@redhat.com> - 3.3.15-2
fdfb48
- More tweaks to systemd setup (proper scriptlets now)
fdfb48
- More tweaks to old sysv init script support (fix Requires)
fdfb48
fdfb48
* Tue Nov 27 2012 Doug Ledford <dledford@redhat.com> - 3.3.15-1
fdfb48
- Update to latest upstream release
fdfb48
- Update to systemd startup
fdfb48
fdfb48
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.13-3
fdfb48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
fdfb48
fdfb48
* Tue Mar 13 2012 Doug Ledford <dledford@redhat.com> - 3.3.13-2
fdfb48
- Fix the config file comment in the opensm init script
fdfb48
- Resolves: bz802727
fdfb48
fdfb48
* Tue Feb 28 2012 Doug Ledford <dledford@redhat.com> - 3.3.13-1
fdfb48
- Update to latest upstream version
fdfb48
- Fix a minor issue in init scripts that would cause systemd to try and
fdfb48
  start/stop things in the wrong order
fdfb48
- Add a patch to allow us to specify the subnet prefix on the command line
fdfb48
fdfb48
* Tue Jan 03 2012 Doug Ledford <dledford@redhat.com> - 3.3.12-1
fdfb48
- Update to latest upstream version
fdfb48
fdfb48
* Mon Aug 15 2011 Kalev Lember <kalevlember@gmail.com> - 3.3.9-2
fdfb48
- Rebuilt for rpm bug #728707
fdfb48
fdfb48
* Wed Jul 20 2011 Doug Ledford <dledford@redhat.com> - 3.3.9-1
fdfb48
- Update to latest upstream version
fdfb48
- Add /etc/sysconfig/opensm for use by opensm init script
fdfb48
- Enable the ability to start more than one instance of opensm for multiple
fdfb48
  fabric support
fdfb48
- Enable the ability to start opensm with a priority other than default for
fdfb48
  support of backup opensm instances
fdfb48
fdfb48
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.5-2
fdfb48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
fdfb48
fdfb48
* Mon Mar 08 2010 Doug Ledford <dledford@redhat.com> - 3.3.5-1
fdfb48
- Update to latest upstream release.  We need various defines in ib_types.h
fdfb48
  for the latest ibutils package to build properly, and the latest ibutils
fdfb48
  package is needed because we found licensing problems in the older
fdfb48
  tarballs during review.
fdfb48
fdfb48
* Mon Jan 11 2010 Doug Ledford <dledford@redhat.com> - 3.3.3-2
fdfb48
- ExcludeArch s390(x) as there's no hardware support there
fdfb48
fdfb48
* Thu Dec 03 2009 Doug Ledford <dledford@redhat.com> - 3.3.3-1
fdfb48
- Update to latest upstream release
fdfb48
- Minor tweaks to init script for LSB compliance
fdfb48
fdfb48
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.2-2
fdfb48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
fdfb48
fdfb48
* Mon Jul 20 2009 Doug Ledford <dledford@redhat.com> - 3.3.2-1
fdfb48
- Update to latest upstream version
fdfb48
fdfb48
* Wed Apr 22 2009 Doug Ledford <dledford@redhat.com> - 3.3.1-1
fdfb48
- Update to latest upstream version
fdfb48
fdfb48
* Fri Mar 06 2009 Caolán McNamara <caolanm@redhat.com> - 3.2.1-3
fdfb48
- fix bare elifs to rebuild
fdfb48
fdfb48
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2.1-2
fdfb48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
fdfb48
fdfb48
* Sun Jun 08 2008 Doug Ledford <dledford@redhat.com> - 3.2.1-1
fdfb48
- Initial package for Fedora review process