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)
14 Summary: drbd is a block device designed to build high availibility clusters
15 Summary(pl): drbd jest urz±dzeniem blokowym dla klastrów o wysokiej niezawodno¶ci
21 Source0: http://oss.linbit.com/drbd/0.7/%{name}-%{version}.tar.gz
22 # Source0-md5: 589626e0c62d314d3bbe78275b9e7d2d
23 URL: http://www.drbd.org/
26 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build}
27 BuildRequires: rpmbuild(macros) >= 1.308
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 drbd is a block device which is designed to build high availability
32 clusters. This is done by mirroring a whole block device via (a
33 dedicated) network. You could see it as a network RAID1.
36 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
37 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
38 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
41 O DRBD é um dispositivo de bloco que é projetado para construir
42 clusters de Alta Disponibilidade. Isto é feito espelhando um
43 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
44 visto como um RAID 1 via rede. Este pacote contém utilitários para
45 gerenciar dispositivos DRBD.
48 Summary: Setup tool and scripts for DRBD
49 Summary(pl): Narzêdzie konfiguracyjne i skrypty dla DRBD
50 Summary(pt_BR): Utilitários para gerenciar dispositivos DRBD
51 Group: Applications/System
52 Requires(post,preun): /sbin/chkconfig
54 Conflicts: drbdsetup24
56 %description -n drbdsetup
57 Setup tool and init scripts for DRBD.
59 %description -n drbdsetup -l pl
60 Narzêdzie konfiguracyjne i skrypty startowe dla DRBD.
62 %package -n kernel%{_alt_kernel}-block-drbd
63 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
64 Summary(pl): Modu³ j±dra do drbd - urz±dzenia blokowego dla klastrów o wysokiej niezawodno¶ci
65 Release: %{_rel}@%{_kernel_ver_str}
67 %{?with_dist_kernel:%requires_releq_kernel_up}
68 Requires(post,postun): /sbin/depmod
71 %description -n kernel%{_alt_kernel}-block-drbd
72 drbd is a block device which is designed to build high availability
73 clusters. This is done by mirroring a whole block device via (a
74 dedicated) network. You could see it as a network RAID1.
76 %description -n kernel%{_alt_kernel}-block-drbd -l pl
77 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
78 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
79 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
81 %package -n kernel%{_alt_kernel}-smp-block-drbd
82 Summary: SMP kernel module with drbd - a block device designed to build high availibility clusters
83 Summary(pl): Wersja SMP Modu³u j±dra do drbd - urz±dzenia blokowego dla klastrów o wysokiej niezawodno¶ci
84 Release: %{_rel}@%{_kernel_ver_str}
86 %{?with_dist_kernel:%requires_releq_kernel_smp}
87 Requires(post,postun): /sbin/depmod
90 %description -n kernel%{_alt_kernel}-smp-block-drbd
91 drbd is a block device which is designed to build high availability
92 clusters. This is done by mirroring a whole block device via (a
93 dedicated) network. You could see it as a network RAID1.
95 %description -n kernel%{_alt_kernel}-smp-block-drbd -l pl
96 drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
97 niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
98 przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
104 %if %{with userspace}
107 KDIR="%{_kernelsrcdir}"
112 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
113 ln -sf Makefile-2.6 Makefile
115 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
116 if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
119 install -d o/include/linux
120 ln -sf %{_kernelsrcdir}/config-$cfg o/.config
121 ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
122 ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
123 %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
124 %{__make} -C %{_kernelsrcdir} clean \
125 RCS_FIND_IGNORE="-name '*.ko' -o" \
128 %{__make} -C %{_kernelsrcdir} modules \
129 %if "%{_target_base_arch}" != "%{_arch}"
130 ARCH=%{_target_base_arch} \
131 CROSS_COMPILE=%{_target_base_cpu}-pld-linux- \
133 EXTRA_CFLAGS="-DNO_MORE_DEV_FS" \
143 rm -rf $RPM_BUILD_ROOT
144 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
145 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
148 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
149 install drbd/drbd-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
150 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/drbd.ko
151 %if %{with smp} && %{with dist_kernel}
152 install drbd/drbd-smp.ko \
153 $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/drbd.ko
157 %if %{with userspace}
158 install user/{drbdadm,drbdsetup} $RPM_BUILD_ROOT/sbin
159 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
160 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
162 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
164 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
165 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
169 rm -rf $RPM_BUILD_ROOT
171 %post -n kernel%{_alt_kernel}-block-drbd
172 %depmod %{_kernel_ver}
174 %postun -n kernel%{_alt_kernel}-block-drbd
175 %depmod %{_kernel_ver}
177 %post -n kernel%{_alt_kernel}-smp-block-drbd
178 %depmod %{_kernel_ver}smp
180 %postun -n kernel%{_alt_kernel}-smp-block-drbd
181 %depmod %{_kernel_ver}smp
184 /sbin/chkconfig --add drbd
185 %service drbd restart
188 if [ "$1" = "0" ]; then
190 /sbin/chkconfig --del drbd
193 %if %{with userspace}
195 %defattr(644,root,root,755)
196 %attr(755,root,root) /sbin/*
197 %attr(754,root,root) /etc/rc.d/init.d/drbd
198 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
199 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
204 %files -n kernel%{_alt_kernel}-block-drbd
205 %defattr(644,root,root,755)
206 %doc ChangeLog README
207 /lib/modules/%{_kernel_ver}/misc/*
209 %if %{with smp} && %{with dist_kernel}
210 %files -n kernel%{_alt_kernel}-smp-block-drbd
211 %defattr(644,root,root,755)
212 %doc ChangeLog README
213 /lib/modules/%{_kernel_ver}smp/misc/*