Author: sparky                       Date: Thu Nov 23 23:26:42 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use %build_kernel_modules, %install_kernel_modules
- better tools building

---- Files affected:
SPECS:
   drbd.spec (1.85 -> 1.86) 

---- Diffs:

================================================================
Index: SPECS/drbd.spec
diff -u SPECS/drbd.spec:1.85 SPECS/drbd.spec:1.86
--- SPECS/drbd.spec:1.85        Thu Nov 23 20:28:10 2006
+++ SPECS/drbd.spec     Fri Nov 24 00:26:37 2006
@@ -21,11 +21,12 @@
 Group:         Base/Kernel
 Source0:       http://oss.linbit.com/drbd/0.7/%{name}-%{version}.tar.gz
 # Source0-md5: 589626e0c62d314d3bbe78275b9e7d2d
+Patch0:                %{name}-Makefile.patch
 URL:           http://www.drbd.org/
 BuildRequires: bison
 BuildRequires: flex
 %{?with_dist_kernel:BuildRequires:     kernel%{_alt_kernel}-module-build}
-BuildRequires: rpmbuild(macros) >= 1.308
+BuildRequires: rpmbuild(macros) >= 1.330
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -100,12 +101,15 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %if %{with userspace}
 %{__make} tools \
+       KVER=dummy \
        CC="%{__cc}" \
-       KDIR="%{_kernelsrcdir}"
+       OPTCFLAGS="%{rpmcflags}" \
+       LDFLAGS="%{rpmldflags}"
 %endif
 
 %if %{with kernel}
@@ -113,31 +117,7 @@
 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} -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
+%build_kernel_modules -m drbd EXTRA_CFLAGS="-DNO_MORE_DEV_FS"
 %endif
 
 %install
@@ -146,13 +126,7 @@
        $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 misc
 %endif
 
 %if %{with userspace}
@@ -205,13 +179,13 @@
 %files -n kernel%{_alt_kernel}-block-drbd
 %defattr(644,root,root,755)
 %doc ChangeLog README
-/lib/modules/%{_kernel_ver}/misc/*
+/lib/modules/%{_kernel_ver}/misc/drbd.ko*
 
 %if %{with smp} && %{with dist_kernel}
 %files -n kernel%{_alt_kernel}-smp-block-drbd
 %defattr(644,root,root,755)
 %doc ChangeLog README
-/lib/modules/%{_kernel_ver}smp/misc/*
+/lib/modules/%{_kernel_ver}smp/misc/drbd.ko*
 %endif
 %endif
 
@@ -221,6 +195,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.86  2006/11/23 23:26:37  sparky
+- use %build_kernel_modules, %install_kernel_modules
+- better tools building
+
 Revision 1.85  2006/11/23 19:28:10  adamg
 - BuildRequires: rpmbuild(macros) >= 1.308 (alt_kernel support)
 
@@ -302,7 +280,8 @@
 - rel 4; package as *.sparc.rpm
 
 Revision 1.59  2005/11/12 00:48:35  arekm
-- rel 3; should build fine even of ppc (seems that 2.4.14 contains parts of 
ppc32+ppc64 merge -> asm dir is splitted on ppc)
+- rel 3; should build fine even of ppc (seems that 2.4.14 contains parts of
+  ppc32+ppc64 merge -> asm dir is splitted on ppc)
 
 Revision 1.58  2005/11/12 00:04:06  arekm
 - fix cross-build
@@ -409,7 +388,7 @@
 - release 8: rebuild against kernel 2.2.21.
 
 Revision 1.25  2002/04/25 16:13:41  arturs
-fixed a small typo
+- fixed a small typo
 
 Revision 1.24  2002/03/17 16:06:25  dzimi
 - update release numbers to build with new kernel release
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/drbd.spec?r1=1.85&r2=1.86&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to