]> git.pld-linux.org Git - packages/drbd.git/blobdiff - drbd.spec
- release 2
[packages/drbd.git] / drbd.spec
index 92298d1847f130b4c33eb4c20c0b8aaf8b5cd287..16ef75c9a7e70731870ae3ddca2ba1c3db35f815 100644 (file)
--- a/drbd.spec
+++ b/drbd.spec
@@ -1,24 +1,30 @@
 #
 # 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)
+%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
+%endif
+
+%define        _rel    2
 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.5
-%define        rel     1
-Release:       %{rel}
+Version:       0.7.22
+Release:       %{_rel}
 License:       GPL
 Group:         Base/Kernel
 Source0:       http://oss.linbit.com/drbd/0.7/%{name}-%{version}.tar.gz
-# Source0-md5: 80c0acec4f9700485c321c1dbd6c71d6
+# Source0-md5: 589626e0c62d314d3bbe78275b9e7d2d
 URL:           http://www.drbd.org/
-%{?with_dist_kernel:BuildRequires:     kernel-headers >= 2.6.0}
-BuildRequires: rpmbuild(macros) >= 1.118
+BuildRequires: bison
+BuildRequires: flex
+%{?with_dist_kernel:BuildRequires:     kernel-module-build}
+BuildRequires: rpmbuild(macros) >= 1.268
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -43,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.
@@ -55,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
@@ -74,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
@@ -96,7 +103,8 @@ przez (dedykowan
 %build
 %if %{with userspace}
 %{__make} tools \
-       CC="%{__cc}"
+       CC="%{__cc}" \
+       KDIR="%{_kernelsrcdir}"
 %endif
 
 %if %{with kernel}
@@ -105,31 +113,35 @@ 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
-    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
-    %{__make} -C %{_kernelsrcdir} clean \
-        RCS_FIND_IGNORE="-name '*.ko' -o" \
-        M=$PWD O=$PWD \
-        %{?with_verbose:V=1}
-    %{__make} -C %{_kernelsrcdir} modules \
-        CC="%{__cc}" CPP="%{__cpp}" \
-        M=$PWD O=$PWD \
-        %{?with_verbose:V=1}
-
-    mv drbd{,-$cfg}.ko
+       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} -j1 -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
+               EXTRA_CFLAGS="-DNO_MORE_DEV_FS" \
+               HOSTCC="%{__cc}" \
+               CPP="%{__cpp}" \
+               M=$PWD O=$PWD/o \
+               %{?with_verbose:V=1}
+       mv drbd{,-$cfg}.ko
 done
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8},%{_sysconfdir}} \
+install -d $RPM_BUILD_ROOT{/sbin,%{_mandir}/man{5,8},%{_sysconfdir}} \
        $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/ha.d/resource.d}
 
 %if %{with kernel}
@@ -143,11 +155,11 @@ install drbd/drbd-smp.ko \
 %endif
 
 %if %{with userspace}
-install user/{drbdadm,drbdsetup} $RPM_BUILD_ROOT%{_sbindir}
+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
@@ -156,13 +168,13 @@ install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post   -n kernel-block-drbd
+%post -n kernel-block-drbd
 %depmod %{_kernel_ver}
 
 %postun -n kernel-block-drbd
 %depmod %{_kernel_ver}
 
-%post   -n kernel-smp-block-drbd
+%post -n kernel-smp-block-drbd
 %depmod %{_kernel_ver}smp
 
 %postun -n kernel-smp-block-drbd
@@ -170,28 +182,21 @@ 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) %{_sbindir}/*
+%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
-%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/drbd.conf
+%attr(755,root,root) %{_sysconfdir}/ha.d/resource.d/drbddisk
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/drbd.conf
 %{_mandir}/man[58]/*
 %endif
 
This page took 0.065594 seconds and 4 git commands to generate.