2 # - make it use kernel headers, not -source
5 %bcond_without dist_kernel # allow non-distribution kernel
6 %bcond_without kernel # don't build kernel modules
7 %bcond_without userspace # don't build userspace programs
8 %bcond_with verbose # verbose build (V=1)
11 %undefine with_dist_kernel
15 Summary: DM-Cache: A Generic Block-level Disk Cache
16 Summary(pl.UTF-8): DM-Cache - ogólna pamięć podręczna na poziomie urządzeń blokowych
22 Source0: http://www.acis.ufl.edu/~ming/dmcache/dmc-setup.pl
23 # Source0-md5: f9a214936265781d30a11fbc1d6c0878
24 Patch0: linux-%{name}.patch
25 URL: http://www.acis.ufl.edu/~ming/dmcache/index.html
26 BuildRequires: patchutils
28 %if %{with dist_kernel}
29 BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2
30 BuildRequires: kernel%{_alt_kernel}-source >= 3:2.6.20.2
32 BuildRequires: rpmbuild(macros) >= 1.379
34 %{?with_userspace:BuildRequires: perl-tools-pod}
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Dm-cache provides a generic block-level disk cache for storage
39 networking. It is built upon the Linux device-mapper, a generic block
40 device virtualization infrastructure. It can be transparently plugged
41 into a client of any storage system, including SAN, iSCSI and AoE, and
42 supports dynamic customization for policy-guided optimizations.
43 Experimental evaluation based on file system benchmarks and typical
44 applications show that dm-cache can significantly improve the
45 performance and scalability of a storage system by orders of
48 %description -l pl.UTF-8
49 dm-cache udostępnia ogólną pamięć podręczną na poziomie urządzeń
50 blokowych dla dysków, z myślą o sieciowym dostępie do danych. Jest
51 zbudowana w oparciu o linuksowy device-mapper - ogólną infrastrukturę
52 wirtualizacji urządzeń blokowych. Może być w sposób przezroczysty
53 włączony w klienta dowolnego systemu składowania danych, w tym SAN,
54 iSCSI i AoE, ponadto obsługuje dynamiczne dostosowywanie do
55 optymalizacji sterowanych polityką. Eksperymentalne szacowanie oparte
56 na testach wydajności systemu plików i typowych aplikacji pokazuje, że
57 dm-cache może znacząco poprawić wydajność i skalowalność systemu
58 składowania danych o rzędy wielkości.
60 %package -n kernel%{_alt_kernel}-drivers-dmcache
61 Summary: dm-cache Linux kernel driver
62 Summary(pl.UTF-8): Sterownik jądra Linuksa dm-cache
63 Release: %{_rel}@%{_kernel_ver_str}
65 Requires(post,postun): /sbin/depmod
66 %if %{with dist_kernel}
67 %requires_releq_kernel
68 Requires(postun): %releq_kernel
71 %description -n kernel%{_alt_kernel}-drivers-dmcache
72 dm-cache Linux kernel driver.
74 %description -n kernel%{_alt_kernel}-drivers-dmcache -l pl.UTF-8
75 Sterownik jądra Linuksa dm-cache.
80 filterdiff -x '*/Kconfig' -x '*/Makefile' %{PATCH0} | %{__patch} -p1
82 cat > drivers/md/Makefile << EOF
85 EXTRA_CFLAGS="-I%{_kernelsrcdir}/drivers/md"
90 pod2man dmc-setup.pl > dmc-setup.1
94 %build_kernel_modules -C drivers/md -m dm-cache
98 rm -rf $RPM_BUILD_ROOT
100 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1}
101 install dmc-setup.pl $RPM_BUILD_ROOT%{_sbindir}/dmc-setup
102 install dmc-setup.1 $RPM_BUILD_ROOT%{_mandir}/man1
106 %install_kernel_modules -m drivers/md/dm-cache -d kernel/drivers/md
110 rm -rf $RPM_BUILD_ROOT
112 %post -n kernel%{_alt_kernel}-drivers-dmcache
113 %depmod %{_kernel_ver}
115 %postun -n kernel%{_alt_kernel}-drivers-dmcache
116 %depmod %{_kernel_ver}
119 %files -n kernel%{_alt_kernel}-drivers-dmcache
120 %defattr(644,root,root,755)
121 /lib/modules/%{_kernel_ver}/kernel/drivers/md/*.ko*
124 %if %{with userspace}
126 %defattr(644,root,root,755)
127 %attr(755,root,root) %{_sbindir}/dmc-setup
128 %{_mandir}/man1/dmc-setup.1*