-
Notifications
You must be signed in to change notification settings - Fork 4
/
drbd-kernel.spec.in
90 lines (76 loc) · 2.6 KB
/
drbd-kernel.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Name: drbd-kernel
Summary: Kernel driver for DRBD
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
Source: http://oss.linbit.com/%{name}/8.3/drbd-%{version}.tar.gz
License: GPLv2+
Group: System Environment/Kernel
URL: http://www.drbd.org/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%if %{defined kernel_module_package_buildreqs}
BuildRequires: %kernel_module_package_buildreqs
%endif
%if %{defined suse_kernel_module_package}
# Support also sles10, where kernel_module_package was not yet defined.
# In sles11, suse_k_m_p became a wrapper around k_m_p.
%if 0%{?suse_version} < 1110
# We need to exclude some flavours on sles10 etc,
# or we hit an rpm internal buffer limit.
%suse_kernel_module_package -n drbd -p drbd/preamble -f drbd/filelist-suse kdump kdumppae vmi vmipae
%else
%suse_kernel_module_package -n drbd -p drbd/preamble -f drbd/filelist-suse
%endif
%else
%kernel_module_package -n drbd -p drbd/preamble -f drbd/filelist-redhat
%endif
%description
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}
%build
rm -rf obj
mkdir obj
ln -s ../scripts obj/
for flavor in %flavors_to_build; do
cp -r drbd obj/$flavor
#make -C %{kernel_source $flavor} M=$PWD/obj/$flavor
make -C obj/$flavor %{_smp_mflags} all KDIR=%{kernel_source $flavor}
done
%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
%if %{defined kernel_module_package_moddir}
export INSTALL_MOD_DIR=%{kernel_module_package_moddir drbd}
%else
%if %{defined suse_kernel_module_package}
export INSTALL_MOD_DIR=updates
%else
export INSTALL_MOD_DIR=extra/drbd
%endif
%endif
for flavor in %flavors_to_build ; do
make -C %{kernel_source $flavor} modules_install \
M=$PWD/obj/$flavor
kernelrelease=$(make -s -C %{kernel_source $flavor} kernelrelease)
mv obj/$flavor/.kernel.config.gz obj/k-config-$kernelrelease.gz
done
%if %{defined suse_kernel_module_package}
# On SUSE, putting the modules into the default path determined by
# %kernel_module_package_moddir is enough to give them priority over
# shipped modules.
rm -f drbd.conf
%else
mkdir -p $RPM_BUILD_ROOT/etc/depmod.d
echo "override drbd * $INSTALL_MOD_DIR" \
> $RPM_BUILD_ROOT/etc/depmod.d/drbd.conf
%endif
%clean
rm -rf %{buildroot}
%changelog
* Tue Jun 29 2011 Philipp Reisner <phil@linbit.com> - 8.3.11-1
- New upstream release.
* Fri Jan 28 2011 Philipp Reisner <phil@linbit.com> - 8.3.10-1
- New upstream release.
* Wed Nov 25 2010 Andreas Gruenbacher <agruen@linbit.com> - 8.3.9-1
- Convert to a Kernel Module Package.