]> git.pld-linux.org Git - packages/drbd.git/commitdiff
- reworked for 2.6
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 3 Aug 2004 23:19:18 +0000 (23:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- updated to 0.7.1

Changed files:
    drbd.spec -> 1.45

drbd.spec

index 3d32eba1ae45a3f8d561617865389bffd9a22df2..1d18c242ab2bbe1fbd046b944897c47269ee4861 100644 (file)
--- a/drbd.spec
+++ b/drbd.spec
@@ -1,21 +1,24 @@
 #
 # Conditional build:
-%bcond_without dist_kernel     # without kernel from distribution
+%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)
 #
-%define                _kernel24       %(echo %{_kernel_ver} | grep -qv '2\.4\.' ; echo $?)
 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.6.10
+Version:       0.7.1
 %define        rel     1
 Release:       %{rel}
 License:       GPL
 Group:         Base/Kernel
-Source0:       http://www.drbd.org/uploads/media/%{name}-%{version}.tar.gz
-# Source0-md5: 3365eba9d9524da0a2c09543fbbf7f0e
-Patch0:                %{name}-kernel24.patch
+# http://www.drbd.org/download.html
+Source0:       %{name}-%{version}.tar.gz
+# Source0-md5: 5fdafd6cd77f6f43bfbd47dedcb3f6da
 URL:           http://www.drbd.org/
-%{?with_dist_kernel:BuildRequires:     kernel-headers >= 2.2.20}
+%{?with_dist_kernel:BuildRequires:     kernel-headers >= 2.6.0}
 BuildRequires: rpmbuild(macros) >= 1.118
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -90,64 +93,66 @@ przez (dedykowan
 
 %prep
 %setup -q
-%if %{_kernel24}
-#%patch -p1
-%endif
 
 %build
-
-# SMP begin
-%{__make} \
-%ifarch %{ix86}
-       KAF_i386="%{rpmcflags} -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fomit-frame-pointer" \
-%else
-%ifarch %{alpha}
-       KAF_alpha="%{rpmcfalgs} -ffixed8 -mno-fp-regs" \
-%endif
-%endif
-       SMPFLAG="-D__SMP__ -D__KERNEL_SMP=1" \
-       KERNVER="%{__kernel_ver}" \
-       INCLUDE="-I%{_kernelsrcdir}/include" \
-       DEBUGFLAGS="%{rpmcflags} %{?debug:-DDBG}" \
-       LINUX="%{_kernelsrcdir}" \
-       CC="%{kgcc}"
-
-mv -f drbd/drbd.o drbd-smp.o
-# SMP end
-
-# UP begin
-%{__make} \
-%ifarch %{ix86}
-       KAF_i386="%{rpmcflags} -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fomit-frame-pointer" \
-%else
-%ifarch %{alpha}
-       KAF_alpha="%{rpmcfalgs} -ffixed8 -mno-fp-regs" \
+%if %{with userspace}
+%{__make} tools \
+       CC="%{__cc}"
 %endif
+
+%if %{with kernel}
+cd drbd
+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
+done
 %endif
-       SMPFLAG="" \
-       KERNVER="%{__kernel_ver}" \
-       INCLUDE="-I%{_kernelsrcdir}/include" \
-       DEBUGFLAGS="%{rpmcflags} %{?debug:-DDBG}" \
-       LINUX="%{_kernelsrcdir}" \
-       CC="%{kgcc}"
-# SMP end
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8},%{_sysconfdir}} \
        $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.o $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/drbd.o
-install drbd-smp.o $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/drbd.o
+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
+%endif
 
-install user/drbdsetup $RPM_BUILD_ROOT%{_sbindir}
+%if %{with userspace}
+install user/{drbdadm,drbdsetup} $RPM_BUILD_ROOT%{_sbindir}
 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 documentation/drbd.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5
-install documentation/drbdsetup.8 $RPM_BUILD_ROOT%{_mandir}/man8
+install documentation/*.5 $RPM_BUILD_ROOT%{_mandir}/man5
+install documentation/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -180,21 +185,27 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del drbd
 fi
 
+%if %{with userspace}
 %files -n drbdsetup
 %defattr(644,root,root,755)
 %doc documentation/{HOWTO/*.html,*.txt}
-%attr(755,root,root) %{_sbindir}/drbdsetup
+%attr(755,root,root) %{_sbindir}/*
 %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
 %{_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
 %defattr(644,root,root,755)
 %doc ChangeLog README
 /lib/modules/%{_kernel_ver}smp/misc/*
+%endif
+%endif
This page took 0.137542 seconds and 4 git commands to generate.