3 %bcond_without dist_kernel # allow non-distribution kernel
4 %bcond_without kernel # don't build kernel modules
5 %bcond_without smp # don't build SMP module
6 %bcond_without userspace # don't build userspace module
7 %bcond_with verbose # verbose build (V=1)
8 %bcond_with grsec_kernel # build for kernel-grsecurity
10 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
11 %define alt_kernel grsecurity
19 Summary: drbd is a block device designed to build high availibility clusters
20 Summary(pl): drbd jest urz±dzeniem blokowym dla klastrów o wysokiej niezawodno¶ci
26 Source0: http://oss.linbit.com/drbd/0.7/%{name}-%{version}.tar.gz
27 # Source0-md5: 589626e0c62d314d3bbe78275b9e7d2d
28 Patch0: %{name}-Makefile.patch
29 URL: http://www.drbd.org/
34 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build}
35 BuildRequires: rpmbuild(macros) >= 1.330
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 drbd is a block device which is designed to build high availability
40 clusters. This is done by mirroring a whole block device via (a
41 dedicated) network. You could see it as a network RAID1.
44 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
45 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
46 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
49 O DRBD é um dispositivo de bloco que é projetado para construir
50 clusters de Alta Disponibilidade. Isto é feito espelhando um
51 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
52 visto como um RAID 1 via rede. Este pacote contém utilitários para
53 gerenciar dispositivos DRBD.
56 Summary: Setup tool and scripts for DRBD
57 Summary(pl): Narzêdzie konfiguracyjne i skrypty dla DRBD
58 Summary(pt_BR): Utilitários para gerenciar dispositivos DRBD
59 Group: Applications/System
60 Requires(post,preun): /sbin/chkconfig
62 Conflicts: drbdsetup24
64 %description -n drbdsetup
65 Setup tool and init scripts for DRBD.
67 %description -n drbdsetup -l pl
68 Narzêdzie konfiguracyjne i skrypty startowe dla DRBD.
70 %package -n kernel%{_alt_kernel}-block-drbd
71 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
72 Summary(pl): Modu³ j±dra do drbd - urz±dzenia blokowego dla klastrów o wysokiej niezawodno¶ci
73 Release: %{_rel}@%{_kernel_ver_str}
75 %{?with_dist_kernel:%requires_releq_kernel_up}
76 Requires(post,postun): /sbin/depmod
79 %description -n kernel%{_alt_kernel}-block-drbd
80 drbd is a block device which is designed to build high availability
81 clusters. This is done by mirroring a whole block device via (a
82 dedicated) network. You could see it as a network RAID1.
84 %description -n kernel%{_alt_kernel}-block-drbd -l pl
85 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
86 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
87 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
89 %package -n kernel%{_alt_kernel}-smp-block-drbd
90 Summary: SMP kernel module with drbd - a block device designed to build high availibility clusters
91 Summary(pl): Wersja SMP Modu³u j±dra do drbd - urz±dzenia blokowego dla klastrów o wysokiej niezawodno¶ci
92 Release: %{_rel}@%{_kernel_ver_str}
94 %{?with_dist_kernel:%requires_releq_kernel_smp}
95 Requires(post,postun): /sbin/depmod
98 %description -n kernel%{_alt_kernel}-smp-block-drbd
99 drbd is a block device which is designed to build high availability
100 clusters. This is done by mirroring a whole block device via (a
101 dedicated) network. You could see it as a network RAID1.
103 %description -n kernel%{_alt_kernel}-smp-block-drbd -l pl
104 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
105 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
106 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
113 %if %{with userspace}
117 OPTCFLAGS="%{rpmcflags}" \
118 LDFLAGS="%{rpmldflags}"
123 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
124 ln -sf Makefile-2.6 Makefile
126 %build_kernel_modules -m drbd EXTRA_CFLAGS="-DNO_MORE_DEV_FS"
130 rm -rf $RPM_BUILD_ROOT
131 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
132 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
135 %install_kernel_modules -m drbd/drbd -d misc
138 %if %{with userspace}
139 install user/{drbdadm,drbdsetup} $RPM_BUILD_ROOT/sbin
140 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
141 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
143 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
145 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
146 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
150 rm -rf $RPM_BUILD_ROOT
152 %post -n kernel%{_alt_kernel}-block-drbd
153 %depmod %{_kernel_ver}
155 %postun -n kernel%{_alt_kernel}-block-drbd
156 %depmod %{_kernel_ver}
158 %post -n kernel%{_alt_kernel}-smp-block-drbd
159 %depmod %{_kernel_ver}smp
161 %postun -n kernel%{_alt_kernel}-smp-block-drbd
162 %depmod %{_kernel_ver}smp
165 /sbin/chkconfig --add drbd
166 %service drbd restart
169 if [ "$1" = "0" ]; then
171 /sbin/chkconfig --del drbd
174 %if %{with userspace}
176 %defattr(644,root,root,755)
177 %attr(755,root,root) /sbin/*
178 %attr(754,root,root) /etc/rc.d/init.d/drbd
179 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
180 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
185 %files -n kernel%{_alt_kernel}-block-drbd
186 %defattr(644,root,root,755)
187 %doc ChangeLog README
188 /lib/modules/%{_kernel_ver}/misc/drbd.ko*
190 %if %{with smp} && %{with dist_kernel}
191 %files -n kernel%{_alt_kernel}-smp-block-drbd
192 %defattr(644,root,root,755)
193 %doc ChangeLog README
194 /lib/modules/%{_kernel_ver}smp/misc/drbd.ko*