3 # - trigger to update drbd-8.2 config
6 %bcond_without dist_kernel # allow non-distribution kernel
7 %bcond_without kernel # don't build kernel modules
8 %bcond_without userspace # don't build userspace module
9 %bcond_with verbose # verbose build (V=1)
10 %bcond_with grsec_kernel # build for kernel-grsecurity
17 %undefine with_dist_kernel
19 %if %{with kernel} && %{with dist_kernel} && %{with grsec_kernel}
20 %define alt_kernel grsecurity
22 %if "%{_alt_kernel}" != "%{nil}"
23 %undefine with_userspace
28 Summary: drbd is a block device designed to build high availibility clusters
29 Summary(pl.UTF-8): drbd jest urządzeniem blokowym dla klastrów o wysokiej niezawodności
30 Name: %{pname}%{_alt_kernel}
35 Source0: http://oss.linbit.com/drbd/8.3/%{pname}-%{version}.tar.gz
36 # Source0-md5: 8aa8f7891d397ff25b7a3f77f56d353b
37 Patch0: %{pname}-Makefile.patch
38 Patch1: %{pname}-swab.patch
39 Patch2: %{pname}-parallel-install.patch
40 URL: http://www.drbd.org/
45 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
46 BuildRequires: rpmbuild(macros) >= 1.379
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 drbd is a block device which is designed to build high availability
51 clusters. This is done by mirroring a whole block device via (a
52 dedicated) network. You could see it as a network RAID1.
54 %description -l pl.UTF-8
55 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
56 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
57 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
59 %description -l pt_BR.UTF-8
60 O DRBD é um dispositivo de bloco que é projetado para construir
61 clusters de Alta Disponibilidade. Isto é feito espelhando um
62 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
63 visto como um RAID 1 via rede. Este pacote contém utilitários para
64 gerenciar dispositivos DRBD.
67 Summary: Setup tool and scripts for DRBD
68 Summary(pl.UTF-8): Narzędzie konfiguracyjne i skrypty dla DRBD
69 Summary(pt_BR.UTF-8): Utilitários para gerenciar dispositivos DRBD
70 Group: Applications/System
71 Requires(post,preun): /sbin/chkconfig
72 Requires(pre): /usr/bin/getgid
73 Requires(pre): /usr/sbin/groupadd
74 Requires(postun): /usr/sbin/groupdel
76 Provides: group(haclient)
77 Conflicts: drbdsetup24
80 %description -n drbdsetup
81 Setup tool and init scripts for DRBD.
83 %description -n drbdsetup -l pl.UTF-8
84 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
86 %package -n kernel%{_alt_kernel}-block-drbd
87 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
88 Summary(pl.UTF-8): Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
89 Release: %{_rel}@%{_kernel_ver_str}
91 %{?with_dist_kernel:%requires_releq_kernel}
92 Requires(post,postun): /sbin/depmod
95 %description -n kernel%{_alt_kernel}-block-drbd
96 drbd is a block device which is designed to build high availability
97 clusters. This is done by mirroring a whole block device via (a
98 dedicated) network. You could see it as a network RAID1.
100 %description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
101 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
102 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
103 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
105 %package -n bash-completion-drbd
106 Summary: bash-completion for drbd
107 Summary(pl.UTF-8): Bashowe uzupełnianie poleceń dla drbd
108 Group: Applications/Shells
109 Requires: bash-completion
111 %description -n bash-completion-drbd
112 This package provides bash-completion for drbd.
114 %description -n bash-completion-drbd -l pl.UTF-8
115 Ten pakiet dostarcza bashowe uzupełnianie poleceń dla drbd.
118 %setup -q -n %{pname}-%{version}
124 %if %{with userspace}
128 OPTCFLAGS="%{rpmcflags}" \
129 LDFLAGS="%{rpmldflags}"
134 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
135 ln -sf Makefile-2.6 Makefile
137 %build_kernel_modules -m drbd
141 rm -rf $RPM_BUILD_ROOT
142 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
143 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
146 %install_kernel_modules -m drbd/drbd -d block
149 %if %{with userspace}
150 %{__make} install -C scripts \
151 PREFIX=$RPM_BUILD_ROOT
152 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
153 rm -rf $RPM_BUILD_ROOT/etc/init.d
154 install user/{drbdadm,drbdmeta,drbdsetup} $RPM_BUILD_ROOT/sbin
156 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
157 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
161 rm -rf $RPM_BUILD_ROOT
163 %post -n kernel%{_alt_kernel}-block-drbd
164 %depmod %{_kernel_ver}
166 %postun -n kernel%{_alt_kernel}-block-drbd
167 %depmod %{_kernel_ver}
170 %groupadd -g 60 haclient
173 /sbin/chkconfig --add drbd
174 %service drbd restart
177 if [ "$1" = "0" ]; then
179 /sbin/chkconfig --del drbd
183 if [ "$1" = "0" ]; then
184 %groupremove haclient
188 %if %{with userspace}
190 %defattr(644,root,root,755)
191 %attr(755,root,root) /sbin/drbdadm
192 %attr(2754,root,haclient) /sbin/drbdsetup
193 %attr(2754,root,haclient) /sbin/drbdmeta
194 %attr(754,root,root) /etc/rc.d/init.d/drbd
195 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
196 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
199 %attr(755,root,root) /usr/lib/drbd/*
201 %files -n bash-completion-drbd
202 %defattr(644,root,root,755)
203 /etc/bash_completion.d/drbdadm
207 %files -n kernel%{_alt_kernel}-block-drbd
208 %defattr(644,root,root,755)
209 %doc ChangeLog README
210 /lib/modules/%{_kernel_ver}/block/drbd.ko*