3 # - trigger to update drbd-8.2 config
4 # - warning: Installed (but unpackaged) file(s) found:
5 # /etc/xen/scripts/block-drbd
6 # /usr/lib/ocf/resource.d/linbit/drbd
9 %bcond_without dist_kernel # allow non-distribution kernel
10 %bcond_without kernel # don't build kernel modules
11 %bcond_without userspace # don't build userspace module
12 %bcond_with verbose # verbose build (V=1)
13 %bcond_with grsec_kernel # build for kernel-grsecurity
20 %undefine with_dist_kernel
22 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
23 %define alt_kernel grsecurity
25 %if "%{_alt_kernel}" != "%{nil}"
26 %undefine with_userspace
31 Summary: drbd is a block device designed to build high availibility clusters
32 Summary(pl.UTF-8): drbd jest urządzeniem blokowym dla klastrów o wysokiej niezawodności
33 Name: %{pname}%{_alt_kernel}
38 Source0: http://oss.linbit.com/drbd/8.3/%{pname}-%{version}.tar.gz
39 # Source0-md5: 8aa8f7891d397ff25b7a3f77f56d353b
40 Patch0: %{pname}-Makefile.patch
41 Patch1: %{pname}-swab.patch
42 Patch2: %{pname}-parallel-install.patch
43 Patch3: %{pname}-bash-completion-install.patch
44 URL: http://www.drbd.org/
49 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
50 BuildRequires: rpmbuild(macros) >= 1.379
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 drbd is a block device which is designed to build high availability
55 clusters. This is done by mirroring a whole block device via (a
56 dedicated) network. You could see it as a network RAID1.
58 %description -l pl.UTF-8
59 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
60 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
61 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
63 %description -l pt_BR.UTF-8
64 O DRBD é um dispositivo de bloco que é projetado para construir
65 clusters de Alta Disponibilidade. Isto é feito espelhando um
66 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
67 visto como um RAID 1 via rede. Este pacote contém utilitários para
68 gerenciar dispositivos DRBD.
71 Summary: Setup tool and scripts for DRBD
72 Summary(pl.UTF-8): Narzędzie konfiguracyjne i skrypty dla DRBD
73 Summary(pt_BR.UTF-8): Utilitários para gerenciar dispositivos DRBD
74 Group: Applications/System
75 Requires(post,preun): /sbin/chkconfig
76 Requires(pre): /usr/bin/getgid
77 Requires(pre): /usr/sbin/groupadd
78 Requires(postun): /usr/sbin/groupdel
80 Provides: group(haclient)
81 Conflicts: drbdsetup24
84 %description -n drbdsetup
85 Setup tool and init scripts for DRBD.
87 %description -n drbdsetup -l pl.UTF-8
88 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
90 %package -n kernel%{_alt_kernel}-block-drbd
91 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
92 Summary(pl.UTF-8): Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
93 Release: %{_rel}@%{_kernel_ver_str}
95 %{?with_dist_kernel:%requires_releq_kernel}
96 Requires(post,postun): /sbin/depmod
99 %description -n kernel%{_alt_kernel}-block-drbd
100 drbd is a block device which is designed to build high availability
101 clusters. This is done by mirroring a whole block device via (a
102 dedicated) network. You could see it as a network RAID1.
104 %description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
105 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
106 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
107 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
109 %package -n bash-completion-drbd
110 Summary: bash-completion for drbd
111 Summary(pl.UTF-8): Bashowe uzupełnianie poleceń dla drbd
112 Group: Applications/Shells
113 Requires: bash-completion
115 %description -n bash-completion-drbd
116 This package provides bash-completion for drbd.
118 %description -n bash-completion-drbd -l pl.UTF-8
119 Ten pakiet dostarcza bashowe uzupełnianie poleceń dla drbd.
121 %package -n drbd-udev
122 Summary: udev rules for drbd kernel module
123 Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla drbd
128 %description -n drbd-udev
129 udev rules for drbd kernel module.
131 %description -n drbd-udev -l pl.UTF-8
132 Reguły udev dla modułu jądra Linuksa dla drbd.
135 %setup -q -n %{pname}-%{version}
142 %if %{with userspace}
146 OPTCFLAGS="%{rpmcflags}" \
147 LDFLAGS="%{rpmldflags}"
152 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
153 ln -sf Makefile-2.6 Makefile
155 %build_kernel_modules -m drbd
159 rm -rf $RPM_BUILD_ROOT
160 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
161 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
164 %install_kernel_modules -m drbd/drbd -d block
167 %if %{with userspace}
168 %{__make} install -C scripts \
169 PREFIX=$RPM_BUILD_ROOT
170 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
171 rm -rf $RPM_BUILD_ROOT/etc/init.d
172 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
174 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
175 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
179 rm -rf $RPM_BUILD_ROOT
181 %post -n kernel%{_alt_kernel}-block-drbd
182 %depmod %{_kernel_ver}
184 %postun -n kernel%{_alt_kernel}-block-drbd
185 %depmod %{_kernel_ver}
188 %groupadd -g 60 haclient
191 /sbin/chkconfig --add drbd
192 %service drbd restart
195 if [ "$1" = "0" ]; then
197 /sbin/chkconfig --del drbd
201 if [ "$1" = "0" ]; then
202 %groupremove haclient
206 %if %{with userspace}
208 %defattr(644,root,root,755)
209 %attr(755,root,root) /sbin/drbdadm
210 %attr(2754,root,haclient) /sbin/drbdsetup
211 %attr(2754,root,haclient) /sbin/drbdmeta
212 %attr(754,root,root) /etc/rc.d/init.d/drbd
213 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
214 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbdupper
215 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
218 %attr(755,root,root) /usr/lib/drbd/*
219 %attr(755,root,root) %{_sbindir}/drbd-overview
221 %files -n bash-completion-drbd
222 %defattr(644,root,root,755)
223 /etc/bash_completion.d/drbdadm
226 %defattr(644,root,root,755)
227 %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/65-drbd.rules
231 %files -n kernel%{_alt_kernel}-block-drbd
232 %defattr(644,root,root,755)
233 %doc ChangeLog README
234 /lib/modules/%{_kernel_ver}/block/drbd.ko*