3 %bcond_without dist_kernel # allow non-distribution kernel
4 %bcond_without kernel # don't build kernel modules
5 %bcond_without up # don't build UP module
6 %bcond_without smp # don't build SMP module
7 %bcond_without userspace # don't build userspace module
8 %bcond_with verbose # verbose build (V=1)
9 %bcond_with grsec_kernel # build for kernel-grsecurity
11 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
12 %define alt_kernel grsecurity
20 Summary: drbd is a block device designed to build high availibility clusters
21 Summary(pl): drbd jest urz±dzeniem blokowym dla klastrów o wysokiej niezawodno¶ci
27 Source0: http://oss.linbit.com/drbd/0.7/%{name}-%{version}.tar.gz
28 # Source0-md5: 589626e0c62d314d3bbe78275b9e7d2d
29 Patch0: %{name}-Makefile.patch
30 # based on http://members.home.nl/maarten/drbd-0.7.22-2.6.19.patch but compliant
32 Patch1: %{name}-0.7.22-2.6.19-friendly.patch
33 URL: http://www.drbd.org/
38 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build}
39 BuildRequires: rpmbuild(macros) >= 1.330
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 drbd is a block device which is designed to build high availability
44 clusters. This is done by mirroring a whole block device via (a
45 dedicated) network. You could see it as a network RAID1.
48 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
49 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
50 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
53 O DRBD é um dispositivo de bloco que é projetado para construir
54 clusters de Alta Disponibilidade. Isto é feito espelhando um
55 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
56 visto como um RAID 1 via rede. Este pacote contém utilitários para
57 gerenciar dispositivos DRBD.
60 Summary: Setup tool and scripts for DRBD
61 Summary(pl): Narzêdzie konfiguracyjne i skrypty dla DRBD
62 Summary(pt_BR): Utilitários para gerenciar dispositivos DRBD
63 Group: Applications/System
64 Requires(post,preun): /sbin/chkconfig
66 Conflicts: drbdsetup24
68 %description -n drbdsetup
69 Setup tool and init scripts for DRBD.
71 %description -n drbdsetup -l pl
72 Narzêdzie konfiguracyjne i skrypty startowe dla DRBD.
74 %package -n kernel%{_alt_kernel}-block-drbd
75 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
76 Summary(pl): Modu³ j±dra do drbd - urz±dzenia blokowego dla klastrów o wysokiej niezawodno¶ci
77 Release: %{_rel}@%{_kernel_ver_str}
79 %{?with_dist_kernel:%requires_releq_kernel_up}
80 Requires(post,postun): /sbin/depmod
83 %description -n kernel%{_alt_kernel}-block-drbd
84 drbd is a block device which is designed to build high availability
85 clusters. This is done by mirroring a whole block device via (a
86 dedicated) network. You could see it as a network RAID1.
88 %description -n kernel%{_alt_kernel}-block-drbd -l pl
89 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
90 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
91 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
93 %package -n kernel%{_alt_kernel}-smp-block-drbd
94 Summary: SMP kernel module with drbd - a block device designed to build high availibility clusters
95 Summary(pl): Wersja SMP Modu³u j±dra do drbd - urz±dzenia blokowego dla klastrów o wysokiej niezawodno¶ci
96 Release: %{_rel}@%{_kernel_ver_str}
98 %{?with_dist_kernel:%requires_releq_kernel_smp}
99 Requires(post,postun): /sbin/depmod
102 %description -n kernel%{_alt_kernel}-smp-block-drbd
103 drbd is a block device which is designed to build high availability
104 clusters. This is done by mirroring a whole block device via (a
105 dedicated) network. You could see it as a network RAID1.
107 %description -n kernel%{_alt_kernel}-smp-block-drbd -l pl
108 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
109 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
110 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
118 %if %{with userspace}
122 OPTCFLAGS="%{rpmcflags}" \
123 LDFLAGS="%{rpmldflags}"
128 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
129 ln -sf Makefile-2.6 Makefile
131 %build_kernel_modules -m drbd EXTRA_CFLAGS="-DNO_MORE_DEV_FS"
135 rm -rf $RPM_BUILD_ROOT
136 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
137 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
140 %install_kernel_modules -m drbd/drbd -d misc
143 %if %{with userspace}
144 install user/{drbdadm,drbdsetup} $RPM_BUILD_ROOT/sbin
145 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
146 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
148 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
150 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
151 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
155 rm -rf $RPM_BUILD_ROOT
157 %post -n kernel%{_alt_kernel}-block-drbd
158 %depmod %{_kernel_ver}
160 %postun -n kernel%{_alt_kernel}-block-drbd
161 %depmod %{_kernel_ver}
163 %post -n kernel%{_alt_kernel}-smp-block-drbd
164 %depmod %{_kernel_ver}smp
166 %postun -n kernel%{_alt_kernel}-smp-block-drbd
167 %depmod %{_kernel_ver}smp
170 /sbin/chkconfig --add drbd
171 %service drbd restart
174 if [ "$1" = "0" ]; then
176 /sbin/chkconfig --del drbd
179 %if %{with userspace}
181 %defattr(644,root,root,755)
182 %attr(755,root,root) /sbin/*
183 %attr(754,root,root) /etc/rc.d/init.d/drbd
184 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
185 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
190 %files -n kernel%{_alt_kernel}-block-drbd
191 %defattr(644,root,root,755)
192 %doc ChangeLog README
193 /lib/modules/%{_kernel_ver}/misc/drbd.ko*
195 %if %{with smp} && %{with dist_kernel}
196 %files -n kernel%{_alt_kernel}-smp-block-drbd
197 %defattr(644,root,root,755)
198 %doc ChangeLog README
199 /lib/modules/%{_kernel_ver}smp/misc/drbd.ko*