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)
15 %undefine with_dist_kernel
17 %if "%{_alt_kernel}" != "%{nil}"
18 %undefine with_userspace
20 %if %{without userspace}
21 # nothing to be placed to debuginfo package
22 %define _enable_debug_packages 0
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}8%{_alt_kernel}
34 Source0: http://oss.linbit.com/drbd/8.2/%{pname}-%{version}.tar.gz
35 # Source0-md5: 43da0e3888e38ef8254197dbca35ed89
36 Patch0: %{pname}8-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.
63 %package -n drbdsetup8
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
75 Conflicts: drbdsetup < 8.0.0
77 %description -n drbdsetup8
78 Setup tool and init scripts for DRBD.
80 %description -n drbdsetup8 -l pl.UTF-8
81 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
83 %package -n kernel%{_alt_kernel}-block-drbd8
84 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
85 Summary(pl.UTF-8): Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
86 Release: %{rel}@%{_kernel_vermagic}
88 %{?with_dist_kernel:Requires: kernel%{_alt_kernel}(vermagic) = %{_kernel_ver}}
89 Requires(post,postun): /sbin/depmod
91 Conflicts: kernel%{_alt_kernel}-block-drbd
93 %description -n kernel%{_alt_kernel}-block-drbd8
94 drbd is a block device which is designed to build high availability
95 clusters. This is done by mirroring a whole block device via (a
96 dedicated) network. You could see it as a network RAID1.
98 %description -n kernel%{_alt_kernel}-block-drbd8 -l pl.UTF-8
99 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
100 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
101 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
103 %package -n kernel%{_alt_kernel}-smp-block-drbd8
104 Summary: SMP kernel module with drbd - a block device designed to build high availibility clusters
105 Summary(pl.UTF-8): Wersja SMP Modułu jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
106 Release: %{_rel}@%{_kernel_ver_str}
108 %{?with_dist_kernel:Requires: kernel%{_alt_kernel}(vermagic) = %{_kernel_ver}}
109 Requires(post,postun): /sbin/depmod
111 Conflicts: kernel%{_alt_kernel}-smp-block-drbd
113 %description -n kernel%{_alt_kernel}-smp-block-drbd8
114 drbd is a block device which is designed to build high availability
115 clusters. This is done by mirroring a whole block device via (a
116 dedicated) network. You could see it as a network RAID1.
118 %description -n kernel%{_alt_kernel}-smp-block-drbd8 -l pl.UTF-8
119 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
120 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
121 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
124 %setup -q -n %{pname}-%{version}
128 %if %{with userspace}
133 OPTCFLAGS="%{rpmcflags}" \
134 LDFLAGS="%{rpmldflags}"
139 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
140 ln -sf Makefile-2.6 Makefile
142 %build_kernel_modules -m drbd
146 rm -rf $RPM_BUILD_ROOT
147 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
148 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
151 %install_kernel_modules -m drbd/drbd -d block
154 %if %{with userspace}
155 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
156 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
157 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
159 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
161 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
162 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
166 rm -rf $RPM_BUILD_ROOT
168 %post -n kernel%{_alt_kernel}-block-drbd8
169 %depmod %{_kernel_ver}
171 %postun -n kernel%{_alt_kernel}-block-drbd8
172 %depmod %{_kernel_ver}
174 %post -n kernel%{_alt_kernel}-smp-block-drbd8
175 %depmod %{_kernel_ver}smp
177 %postun -n kernel%{_alt_kernel}-smp-block-drbd8
178 %depmod %{_kernel_ver}smp
181 %groupadd -g 60 haclient
184 /sbin/chkconfig --add drbd
185 %service drbd restart
188 if [ "$1" = "0" ]; then
190 /sbin/chkconfig --del drbd
193 %postun -n drbdsetup8
194 if [ "$1" = "0" ]; then
195 %groupremove haclient
198 %if %{with userspace}
200 %defattr(644,root,root,755)
201 %attr(755,root,root) /sbin/drbdadm
202 %attr(2754,root,haclient) /sbin/drbdsetup
203 %attr(2754,root,haclient) /sbin/drbdmeta
204 %attr(754,root,root) /etc/rc.d/init.d/drbd
205 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
206 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
211 %if %{with up} || %{without dist_kernel}
212 %files -n kernel%{_alt_kernel}-block-drbd8
213 %defattr(644,root,root,755)
214 %doc ChangeLog README
215 /lib/modules/%{_kernel_ver}/block/drbd.ko*
218 %if %{with smp} && %{with dist_kernel}
219 %files -n kernel%{_alt_kernel}-smp-block-drbd8
220 %defattr(644,root,root,755)
221 %doc ChangeLog README
222 /lib/modules/%{_kernel_ver}smp/block/drbd.ko*