3 %bcond_without dist_kernel # allow non-distribution kernel
4 %bcond_without kernel # don't build kernel modules
5 %bcond_without userspace # don't build userspace module
6 %bcond_with verbose # verbose build (V=1)
7 %bcond_with grsec_kernel # build for kernel-grsecurity
9 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
10 %define alt_kernel grsecurity
14 Summary: drbd is a block device designed to build high availibility clusters
15 Summary(pl.UTF-8): drbd jest urządzeniem blokowym dla klastrów o wysokiej niezawodności
21 Source0: http://oss.linbit.com/drbd/8.2/%{name}-%{version}.tar.gz
22 # Source0-md5: 057a8f164e9cd8f319a3e714e947f0c4
23 Patch0: %{name}-Makefile.patch
24 URL: http://www.drbd.org/
29 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
30 BuildRequires: rpmbuild(macros) >= 1.379
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 drbd is a block device which is designed to build high availability
35 clusters. This is done by mirroring a whole block device via (a
36 dedicated) network. You could see it as a network RAID1.
38 %description -l pl.UTF-8
39 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
40 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
41 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
43 %description -l pt_BR.UTF-8
44 O DRBD é um dispositivo de bloco que é projetado para construir
45 clusters de Alta Disponibilidade. Isto é feito espelhando um
46 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
47 visto como um RAID 1 via rede. Este pacote contém utilitários para
48 gerenciar dispositivos DRBD.
51 Summary: Setup tool and scripts for DRBD
52 Summary(pl.UTF-8): Narzędzie konfiguracyjne i skrypty dla DRBD
53 Summary(pt_BR.UTF-8): Utilitários para gerenciar dispositivos DRBD
54 Group: Applications/System
55 Requires(post,preun): /sbin/chkconfig
56 Requires(pre): /usr/bin/getgid
57 Requires(pre): /usr/sbin/groupadd
58 Requires(postun): /usr/sbin/groupdel
60 Provides: group(haclient)
61 Conflicts: drbdsetup24
63 %description -n drbdsetup
64 Setup tool and init scripts for DRBD.
66 %description -n drbdsetup -l pl.UTF-8
67 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
69 %package -n kernel%{_alt_kernel}-block-drbd
70 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
71 Summary(pl.UTF-8): Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
72 Release: %{_rel}@%{_kernel_ver_str}
74 %{?with_dist_kernel:%requires_releq_kernel}
75 Requires(post,postun): /sbin/depmod
78 %description -n kernel%{_alt_kernel}-block-drbd
79 drbd is a block device which is designed to build high availability
80 clusters. This is done by mirroring a whole block device via (a
81 dedicated) network. You could see it as a network RAID1.
83 %description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
84 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
85 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
86 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
97 OPTCFLAGS="%{rpmcflags}" \
98 LDFLAGS="%{rpmldflags}"
103 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
104 ln -sf Makefile-2.6 Makefile
106 %build_kernel_modules -m drbd
110 rm -rf $RPM_BUILD_ROOT
111 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
112 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
115 %install_kernel_modules -m drbd/drbd -d block
118 %if %{with userspace}
119 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
120 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
121 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
123 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
125 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
126 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
130 rm -rf $RPM_BUILD_ROOT
132 %post -n kernel%{_alt_kernel}-block-drbd
133 %depmod %{_kernel_ver}
135 %postun -n kernel%{_alt_kernel}-block-drbd
136 %depmod %{_kernel_ver}
139 %groupadd -g 60 haclient
142 /sbin/chkconfig --add drbd
143 %service drbd restart
146 if [ "$1" = "0" ]; then
148 /sbin/chkconfig --del drbd
152 if [ "$1" = "0" ]; then
153 %groupremove haclient
157 %if %{with userspace}
159 %defattr(644,root,root,755)
160 %attr(755,root,root) /sbin/drbdadm
161 %attr(2754,root,haclient) /sbin/drbdsetup
162 %attr(2754,root,haclient) /sbin/drbdmeta
163 %attr(754,root,root) /etc/rc.d/init.d/drbd
164 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
165 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
170 %files -n kernel%{_alt_kernel}-block-drbd
171 %defattr(644,root,root,755)
172 %doc ChangeLog README
173 /lib/modules/%{_kernel_ver}/block/drbd.ko*