]>
Commit | Line | Data |
---|---|---|
85de950f | 1 | # TODO |
4c7a488e | 2 | # - make it use kernel headers, not -source |
85de950f ER |
3 | # |
4 | # Conditional build: | |
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) | |
9 | ||
10 | %if %{without kernel} | |
11 | %undefine with_dist_kernel | |
12 | %endif | |
13 | ||
85de950f | 14 | %define _rel 0.1 |
483e9c26 | 15 | Summary: DM-Cache: A Generic Block-level Disk Cache |
64218660 | 16 | Summary(pl.UTF-8): DM-Cache - ogólna pamięć podręczna na poziomie urządzeń blokowych |
85de950f ER |
17 | Name: dmcache |
18 | Version: 0.1 | |
19 | Release: %{_rel} | |
20 | License: GPL | |
21 | Group: Base/Kernel | |
4c7a488e ER |
22 | Source0: http://www.acis.ufl.edu/~ming/dmcache/dmc-setup.pl |
23 | # Source0-md5: f9a214936265781d30a11fbc1d6c0878 | |
85de950f ER |
24 | Patch0: linux-%{name}.patch |
25 | URL: http://www.acis.ufl.edu/~ming/dmcache/index.html | |
26 | BuildRequires: patchutils | |
27 | %if %{with kernel} | |
4c7a488e ER |
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 | |
31 | %endif | |
85de950f ER |
32 | BuildRequires: rpmbuild(macros) >= 1.379 |
33 | %endif | |
4c7a488e | 34 | %{?with_userspace:BuildRequires: perl-tools-pod} |
85de950f ER |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
36 | ||
37 | %description | |
483e9c26 ER |
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 | |
85de950f ER |
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 | |
46 | magnitude. | |
47 | ||
64218660 JB |
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. | |
59 | ||
6d0262e4 | 60 | %package -n kernel%{_alt_kernel}-drivers-dmcache |
64218660 JB |
61 | Summary: dm-cache Linux kernel driver |
62 | Summary(pl.UTF-8): Sterownik jądra Linuksa dm-cache | |
85de950f ER |
63 | Release: %{_rel}@%{_kernel_ver_str} |
64 | Group: Base/Kernel | |
65 | Requires(post,postun): /sbin/depmod | |
66 | %if %{with dist_kernel} | |
67 | %requires_releq_kernel | |
68 | Requires(postun): %releq_kernel | |
69 | %endif | |
70 | ||
6d0262e4 | 71 | %description -n kernel%{_alt_kernel}-drivers-dmcache |
64218660 | 72 | dm-cache Linux kernel driver. |
85de950f | 73 | |
6d0262e4 | 74 | %description -n kernel%{_alt_kernel}-drivers-dmcache -l pl.UTF-8 |
64218660 | 75 | Sterownik jądra Linuksa dm-cache. |
85de950f ER |
76 | |
77 | %prep | |
78 | %setup -qcT | |
4c7a488e | 79 | install %{SOURCE0} . |
85de950f ER |
80 | filterdiff -x '*/Kconfig' -x '*/Makefile' %{PATCH0} | %{__patch} -p1 |
81 | # prepare makefile: | |
82 | cat > drivers/md/Makefile << EOF | |
85de950f | 83 | obj-m += dm-cache.o |
6d0262e4 | 84 | |
fcbc2f35 | 85 | EXTRA_CFLAGS="-I%{_kernelsrcdir}/drivers/md" |
85de950f ER |
86 | EOF |
87 | ||
88 | %build | |
89 | %if %{with userspace} | |
4c7a488e | 90 | pod2man dmc-setup.pl > dmc-setup.1 |
85de950f ER |
91 | %endif |
92 | ||
93 | %if %{with kernel} | |
6d0262e4 | 94 | %build_kernel_modules -C drivers/md -m dm-cache |
85de950f ER |
95 | %endif |
96 | ||
97 | %install | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | %if %{with userspace} | |
4c7a488e ER |
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 | |
85de950f ER |
103 | %endif |
104 | ||
105 | %if %{with kernel} | |
6d0262e4 | 106 | %install_kernel_modules -m drivers/md/dm-cache -d kernel/drivers/md |
85de950f ER |
107 | %endif |
108 | ||
109 | %clean | |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
6d0262e4 | 112 | %post -n kernel%{_alt_kernel}-drivers-dmcache |
85de950f ER |
113 | %depmod %{_kernel_ver} |
114 | ||
6d0262e4 | 115 | %postun -n kernel%{_alt_kernel}-drivers-dmcache |
85de950f ER |
116 | %depmod %{_kernel_ver} |
117 | ||
118 | %if %{with kernel} | |
6d0262e4 | 119 | %files -n kernel%{_alt_kernel}-drivers-dmcache |
85de950f | 120 | %defattr(644,root,root,755) |
6d0262e4 | 121 | /lib/modules/%{_kernel_ver}/kernel/drivers/md/*.ko* |
85de950f ER |
122 | %endif |
123 | ||
124 | %if %{with userspace} | |
125 | %files | |
126 | %defattr(644,root,root,755) | |
4c7a488e ER |
127 | %attr(755,root,root) %{_sbindir}/dmc-setup |
128 | %{_mandir}/man1/dmc-setup.1* | |
85de950f | 129 | %endif |