File bcache-tools.spec of Package bcache-tools.14286

# spec file for package bcache-tools
# 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

Name:           bcache-tools
Summary:        Configuration utilities for bcache
License:        GPL-2.0
Group:          System/Base
Version:        1.0.9
Release:        0

Source:         %name-%version.tar.xz
Patch1:		0001-bcache-tools-Allow-user-to-set-label-for-device.patch
Patch2:		0002-bcache-tools-Add-label-field.patch
Patch3:		0003-bcache-tools-Add-parameter-check.patch
Patch4:		0004-bcache-tools-Bcache-command-should-follow-symlinks.patch
Patch5:		0005-bcache-tools-Add-blkdiscard-for-cache-dev.patch
Patch6:		0006-make-bcache-remove-reduncant-code.patch
Patch7:		0007-bcache-tools-rename-2-file-names.patch
Patch8:		0008-crc64-use-crc64-routines-defined-in-Linux-kernel.patch
Patch9:		0009-bitwise.h-swap-bitwise-for-different-CPU-endians.patch
Patch10:	0010-make.c-add-swap_sb-to-supprt-big-endian-machine.patch
Patch1001:	1001-udev-do-not-rely-on-DRIVER-variable.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  libblkid-devel
BuildRequires:  libuuid-devel
BuildRequires:  libsmartcols-devel
BuildRequires:  pkg-config
BuildRequires:  xz
This package contains utilities for configuring the bcache Module.

%setup -qn %name
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch1001 -p1

make all CFLAGS="%optflags $(pkg-config blkid uuid smartcols --cflags) -std=gnu99" \
	LDFLAGS="$(pkg-config blkid uuid smartcols --libs)" %{?_smp_mflags}

# Without these existing, make install would fail
mkdir -p "$b"/{sbin,%_sbindir,%_mandir/man8,/lib/udev/rules.d}
mkdir -p "$b/%_sysconfdir/initramfs-tools/scripts/init-premount"
mkdir -p "$b/%_sysconfdir/initramfs-tools/hooks"
make install DESTDIR="$b" DRACUTLIBDIR="%_libexecdir/dracut"
# Not used in openSUSE
rm -Rf "$b/%_sysconfdir/initramfs-tools" "$b/%_prefix/lib/initcpio" \
mkdir -p "$b/%_prefix/lib"
mv "$b/lib/udev" "$b/%_prefix/lib/"


openSUSE Build Service is sponsored by