88bb86
# One of the steps this package's insane build system does is patching version
88bb86
# strings in built binaries (MakeTools/patch_version/patch_version.c).
88bb86
# The expected template of a version string (ICS_BUILD_VERSION from
88bb86
# CodeVersion/code_version.c) is not found in binaries that contain a
88bb86
# GetCodeVersion() call. I suspect LTO optimizes it away.
88bb86
# Disabling LTO made the build work.
88bb86
%global _lto_cflags %{nil}
88bb86
5c3192
Name: opa-fm
5c3192
Epoch: 1
88bb86
Version: 10.11.2.0.3
650b9d
Release: 1%{?dist}
5c3192
Summary: Intel Omni-Path Fabric Management Software
5c3192
5c3192
License: GPLv2 or BSD
88bb86
Url: https://github.com/cornelisnetworks/opa-fm
88bb86
Source0: https://github.com/cornelisnetworks/opa-fm/archive/refs/tags/v%{version}.tar.gz
5c3192
5c3192
# bz1262327 needs Patch0002
5c3192
Patch0002: 0001-Fix-well-known-tempfile-issue-in-script.patch
5c3192
Patch0003: opafm-link-all-executables-with-pie.patch
ff9cb1
Patch0004: add-fPIC-flag.patch
5c3192
5c3192
BuildRequires: openssl-devel, expat-devel
5c3192
BuildRequires: libibverbs-devel >= 1.2.0
5c3192
BuildRequires: libibumad-devel
ff9cb1
BuildRequires: zlib-devel
ff9cb1
BuildRequires: gcc
ff9cb1
BuildRequires: gcc-c++
88bb86
BuildRequires: systemd-rpm-macros
5c3192
Requires: libhfi1
5c3192
ExclusiveArch: x86_64
5c3192
5c3192
%description
5c3192
opa-fm contains Intel Omni-Path fabric management applications. This
5c3192
includes: the Subnet Manager, Baseboard Manager, Performance Manager,
5c3192
Fabric Executive, and some fabric management tools.
5c3192
5c3192
%prep
5c3192
%setup -q
5c3192
%patch0002 -p1
5c3192
%patch0003 -p1
ff9cb1
%patch0004 -p1
5c3192
5c3192
# Make it possible to override hardcoded compiler flags
5c3192
sed -i -r -e 's/(release_C(C)?OPT_Flags\s*)=/\1?=/' Makerules/Target.LINUX.GNU.*
462cf6
sed -r -e 's/(^COPT\s*=\s*)/#\1/' -i Esm/ib/src/linux/opafmvf/Makefile
5c3192
5c3192
%build
462cf6
export CFLAGS='%{optflags} -std=gnu11'
462cf6
export CXXFLAGS='%{optflags} -std=gnu11'
462cf6
export release_COPT_Flags='%{optflags} -std=gnu11'
462cf6
export release_CCOPT_Flags='%{optflags} -std=gnu11'
5c3192
cd Esm
88bb86
OPA_FEATURE_SET=opa10 ./fmbuild $BUILD_ARGS
5c3192
5c3192
%install
5c3192
BUILDDIR=%{_builddir} DESTDIR=%{buildroot} LIBDIR=%{_libdir} RPM_INS=n ./Esm/fm_install.sh
5c3192
chmod 644 %{buildroot}/%{_unitdir}/opafm.service
5c3192
mkdir -p %{buildroot}/%{_localstatedir}/usr/lib/opa-fm/
5c3192
chmod a-x %{buildroot}/%{_prefix}/share/opa-fm/opafm_src.xml
5c3192
5c3192
%post
5c3192
%systemd_post opafm.service
5c3192
5c3192
%preun
5c3192
%systemd_preun opafm.service
5c3192
5c3192
%postun
5c3192
%systemd_postun_with_restart opafm.service
5c3192
5c3192
%files
5c3192
%doc Esm/README
5c3192
%{_unitdir}/opafm.service
5c3192
%config(noreplace) %{_sysconfdir}/opa-fm/opafm.xml
ff9cb1
%config(noreplace) %{_sysconfdir}/opa-fm/opafm_pp.xml
ff9cb1
%{_sysconfdir}/opa-fm
5c3192
%{_prefix}/lib/opa-fm/bin/*
5c3192
%{_prefix}/lib/opa-fm/runtime/*
5c3192
%{_prefix}/share/opa-fm/*
5c3192
%{_sbindir}/opafmcmd
5c3192
%{_sbindir}/opafmcmdall
ff9cb1
%{_sbindir}/opafmconfigpp
ff9cb1
%{_sbindir}/opafmvf
5c3192
%{_mandir}/man8/*
5c3192
5c3192
%changelog
88bb86
* Wed Feb 08 2023 Michal Schmidt <mschmidt@redhat.com> - 10.11.2.0.3-1
88bb86
- Update to upstream version 10.11.2.0.3
88bb86
- Resolves: rhbz#2110931
88bb86
27016e
* Tue May 25 2021 Honggang Li <honli@redhat.com> - 10.11.0.2.1-1
27016e
- Rebase to upstream release 10.11.0.2.1
27016e
- Resolves: bz1921701, bz1959990
27016e
680eca
* Thu Nov 12 2020 Honggang Li <honli@redhat.com> - 10.10.3.0.11-1
680eca
- Rebase to upstream release 10.10.3.0.11
680eca
- Resolves: bz1821735
680eca
650b9d
* Wed Apr 15 2020 Honggang Li <honli@redhat.com> - 10.10.1.0.35-1
650b9d
- Rebase to upstream release 10.10.1.0.35
650b9d
- Resolves:bz1739281
650b9d
462cf6
* Tue Dec 03 2019 Honggang Li <honli@redhat.com> - 10.10.0.0.444-2
462cf6
- Override hard-coded CFLAGS for opafmvf
462cf6
- Resolves bz1778557
462cf6
462cf6
* Thu Oct 31 2019 Honggang Li <honli@redhat.com> - 10.10.0.0.444-1
462cf6
- Rebase to upstream release 10.10.0.0.444
462cf6
- Resolves:bz1719674
462cf6
ff9cb1
* Tue Jun 11 2019 Honggang Li <honli@redhat.com> - 10.9.2.2.1-1
ff9cb1
- Rebase to upstream release 10.9.2.2.1
ff9cb1
- Resolves: bz1660617
ff9cb1
5c3192
* Wed Sep 26 2018 Honggang Li <honli@redhat.com> - 10.7.0.0.145-2
5c3192
- Link all executables with '-pie'
5c3192
- Resovles: bz1624155
5c3192
5c3192
* Wed Jun 13 2018 Honggang Li <honli@redhat.com> - 10.7.0.0.145-1
5c3192
- Rebase to latest upstream release
5c3192
- Resolves: bz1581530
5c3192
5c3192
* Tue Dec 12 2017 Honggang Li <honli@redhat.com> - 10.5.1.0.1-2
5c3192
- Don't include obsolete header bits/sigset.h
5c3192
- Resolves: bz1523732
5c3192
5c3192
* Thu Oct 19 2017 Honggang Li <honli@redhat.com> - 10.5.1.0.1-1
5c3192
- Rebase to upstream release 10.5.1.0.1
5c3192
- Resolves: bz1452787, bz1500903
5c3192
5c3192
* Fri Mar 17 2017 Honggang Li <honli@redhat.com> - 10.3.1.0-8
5c3192
- Rebase to upstream branch v10_3_1 as required.
5c3192
- Clean up change log.
5c3192
- Apply Epoch tag.
5c3192
- Resolves: bz1257452, bz1382792
5c3192
5c3192
* Sun Jul 10 2016 Honggang Li <honli@redhat.com> - 10.1.0.0-145
5c3192
- Rebase to latest upstream release.
5c3192
- Related: bz1273151
5c3192
5c3192
* Tue Jun 21 2016 Honggang Li <honli@redhat.com> - 10.0.1.0-4
5c3192
- Create private state dir.
5c3192
- Resolves: bz1348477
5c3192
5c3192
* Thu Jun  2 2016 Honggang Li <honli@redhat.com> - 10.0.1.0-3
5c3192
- Requires libhfi1.
5c3192
- Remove executable permission bit of opafm.service.
5c3192
- Resolves: bz1341971
5c3192
5c3192
* Thu May 26 2016 Honggang Li <honli@redhat.com> - 10.0.1.0-2
5c3192
- Rebase to upstream release 10.0.1.0.
5c3192
- Related: bz1273151
5c3192
5c3192
* Mon Sep 28 2015 Honggang Li <honli@redhat.com> - 10.0.0.0-444
5c3192
- Update the N-V-R
5c3192
- Related: bz1262327
5c3192
5c3192
* Mon Sep 28 2015 Honggang Li <honli@redhat.com> - 10.0.0.0-443
5c3192
- Apply one missed patch to fix various /tmp races
5c3192
- Revert the script for building (S)RPMs
5c3192
- Resolves: bz1262327
5c3192
5c3192
* Thu Sep 24 2015 Honggang Li <honli@redhat.com> - 10.0.0.0-442
5c3192
- Fix typo in changelog
5c3192
- Related: bz1262327
5c3192
5c3192
* Wed Sep 23 2015 Honggang Li <honli@redhat.com> - 10.0.0.0-441
5c3192
- Fix various /tmp races
5c3192
- Resolves: bz1262327
5c3192
5c3192
* Wed Aug 26 2015 Michal Schmidt <mschmidt@redhat.com> - 10.0.0.0-440
5c3192
- Respect optflags.
5c3192
- Avoid overflowing prog path due to /opt -> /usr/lib substitution.
5c3192
- Resolves: bz1257087
5c3192
- Resolves: bz1257093
5c3192
5c3192
* Mon Aug 24 2015 Michal Schmidt <mschmidt@redhat.com> - 10.0.0.0-439
5c3192
- Update to new upstream snapshot with unbundled expat.
5c3192
- Related: bz1173302
5c3192
5c3192
* Tue Aug 18 2015 Michal Schmidt <mschmidt@redhat.com> - 10.0.0.0-438
5c3192
- Initial packaging for RHEL, based on upstream spec file.
5c3192
- Cleaned up spec.
5c3192
- Moved /opt/opafm -> /usr/lib/opa-fm.
5c3192
- Fix scriptlets.
5c3192
5c3192
* Thu Oct 09 2014 Kaike Wan <kaike.wan@intel.com> - 10.0.0.0-177
5c3192
- Initial version