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
16 %undefine with_dist_kernel
18 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
19 %define alt_kernel grsecurity
21 %if "%{_alt_kernel}" != "%{nil}"
22 %undefine with_userspace
27 Summary: drbd is a block device designed to build high availibility clusters
28 Summary(pl.UTF-8): drbd jest urządzeniem blokowym dla klastrów o wysokiej niezawodności
29 Name: %{pname}%{_alt_kernel}
34 Source0: http://oss.linbit.com/drbd/8.2/%{pname}-%{version}.tar.gz
35 # Source0-md5: 345c1056b2033184a7935c1bb79cc57e
36 Patch0: %{pname}-Makefile.patch
37 URL: http://www.drbd.org/
42 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build}
43 BuildRequires: rpmbuild(macros) >= 1.379
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 drbd is a block device which is designed to build high availability
48 clusters. This is done by mirroring a whole block device via (a
49 dedicated) network. You could see it as a network RAID1.
51 %description -l pl.UTF-8
52 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
53 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
54 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
56 %description -l pt_BR.UTF-8
57 O DRBD é um dispositivo de bloco que é projetado para construir
58 clusters de Alta Disponibilidade. Isto é feito espelhando um
59 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
60 visto como um RAID 1 via rede. Este pacote contém utilitários para
61 gerenciar dispositivos DRBD.
64 Summary: Setup tool and scripts for DRBD
65 Summary(pl.UTF-8): Narzędzie konfiguracyjne i skrypty dla DRBD
66 Summary(pt_BR.UTF-8): Utilitários para gerenciar dispositivos DRBD
67 Group: Applications/System
68 Requires(post,preun): /sbin/chkconfig
69 Requires(pre): /usr/bin/getgid
70 Requires(pre): /usr/sbin/groupadd
71 Requires(postun): /usr/sbin/groupdel
73 Provides: group(haclient)
74 Conflicts: drbdsetup24
76 %description -n drbdsetup
77 Setup tool and init scripts for DRBD.
79 %description -n drbdsetup -l pl.UTF-8
80 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
82 %package -n kernel%{_alt_kernel}-block-drbd
83 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
84 Summary(pl.UTF-8): Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
85 Release: %{_rel}@%{_kernel_ver_str}
87 %{?with_dist_kernel:%requires_releq_kernel_up}
88 Requires(post,postun): /sbin/depmod
91 %description -n kernel%{_alt_kernel}-block-drbd
92 drbd is a block device which is designed to build high availability
93 clusters. This is done by mirroring a whole block device via (a
94 dedicated) network. You could see it as a network RAID1.
96 %description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
97 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
98 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
99 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
101 %package -n kernel%{_alt_kernel}-smp-block-drbd
102 Summary: SMP kernel module with drbd - a block device designed to build high availibility clusters
103 Summary(pl.UTF-8): Wersja SMP Modułu jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
104 Release: %{_rel}@%{_kernel_ver_str}
106 %{?with_dist_kernel:%requires_releq_kernel_smp}
107 Requires(post,postun): /sbin/depmod
110 %description -n kernel%{_alt_kernel}-smp-block-drbd
111 drbd is a block device which is designed to build high availability
112 clusters. This is done by mirroring a whole block device via (a
113 dedicated) network. You could see it as a network RAID1.
115 %description -n kernel%{_alt_kernel}-smp-block-drbd -l pl.UTF-8
116 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
117 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
118 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
121 %setup -q -n %{pname}-%{version}
126 %if %{with userspace}
130 OPTCFLAGS="%{rpmcflags}" \
131 LDFLAGS="%{rpmldflags}"
136 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
137 ln -sf Makefile-2.6 Makefile
139 %build_kernel_modules -m drbd
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_kernel_modules -m drbd/drbd -d block
151 %if %{with userspace}
152 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
153 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
154 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
156 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
158 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
159 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
163 rm -rf $RPM_BUILD_ROOT
165 %post -n kernel%{_alt_kernel}-block-drbd
166 %depmod %{_kernel_ver}
168 %postun -n kernel%{_alt_kernel}-block-drbd
169 %depmod %{_kernel_ver}
171 %post -n kernel%{_alt_kernel}-smp-block-drbd
172 %depmod %{_kernel_ver}smp
174 %postun -n kernel%{_alt_kernel}-smp-block-drbd
175 %depmod %{_kernel_ver}smp
178 %groupadd -g 60 haclient
181 /sbin/chkconfig --add drbd
182 %service drbd restart
185 if [ "$1" = "0" ]; then
187 /sbin/chkconfig --del drbd
191 if [ "$1" = "0" ]; then
192 %groupremove haclient
196 %if %{with userspace}
198 %defattr(644,root,root,755)
199 %attr(755,root,root) /sbin/drbdadm
200 %attr(2754,root,haclient) /sbin/drbdsetup
201 %attr(2754,root,haclient) /sbin/drbdmeta
202 %attr(754,root,root) /etc/rc.d/init.d/drbd
203 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
204 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
209 %if %{with up} || %{without dist_kernel}
210 %files -n kernel%{_alt_kernel}-block-drbd
211 %defattr(644,root,root,755)
212 %doc ChangeLog README
213 /lib/modules/%{_kernel_ver}/block/drbd.ko*
216 %if %{with smp} && %{with dist_kernel}
217 %files -n kernel%{_alt_kernel}-smp-block-drbd
218 %defattr(644,root,root,755)
219 %doc ChangeLog README
220 /lib/modules/%{_kernel_ver}smp/block/drbd.ko*