File skiboot.spec of Package skiboot

#
# spec file for package skiboot
#
# Copyright (c) 2015 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 http://bugs.opensuse.org/
#


Name:           skiboot
Version:        5.1.8
Release:        0
Summary:        Tools for OpenPower platform
License:        Apache-2.0
Group:          System/Management
Url:            https://github.com/open-power/skiboot
Source:         https://github.com/open-power/skiboot/archive/%{name}-%{version}.tar.gz
Source1:        opal-prd.service
Source2:        opal-prd.socket
BuildRequires:  linux-glibc-devel
BuildRequires:  systemd-rpm-macros
%{?systemd_requires}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  ppc64 ppc64le

%description
OPAL firmware (OpenPower Abstraction Layer)

%package -n opal-prd
Summary:        OPAL Processor Recovery Diagnostics daemon 
Group:          System/Management

%description -n opal-prd
 This package provides a daemon to load and run the OpenPower firmware's
 Processor Recovery Diagnostics binary. This is responsible for runtime
 maintenance of Power hardware.

%package -n opal-utils
Summary:        OPAL firmware utilities 
Group:          System/Management

%description -n opal-utils
 This package contains utility programs.
 .
 The 'gard' utility, can read, parse and clear hardware gard partitions on
 OpenPower platforms.

%prep
%setup -q -n %{name}-%{name}-%{version}

%build
export OPAL_PRD_VERSION=%{version}
make %{?_smp_mflags} -C external/opal-prd/ 
make %{?_smp_mflags} -C external/gard/ 

%install
make install DESTDIR=%{buildroot} %{?_smp_mflags} -C external/opal-prd/ prefix=/usr install
make install DESTDIR=%{buildroot} %{?_smp_mflags} -C external/gard/ prefix=/usr install

mkdir -p %{buildroot}/%{_unitdir}
%__install -D -m 444 %{S:1} %{S:2} %{buildroot}%{_unitdir}/

%pre -n opal-prd
%service_add_pre opal-prd.service opal-prd.socket

%post -n opal-prd
%service_add_post opal-prd.service opal-prd.socket

%preun -n opal-prd
%service_del_preun opal-prd.service opal-prd.socket

%postun -n opal-prd
%service_del_postun opal-prd.service opal-prd.socket

%files -n opal-prd
%defattr(-,root,root)
%doc README
%{_sbindir}/opal-prd
%{_datadir}/man/man8/opal-prd.8.gz
%{_unitdir}/opal-prd.service
%{_unitdir}/opal-prd.socket

%files -n opal-utils
%defattr(-,root,root)
%doc README
%{_sbindir}/opal-gard
%{_datadir}/man/man1/opal-gard.1.gz

%changelog
openSUSE Build Service is sponsored by