File ipmctl.spec of Package ipmctl.15040

# spec file for package ipmctl
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define abi     3
#define vgit    .1547861714.b7a59da
%define vgit    %{nil}
%define vSafeC  3.3.v03032018+git7.59eba324
%bcond_with     precompiledSafeC

Name:           ipmctl
Release:        0
Summary:        Utility for managing Intel Optane DC persistent memory modules
License:        BSD-3-Clause
Group:          System/Management
%if "%{vgit}" == ""
Source:         %{name}-%{version}%{vgit}.tar.gz
Source1:        ChangeLog.xz
Source2:        %{name}-rpmlintrc
Source10:       safeclib-%{vSafeC}.tar.xz
Source11:       mkSafeC
Source12:       safeclib-patches.tar
Patch1:         ipmctl-python3.patch

Recommends:     logrotate
%if %{defined pythons}
BuildRequires:  %{pythons}
BuildRequires:  python
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  systemd
BuildRequires:  systemd-rpm-macros
BuildRequires:  pkgconfig(libndctl) >= 58.2
# required for documentation
BuildRequires:  rubygem(asciidoctor)
# for SafeC
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc
BuildRequires:  libtool

# no 'Conflicts' for 'zypper patch'
Obsoletes:      lib%{name}2
# for impctl
Obsoletes:      ixpdimm-cli <
# for (obsoleted) libipmctl2
Obsoletes:      ipmctl-data < %{version}
Obsoletes:      ixpdimm-data <
Obsoletes:      ixpdimm_sw <
Obsoletes:      libixpdimm <
Obsoletes:      libixpdimm-cim <
Obsoletes:      libixpdimm-cli <
Obsoletes:      libixpdimm-common <
Obsoletes:      libixpdimm-core <

ExclusiveArch:  x86_64

Utility for managing Intel Optane DC persistent memory modules
Supports functionality to:
* Discover PMMs on the platform.
* Provision the platform memory configuration.
* View and update the firmware on PMMs.
* Configure data-at-rest security on PMMs.
* Monitor PMM health.
* Track performance of PMMs.
* Debug and troubleshoot PMMs.

%package monitor
Summary:        Daemon for monitoring the status of Intel PMM
Group:          System/Monitoring
Obsoletes:      ixpdimm-monitor <

%description monitor
A monitor daemon for monitoring the health and status of Intel Optane DC persistent memory modules

%package devel
Summary:        Development packages for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Obsoletes:      ixpdimm-devel <
Obsoletes:      ixpdimm_sw-devel <

%description devel
API for development of Intel Optane DC persistent memory management utilities.

%setup -q -n %{name}-%{version}%{vgit} -a 10
%patch1 -p1

! grep -lri 'INTEL CONFIDENTIAL' || exit 1

%if %{with precompiledSafeC}
  tar xfJ ../../SOURCES/safeclib-prebuild.tar.xz || sleep 5

/bin/bash -ex "%{SOURCE11}" "%{SOURCE12}" "%{?_smp_mflags}"
export PKG_CONFIG_PATH=$PWD/contrib/lib/pkgconfig
    -DLINUX_PRODUCT_NAME=%{name} \
    -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
    -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
    -DCMAKE_INSTALL_BINDIR=%{_bindir} \
    -DCMAKE_INSTALL_MANDIR=%{_mandir} \
    -DCMAKE_INSTALL_LOCALSTATEDIR=%{_localstatedir} \
    -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \
    -DINSTALL_UNITDIR=%{_unitdir} \

mkdir -p %{buildroot}%{_sbindir}
ln -sf service %{buildroot}%{_sbindir}/rc%{name}-monitor
rm -f %{buildroot}%{_datadir}/doc/ipmctl/ipmctl_default.conf
rm -f %{buildroot}%{_libdir}/*.so.%{abi}
install -m 444 -p "%{SOURCE1}" .

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%pre monitor
%service_add_pre ipmctl-monitor.service

%post monitor
%service_add_post ipmctl-monitor.service

%preun monitor
%service_del_preun ipmctl-monitor.service

%postun monitor
%service_del_postun ipmctl-monitor.service

%license LICENSE contrib/COPYING.*
%doc ChangeLog.xz

#files data
%doc output/release/%{name}_default.conf
%config %{_sysconfdir}/%{name}.conf
%config %{_sysconfdir}/logrotate.d/%{name}
%dir %{_localstatedir}/log/%{name}
#files -n lib%%{name}%%{abi}

%files monitor
%license LICENSE

%files devel

openSUSE Build Service is sponsored by