File kgraft.spec of Package kgraft
#
# spec file for package kgraft
#
# Copyright (c) 2014 SUSE LINUX Products 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: 1.0
Release: 0
Summary: Scripts for installing kGraft patches
License: GPL-2.0
Group: System/Kernel
Url: https://www.suse.com/promo/kgraft.html
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
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package contains a helper script used when installing kGraft patch
packages.
%package devel
Summary: Macros for building kGraft patches
Group: Development/Tools/Building
Requires: kmod-compat
# The OBS build does a testinstallation of all built packages, which needs
# the kgraft runtime package
Requires: %{name}
%description devel
This package contains RPM macro definitions for building kGraft patches.
%prep
%setup -Tc
cp %{_sourcedir}/{kgraft-rpm-helper,dracut-{module-setup,kgraft-patch}.sh} .
cp %{_sourcedir}/{kgraft-module-subpackage,macros.kgraft} .
cp %{_sourcedir}/kgr.{sh,man} .
%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
%files
%defattr(-,root,root)
%{_libexecdir}/kgraft
%dir %{_libexecdir}/dracut
%dir %{_libexecdir}/dracut/modules.d
%{_libexecdir}/dracut/modules.d/99kgraft
%{_bindir}/kgr
%{_mandir}/man8/kgr.8.gz
%files devel
%defattr(-,root,root)
%{_sysconfdir}/rpm/macros.kgraft
%{_libexecdir}/rpm/kgraft-module-subpackage
%changelog