# Conditional build:
%bcond_without dist_kernel # allow non-distribution kernel
%bcond_without kernel # don't build kernel modules
-%bcond_without smp # don't build SMP module
%bcond_without userspace # don't build userspace module
%bcond_with verbose # verbose build (V=1)
-#
-%ifarch sparc
-%undefine with_smp
+
+%if %{without kernel}
+%undefine with_dist_kernel
+%endif
+%if "%{_alt_kernel}" != "%{nil}"
+%undefine with_userspace
+%endif
+%if %{without userspace}
+# nothing to be placed to debuginfo package
+%define _enable_debug_packages 0
%endif
-%define _rel 2
+%define rel 2
+%define pname drbd
Summary: drbd is a block device designed to build high availibility clusters
-Summary(pl): drbd jest urz±dzeniem blokowym dla klastrów o wysokiej niezawodno¶ci
-Name: drbd
-Version: 0.7.17
-Release: %{_rel}
+Summary(pl.UTF-8): drbd jest urządzeniem blokowym dla klastrów o wysokiej niezawodności
+Name: %{pname}%{_alt_kernel}
+Version: 0.7.25
+Release: %{rel}
License: GPL
Group: Base/Kernel
-Source0: http://oss.linbit.com/drbd/0.7/%{name}-%{version}.tar.gz
-# Source0-md5: 01441cd141b5b7b693b6b0cd61a2b8b1
+Source0: http://oss.linbit.com/drbd/0.7/%{pname}-%{version}.tar.gz
+# Source0-md5: 9db298c97306d7d0fe6d0cdbdf695cf6
+Patch0: %{pname}-Makefile.patch
URL: http://www.drbd.org/
+%if %{with userspace}
BuildRequires: bison
BuildRequires: flex
-%{?with_dist_kernel:BuildRequires: kernel-module-build}
-BuildRequires: rpmbuild(macros) >= 1.268
+%endif
+%{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build}
+BuildRequires: rpmbuild(macros) >= 1.452
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
clusters. This is done by mirroring a whole block device via (a
dedicated) network. You could see it as a network RAID1.
-%description -l pl
-drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
-niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
-przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
+%description -l pl.UTF-8
+drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
+niezawodności. drbd działa jako mirroring całego urządzenia blokowego
+przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
-%description -l pt_BR
-O DRBD é um dispositivo de bloco que é projetado para construir
-clusters de Alta Disponibilidade. Isto é feito espelhando um
-dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
-visto como um RAID 1 via rede. Este pacote contém utilitários para
+%description -l pt_BR.UTF-8
+O DRBD é um dispositivo de bloco que é projetado para construir
+clusters de Alta Disponibilidade. Isto é feito espelhando um
+dispositivo de bloco inteiro via rede (dedicada ou não). Pode ser
+visto como um RAID 1 via rede. Este pacote contém utilitários para
gerenciar dispositivos DRBD.
%package -n drbdsetup
Summary: Setup tool and scripts for DRBD
-Summary(pl): Narzêdzie konfiguracyjne i skrypty dla DRBD
-Summary(pt_BR): Utilitários para gerenciar dispositivos DRBD
+Summary(pl.UTF-8): Narzędzie konfiguracyjne i skrypty dla DRBD
+Summary(pt_BR.UTF-8): Utilitários para gerenciar dispositivos DRBD
Group: Applications/System
Requires(post,preun): /sbin/chkconfig
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(postun): /usr/sbin/groupdel
Requires: rc-scripts
+Provides: group(haclient)
Conflicts: drbdsetup24
%description -n drbdsetup
Setup tool and init scripts for DRBD.
-%description -n drbdsetup -l pl
-Narzêdzie konfiguracyjne i skrypty startowe dla DRBD.
+%description -n drbdsetup -l pl.UTF-8
+Narzędzie konfiguracyjne i skrypty startowe dla DRBD.
-%package -n kernel-block-drbd
+%package -n kernel%{_alt_kernel}-block-drbd
Summary: Kernel module with drbd - a block device designed to build high availibility clusters
-Summary(pl): Modu³ j±dra do drbd - urz±dzenia blokowego dla klastrów o wysokiej niezawodno¶ci
-Release: %{_rel}@%{_kernel_ver_str}
+Summary(pl.UTF-8): Moduł jądra do drbd - urządzenia blokowego dla klastrów o wysokiej niezawodności
+Release: %{rel}@%{_kernel_vermagic}
Group: Base/Kernel
-%{?with_dist_kernel:%requires_releq_kernel_up}
+%{?with_dist_kernel:Requires: kernel%{_alt_kernel}(vermagic) = %{_kernel_ver}}
Requires(post,postun): /sbin/depmod
Requires: drbdsetup
+Obsoletes: kernel%{_alt_kernel}-smp-block-drbd
-%description -n kernel-block-drbd
+%description -n kernel%{_alt_kernel}-block-drbd
drbd is a block device which is designed to build high availability
clusters. This is done by mirroring a whole block device via (a
dedicated) network. You could see it as a network RAID1.
-%description -n kernel-block-drbd -l pl
-drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
-niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
-przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
-
-%package -n kernel-smp-block-drbd
-Summary: SMP kernel module with drbd - a block device designed to build high availibility clusters
-Summary(pl): Wersja SMP Modu³u j±dra do drbd - urz±dzenia blokowego dla klastrów o wysokiej niezawodno¶ci
-Release: %{_rel}@%{_kernel_ver_str}
-Group: Base/Kernel
-%{?with_dist_kernel:%requires_releq_kernel_smp}
-Requires(post,postun): /sbin/depmod
-Requires: drbdsetup
-
-%description -n kernel-smp-block-drbd
-drbd is a block device which is designed to build high availability
-clusters. This is done by mirroring a whole block device via (a
-dedicated) network. You could see it as a network RAID1.
-
-%description -n kernel-smp-block-drbd -l pl
-drbd jest urz±dzeniem blokowym zaprojektowanym dla klastrów o wysokiej
-niezawodno¶ci. drbd dzia³a jako mirroring ca³ego urz±dzenia blokowego
-przez (dedykowan±) sieæ. Mo¿e byæ widoczny jako sieciowy RAID1.
+%description -n kernel%{_alt_kernel}-block-drbd -l pl.UTF-8
+drbd jest urządzeniem blokowym zaprojektowanym dla klastrów o wysokiej
+niezawodności. drbd działa jako mirroring całego urządzenia blokowego
+przez (dedykowaną) sieć. Może być widoczny jako sieciowy RAID1.
%prep
-%setup -q
+%setup -q -n %{pname}-%{version}
+%patch0 -p1
%build
%if %{with userspace}
%{__make} tools \
- CC="%{__cc}"
+ KVER=dummy \
+ KDIR=/usr/include \
+ CC="%{__cc}" \
+ OPTCFLAGS="%{rpmcflags}" \
+ LDFLAGS="%{rpmldflags}"
%endif
%if %{with kernel}
sed -i -e 's#$(CONFIG_BLK_DEV_DRBD)#m#g' Makefile-2.6
ln -sf Makefile-2.6 Makefile
# kernel module(s)
-for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
- if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
- exit 1
- fi
- install -d o/include/linux
- ln -sf %{_kernelsrcdir}/config-$cfg o/.config
- ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
- ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
- %{__make} -C %{_kernelsrcdir} O=$PWD/o prepare scripts
- %{__make} -C %{_kernelsrcdir} clean \
- RCS_FIND_IGNORE="-name '*.ko' -o" \
- M=$PWD O=$PWD/o \
- %{?with_verbose:V=1}
- %{__make} -C %{_kernelsrcdir} modules \
-%if "%{_target_base_arch}" != "%{_arch}"
- ARCH=%{_target_base_arch} \
- CROSS_COMPILE=%{_target_base_cpu}-pld-linux- \
-%endif
- HOSTCC="%{__cc}" \
- CPP="%{__cpp}" \
- M=$PWD O=$PWD/o \
- %{?with_verbose:V=1}
- mv drbd{,-$cfg}.ko
-done
+%build_kernel_modules -m drbd
%endif
%install
$RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
%if %{with kernel}
-install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
-install drbd/drbd-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
- $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/drbd.ko
-%if %{with smp} && %{with dist_kernel}
-install drbd/drbd-smp.ko \
- $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/drbd.ko
-%endif
+%install_kernel_modules -m drbd/drbd -d block
%endif
%if %{with userspace}
install scripts/drbd.conf $RPM_BUILD_ROOT%{_sysconfdir}
install scripts/drbd $RPM_BUILD_ROOT/etc/rc.d/init.d
-ln -sf /etc/rc.d/init.d/drbd $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d/datadisk
+install scripts/drbddisk $RPM_BUILD_ROOT%{_sysconfdir}/ha.d/resource.d
install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
%clean
rm -rf $RPM_BUILD_ROOT
-%post -n kernel-block-drbd
+%post -n kernel%{_alt_kernel}-block-drbd
%depmod %{_kernel_ver}
-%postun -n kernel-block-drbd
+%postun -n kernel%{_alt_kernel}-block-drbd
%depmod %{_kernel_ver}
-%post -n kernel-smp-block-drbd
-%depmod %{_kernel_ver}smp
-
-%postun -n kernel-smp-block-drbd
-%depmod %{_kernel_ver}smp
+%pre -n drbdsetup
+%groupadd -g 60 haclient
%post -n drbdsetup
/sbin/chkconfig --add drbd
/sbin/chkconfig --del drbd
fi
+%postun -n drbdsetup
+if [ "$1" = "0" ]; then
+ %groupremove haclient
+fi
+
%if %{with userspace}
%files -n drbdsetup
%defattr(644,root,root,755)
-%attr(755,root,root) /sbin/*
+%attr(755,root,root) /sbin/drbdadm
+%attr(2754,root,haclient) /sbin/drbdsetup
%attr(754,root,root) /etc/rc.d/init.d/drbd
-%attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/datadisk
+%attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
%{_mandir}/man[58]/*
%endif
%if %{with kernel}
-%files -n kernel-block-drbd
-%defattr(644,root,root,755)
-%doc ChangeLog README
-/lib/modules/%{_kernel_ver}/misc/*
-
-%if %{with smp} && %{with dist_kernel}
-%files -n kernel-smp-block-drbd
+%files -n kernel%{_alt_kernel}-block-drbd
%defattr(644,root,root,755)
%doc ChangeLog README
-/lib/modules/%{_kernel_ver}smp/misc/*
-%endif
+/lib/modules/%{_kernel_ver}/block/drbd.ko*
%endif