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
14 %undefine with_dist_kernel
16 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
17 %define alt_kernel grsecurity
19 %if "%{_alt_kernel}" != "%{nil}"
20 %undefine with_userspace
25 Summary: drbd is a block device designed to build high availibility clusters
26 Summary(pl.UTF-8): drbd jest urządzeniem blokowym dla klastrów o wysokiej niezawodności
27 Name: %{pname}%{_alt_kernel}
32 Source0: http://oss.linbit.com/drbd/8.2/%{pname}-%{version}.tar.gz
33 # Source0-md5: 30984d869ef1ed5170640681184e51b1
34 Patch0: %{pname}-Makefile.patch
35 URL: http://www.drbd.org/
40 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
41 BuildRequires: rpmbuild(macros) >= 1.379
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 drbd is a block device which is designed to build high availability
46 clusters. This is done by mirroring a whole block device via (a
47 dedicated) network. You could see it as a network RAID1.
49 %description -l pl.UTF-8
50 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
51 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
52 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
54 %description -l pt_BR.UTF-8
55 O DRBD é um dispositivo de bloco que é projetado para construir
56 clusters de Alta Disponibilidade. Isto é feito espelhando um
57 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
58 visto como um RAID 1 via rede. Este pacote contém utilitários para
59 gerenciar dispositivos DRBD.
62 Summary: Setup tool and scripts for DRBD
63 Summary(pl.UTF-8): Narzędzie konfiguracyjne i skrypty dla DRBD
64 Summary(pt_BR.UTF-8): Utilitários para gerenciar dispositivos DRBD
65 Group: Applications/System
66 Requires(post,preun): /sbin/chkconfig
67 Requires(pre): /usr/bin/getgid
68 Requires(pre): /usr/sbin/groupadd
69 Requires(postun): /usr/sbin/groupdel
71 Provides: group(haclient)
72 Conflicts: drbdsetup24
74 %description -n drbdsetup
75 Setup tool and init scripts for DRBD.
77 %description -n drbdsetup -l pl.UTF-8
78 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
80 %package -n kernel%{_alt_kernel}-block-drbd
81 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
82 Summary(pl.UTF-8): Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
83 Release: %{_rel}@%{_kernel_ver_str}
85 %{?with_dist_kernel:%requires_releq_kernel}
86 Requires(post,postun): /sbin/depmod
89 %description -n kernel%{_alt_kernel}-block-drbd
90 drbd is a block device which is designed to build high availability
91 clusters. This is done by mirroring a whole block device via (a
92 dedicated) network. You could see it as a network RAID1.
94 %description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
95 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
96 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
97 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
100 %setup -q -n %{pname}-%{version}
104 %if %{with userspace}
108 OPTCFLAGS="%{rpmcflags}" \
109 LDFLAGS="%{rpmldflags}"
114 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
115 ln -sf Makefile-2.6 Makefile
117 %build_kernel_modules -m drbd
121 rm -rf $RPM_BUILD_ROOT
122 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
123 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
126 %install_kernel_modules -m drbd/drbd -d block
129 %if %{with userspace}
130 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
131 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
132 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
134 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
136 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
137 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
141 rm -rf $RPM_BUILD_ROOT
143 %post -n kernel%{_alt_kernel}-block-drbd
144 %depmod %{_kernel_ver}
146 %postun -n kernel%{_alt_kernel}-block-drbd
147 %depmod %{_kernel_ver}
150 %groupadd -g 60 haclient
153 /sbin/chkconfig --add drbd
154 %service drbd restart
157 if [ "$1" = "0" ]; then
159 /sbin/chkconfig --del drbd
163 if [ "$1" = "0" ]; then
164 %groupremove haclient
168 %if %{with userspace}
170 %defattr(644,root,root,755)
171 %attr(755,root,root) /sbin/drbdadm
172 %attr(2754,root,haclient) /sbin/drbdsetup
173 %attr(2754,root,haclient) /sbin/drbdmeta
174 %attr(754,root,root) /etc/rc.d/init.d/drbd
175 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
176 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
181 %files -n kernel%{_alt_kernel}-block-drbd
182 %defattr(644,root,root,755)
183 %doc ChangeLog README
184 /lib/modules/%{_kernel_ver}/block/drbd.ko*