File kgraft.spec of Package kgraft

#
# spec file for package kgraft
#
# Copyright (c) 2018 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:           kgraft
Version:        2.0
Release:        0
Summary:        Scripts for installing kGraft patches
License:        GPL-2.0
Group:          System/Kernel
Url:            https://www.suse.com/products/live-patching/
Source1:        kgraft-rpm-helper
Source2:        dracut-module-setup.sh
Source3:        dracut-kgraft-patch.sh
Source4:        kgraft-module-subpackage
Source5:        macros.kgraft
Source6:        kgr.sh
Source7:        kgr.man
Source8:        COPYING
Conflicts:      kernel < 4.12

%description
This package contains a helper script used when installing kGraft patch
packages.

%package devel
Summary:        Macros for building kGraft patches
# The OBS build does a testinstallation of all built packages, which needs
# the kgraft runtime package
Group:          Development/Tools/Building
Requires:       %{name} = %{version}
Requires:       kmod-compat

%description devel
This package contains RPM macro definitions for building kGraft patches.

%prep
%setup -q -Tc
cp %{_sourcedir}/{kgraft-rpm-helper,dracut-{module-setup,kgraft-patch}.sh} .
cp %{_sourcedir}/{kgraft-module-subpackage,macros.kgraft} .
cp %{_sourcedir}/kgr.{sh,man} .
cp %{_sourcedir}/COPYING .

%build

%install
install -D kgraft-rpm-helper %{buildroot}%{_libexecdir}/kgraft/kgraft-rpm-helper
install -D dracut-module-setup.sh \
	%{buildroot}%{_libexecdir}/dracut/modules.d/99kgraft/module-setup.sh
install -D dracut-kgraft-patch.sh \
	%{buildroot}%{_libexecdir}/dracut/modules.d/99kgraft/kgraft-patch.sh
install -D -m0644 kgraft-module-subpackage %{buildroot}%{_libexecdir}/rpm/kgraft-module-subpackage
install -D -m0644 macros.kgraft %{buildroot}%{_sysconfdir}/rpm/macros.kgraft
install -D -m0755 kgr.sh %{buildroot}%{_bindir}/kgr
sed -i 's/@@VERSION@@/%{version}-%{release}/' %{buildroot}%{_bindir}/kgr
install -d %{buildroot}%{_mandir}/man8
gzip -c9 kgr.man > %{buildroot}%{_mandir}/man8/kgr.8.gz
install -d %{buildroot}%{_docdir}

%files
%{_libexecdir}/kgraft
%dir %{_libexecdir}/dracut
%dir %{_libexecdir}/dracut/modules.d
%{_libexecdir}/dracut/modules.d/99kgraft
%{_bindir}/kgr
%{_mandir}/man8/kgr.8%{ext_man}
%doc COPYING

%files devel
%{_sysconfdir}/rpm/macros.kgraft
%{_libexecdir}/rpm/kgraft-module-subpackage

%changelog
openSUSE Build Service is sponsored by