2 # - build fails as internal kernel headers are used like:
5 #include "dm-bio-list.h"
9 %bcond_without dist_kernel # allow non-distribution kernel
10 %bcond_without kernel # don't build kernel modules
11 %bcond_without userspace # don't build userspace programs
12 %bcond_with verbose # verbose build (V=1)
15 %undefine with_dist_kernel
22 Summary: DM-Cache: A Generic Block-level Disk Cache
28 # http://www.acis.ufl.edu/~ming/dmcache/patch-2.6.21
29 Patch0: linux-%{name}.patch
30 URL: http://www.acis.ufl.edu/~ming/dmcache/index.html
31 BuildRequires: patchutils
33 %{?with_dist_kernel:BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
34 BuildRequires: rpmbuild(macros) >= 1.379
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 Dm-cache provides a generic block-level disk cache for storage
40 networking. It is built upon the Linux device-mapper, a generic block
41 device virtualization infrastructure. It can be transparently plugged
42 into a client of any storage system, including SAN, iSCSI and AoE, and
43 supports dynamic customization for policy-guided optimizations.
44 Experimental evaluation based on file system benchmarks and typical
45 applications show that dm-cache can significantly improve the
46 performance and scalability of a storage system by orders of
49 %package -n kernel%{_alt_kernel}-block-dmcache
50 Summary: Linux driver for dmcache
51 Summary(pl.UTF-8): Sterownik dla Linuksa do dmcache
52 Release: %{_rel}@%{_kernel_ver_str}
54 Requires(post,postun): /sbin/depmod
55 %if %{with dist_kernel}
56 %requires_releq_kernel
57 Requires(postun): %releq_kernel
60 %description -n kernel%{_alt_kernel}-block-dmcache
61 This is driver for dmcache for Linux.
63 This package contains Linux module.
65 %description -n kernel%{_alt_kernel}-block-dmcache -l pl.UTF-8
66 Sterownik dla Linuksa do dmcache.
68 Ten pakiet zawiera moduł jądra Linuksa.
72 filterdiff -x '*/Kconfig' -x '*/Makefile' %{PATCH0} | %{__patch} -p1
74 cat > drivers/md/Makefile << EOF
84 %build_kernel_modules -C drivers/md -m dmcache
88 rm -rf $RPM_BUILD_ROOT
93 %install_kernel_modules -m dmcache -d block
97 rm -rf $RPM_BUILD_ROOT
99 %post -n kernel%{_alt_kernel}-block-dmcache
100 %depmod %{_kernel_ver}
102 %postun -n kernel%{_alt_kernel}-block-dmcache
103 %depmod %{_kernel_ver}
106 %files -n kernel%{_alt_kernel}-block-dmcache
107 %defattr(644,root,root,755)
108 /lib/modules/%{_kernel_ver}/block/*.ko*
111 %if %{with userspace}
113 %defattr(644,root,root,755)