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)
9 %undefine with_dist_kernel
11 %if "%{_alt_kernel}" != "%{nil}"
12 %undefine with_userspace
14 %if %{without userspace}
15 # nothing to be placed to debuginfo package
16 %define _enable_debug_packages 0
21 Summary: drbd is a block device designed to build high availibility clusters
22 Summary(pl.UTF-8): drbd jest urządzeniem blokowym dla klastrów o wysokiej niezawodności
23 Name: %{pname}%{_alt_kernel}
28 Source0: http://oss.linbit.com/drbd/0.7/%{pname}-%{version}.tar.gz
29 # Source0-md5: 9db298c97306d7d0fe6d0cdbdf695cf6
30 Patch0: %{pname}-Makefile.patch
31 URL: http://www.drbd.org/
36 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build}
37 BuildRequires: rpmbuild(macros) >= 1.452
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 drbd is a block device which is designed to build high availability
42 clusters. This is done by mirroring a whole block device via (a
43 dedicated) network. You could see it as a network RAID1.
45 %description -l pl.UTF-8
46 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
47 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
48 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
50 %description -l pt_BR.UTF-8
51 O DRBD é um dispositivo de bloco que é projetado para construir
52 clusters de Alta Disponibilidade. Isto é feito espelhando um
53 dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
54 visto como um RAID 1 via rede. Este pacote contém utilitários para
55 gerenciar dispositivos DRBD.
58 Summary: Setup tool and scripts for DRBD
59 Summary(pl.UTF-8): Narzędzie konfiguracyjne i skrypty dla DRBD
60 Summary(pt_BR.UTF-8): Utilitários para gerenciar dispositivos DRBD
61 Group: Applications/System
62 Requires(post,preun): /sbin/chkconfig
63 Requires(pre): /usr/bin/getgid
64 Requires(pre): /usr/sbin/groupadd
65 Requires(postun): /usr/sbin/groupdel
67 Provides: group(haclient)
68 Conflicts: drbdsetup24
70 %description -n drbdsetup
71 Setup tool and init scripts for DRBD.
73 %description -n drbdsetup -l pl.UTF-8
74 Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
76 %package -n kernel%{_alt_kernel}-block-drbd
77 Summary: Kernel module with drbd - a block device designed to build high availibility clusters
78 Summary(pl.UTF-8): Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
79 Release: %{rel}@%{_kernel_vermagic}
81 %{?with_dist_kernel:Requires: kernel%{_alt_kernel}(vermagic) = %{_kernel_ver}}
82 Requires(post,postun): /sbin/depmod
84 Obsoletes: kernel%{_alt_kernel}-smp-block-drbd
86 %description -n kernel%{_alt_kernel}-block-drbd
87 drbd is a block device which is designed to build high availability
88 clusters. This is done by mirroring a whole block device via (a
89 dedicated) network. You could see it as a network RAID1.
91 %description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
92 drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
93 niezawodności. drbd działa jako mirroring całego urządzenia blokowego
94 przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
97 %setup -q -n %{pname}-%{version}
101 %if %{with userspace}
106 OPTCFLAGS="%{rpmcflags}" \
107 LDFLAGS="%{rpmldflags}"
112 sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
113 ln -sf Makefile-2.6 Makefile
115 %build_kernel_modules -m drbd
119 rm -rf $RPM_BUILD_ROOT
120 install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
121 $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
124 %install_kernel_modules -m drbd/drbd -d block
127 %if %{with userspace}
128 install user/{drbdadm,drbdsetup} $RPM_BUILD_ROOT/sbin
129 install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
130 install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
132 install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
134 install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
135 install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
139 rm -rf $RPM_BUILD_ROOT
141 %post -n kernel%{_alt_kernel}-block-drbd
142 %depmod %{_kernel_ver}
144 %postun -n kernel%{_alt_kernel}-block-drbd
145 %depmod %{_kernel_ver}
148 %groupadd -g 60 haclient
151 /sbin/chkconfig --add drbd
152 %service drbd restart
155 if [ "$1" = "0" ]; then
157 /sbin/chkconfig --del drbd
161 if [ "$1" = "0" ]; then
162 %groupremove haclient
165 %if %{with userspace}
167 %defattr(644,root,root,755)
168 %attr(755,root,root) /sbin/drbdadm
169 %attr(2754,root,haclient) /sbin/drbdsetup
170 %attr(754,root,root) /etc/rc.d/init.d/drbd
171 %attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
172 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
177 %files -n kernel%{_alt_kernel}-block-drbd
178 %defattr(644,root,root,755)
179 %doc ChangeLog README
180 /lib/modules/%{_kernel_ver}/block/drbd.ko*