X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=drbd.spec;h=68ca6ac84fd839015b00d5372438b6452c4f80b8;hb=c6ef38fad206b63c4abcaeec2fce6a03afe3671a;hp=97f7d533e894d7870ec7f8bf75e71d197dc46b47;hpb=1019f1cb78dea7a126fdf07ea400014334b901c0;p=packages%2Fdrbd.git diff --git a/drbd.spec b/drbd.spec index 97f7d53..68ca6ac 100644 --- a/drbd.spec +++ b/drbd.spec @@ -6,21 +6,25 @@ %bcond_without userspace # don't build userspace module %bcond_with verbose # verbose build (V=1) # +%ifarch sparc +%undefine with_smp +%endif + +%define _rel 1 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.11 -%define rel 1 -Release: %{rel} +Version: 0.7.21 +Release: %{_rel} License: GPL Group: Base/Kernel Source0: http://oss.linbit.com/drbd/0.7/%{name}-%{version}.tar.gz -# Source0-md5: 0e6d9b1ab34751772e0aa1a81e9b6185 +# Source0-md5: 17bfc263852db38fa9e51e02eb264e43 URL: http://www.drbd.org/ BuildRequires: bison BuildRequires: flex %{?with_dist_kernel:BuildRequires: kernel-module-build} -BuildRequires: rpmbuild(macros) >= 1.118 +BuildRequires: rpmbuild(macros) >= 1.268 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -45,8 +49,9 @@ 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 Group: Applications/System -PreReq: rc-scripts Requires(post,preun): /sbin/chkconfig +Requires: rc-scripts +Conflicts: drbdsetup24 %description -n drbdsetup Setup tool and init scripts for DRBD. @@ -57,7 +62,7 @@ Narz %package -n 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} +Release: %{_rel}@%{_kernel_ver_str} Group: Base/Kernel %{?with_dist_kernel:%requires_releq_kernel_up} Requires(post,postun): /sbin/depmod @@ -76,7 +81,7 @@ przez (dedykowan %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} +Release: %{_rel}@%{_kernel_ver_str} Group: Base/Kernel %{?with_dist_kernel:%requires_releq_kernel_smp} Requires(post,postun): /sbin/depmod @@ -110,19 +115,23 @@ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist} if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then exit 1 fi - rm -rf include - install -d include/{linux,config} - ln -sf %{_kernelsrcdir}/config-$cfg .config - ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h - ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm - touch include/config/MARKER + 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} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts %{__make} -C %{_kernelsrcdir} clean \ RCS_FIND_IGNORE="-name '*.ko' -o" \ - M=$PWD O=$PWD \ + M=$PWD O=$PWD/o \ %{?with_verbose:V=1} %{__make} -C %{_kernelsrcdir} modules \ - CC="%{__cc}" CPP="%{__cpp}" \ - M=$PWD O=$PWD \ +%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 @@ -148,7 +157,7 @@ install user/{drbdadm,drbdsetup} $RPM_BUILD_ROOT/sbin 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/etc/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 @@ -171,27 +180,20 @@ rm -rf $RPM_BUILD_ROOT %post -n drbdsetup /sbin/chkconfig --add drbd -if [ -f /var/lock/subsys/drbd ]; then - /etc/rc.d/init.d/drbd restart >&2 -else - echo "Run \"/etc/rc.d/init.d/drbd start\" to start drbd service." >&2 -fi +%service drbd restart %preun -n drbdsetup if [ "$1" = "0" ]; then - if [ -f /var/lock/subsys/drbd ]; then - /etc/rc.d/init.d/drbd stop - fi + %service drbd stop /sbin/chkconfig --del drbd fi %if %{with userspace} %files -n drbdsetup %defattr(644,root,root,755) -%doc documentation/*.txt %attr(755,root,root) /sbin/* %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