drbd/drbd.spec

117 lines
3.4 KiB
RPMSpec

#
# spec file for package drbd
#
# 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/
#
# needssslcertforbuild
%ifarch x86_64
%define buildrt 0
%endif
Name: drbd
Version: 8.4.6
Release: 0
Summary: Distributed Replicated Block Device
License: GPL-2.0+
Group: Productivity/Clustering/HA
Url: http://www.drbd.org/
Source: http://oss.linbit.com/drbd/8.4/%{name}-%{version}.tar.gz
Source1: preamble
#In kernel is: kernel/drivers/block/drbd/drbd.ko
Source2: Module.supported
Patch1: update-to-8.4.6-5.patch
#Patch for supporting drbd KMP after kernel4.3
#This patch can be removed when using in-tree 4.3
Patch2: new-bio-struct.patch
#Patch for fate: https://fate.suse.com/317940
#Whether can merge into linbit is under discussion
Patch3: 0001-Support-zeroout-device-in-initial-sync.patch
BuildRequires: kernel-source
BuildRequires: kernel-syms
BuildRequires: module-init-tools
%if 0%{?buildrt} == 1
BuildRequires: kernel-source-rt
BuildRequires: kernel-syms-rt
%endif
Requires: drbd-utils >= 8.9.0
Supplements: drbd-utils >= 8.9.0
Obsoletes: drbd-kmp < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExcludeArch: i586 s390
%kernel_module_package -n drbd -p %_sourcedir/preamble
%description
Drbd is a distributed replicated block device. It mirrors a block
device over the network to another machine. Think of it as networked
raid 1. It is a building block for setting up clusters.
%package KMP
Summary: Kernel driver for DRBD
Group: Productivity/Clustering/HA
%description KMP
This module is the kernel-dependent driver for DRBD. This is split out so
that multiple kernel driver versions can be installed, one for each
installed kernel.
%prep
%setup -q -n drbd-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
rm -rf obj
mkdir obj
ln -s ../scripts obj/
for flavor in %{flavors_to_build}; do
cp -r drbd obj/$flavor
cp %_sourcedir/Module.supported obj/$flavor
#make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor
make -C obj/$flavor %{_smp_mflags} all KDIR=%{kernel_source $flavor}
done
%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
for flavor in %{flavors_to_build} ; do
make -C %{kernel_source $flavor} modules_install M=$PWD/obj/$flavor
#From upstream file: drbd-kernel.spec
#kernelrelease=$(cat %{kernel_source $flavor}/include/config/kernel.release || make -s -C %{kernel_source $flavor} kernelrelease)
#mv obj/$flavor/.kernel.config.gz obj/k-config-$kernelrelease.gz
done
mkdir -p %{buildroot}/%{_sbindir}
%{__ln_s} -f %{_sbindir}/service %{buildroot}/%{_sbindir}/rc%{name}
rm -f drbd.conf
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc COPYING
%doc ChangeLog
%{_sbindir}/rc%{name}
%changelog