]>
Commit | Line | Data |
---|---|---|
842f5350 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without dist_kernel # allow non-distribution kernel | |
4 | %bcond_without kernel # don't build kernel modules | |
5 | %bcond_without userspace # don't build userspace programs | |
6 | %bcond_with verbose # verbose build (V=1) | |
7 | ||
8 | %if %{without kernel} | |
9 | %undefine with_dist_kernel | |
10 | %endif | |
11 | ||
12 | %define rel 0.1 | |
13 | Summary: Compressed Caching for Linux | |
14 | Name: compcache | |
15 | Version: 0.6.2 | |
16 | Release: %{rel} | |
17 | License: CC 3.0 BY-SA | |
18 | Group: Base/Kernel | |
19 | Source0: http://compcache.googlecode.com/files/%{name}-%{version}.tar.gz | |
20 | # Source0-md5: 27aec78dc50e34fb800c74e879057743 | |
21 | URL: http://code.google.com/p/compcache/ | |
22 | %if %{with kernel} | |
23 | %if %{with dist_kernel} | |
24 | BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.20.2 | |
25 | %endif | |
26 | BuildRequires: rpmbuild(macros) >= 1.379 | |
27 | %endif | |
28 | %{?with_userspace:BuildRequires: perl-tools-pod} | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | This project creates RAM based block device (named ramzswap) which | |
33 | acts as swap disk. Pages swapped to this disk are compressed and | |
34 | stored in memory itself. | |
35 | ||
36 | Compressing pages and keeping them in RAM virtually increases its | |
37 | capacity. This allows more applications to fit in given amount of | |
38 | memory. | |
39 | ||
d3fcad82 | 40 | %package -n kernel%{_alt_kernel}-block-compcache |
842f5350 ER |
41 | Summary: Compressed Caching for Linux |
42 | Release: %{rel}@%{_kernel_ver_str} | |
43 | Group: Base/Kernel | |
44 | Requires(post,postun): /sbin/depmod | |
45 | %if %{with dist_kernel} | |
46 | %requires_releq_kernel | |
47 | Requires(postun): %releq_kernel | |
48 | %endif | |
49 | ||
d3fcad82 | 50 | %description -n kernel%{_alt_kernel}-block-compcache |
842f5350 ER |
51 | compcache Linux kernel driver. |
52 | ||
53 | %prep | |
54 | %setup -qn %{name}-%{version} | |
55 | ||
56 | %build | |
57 | %if %{with kernel} | |
58 | %build_kernel_modules -m ramzswap | |
59 | %endif | |
60 | ||
61 | %install | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | %if %{with kernel} | |
d3fcad82 | 64 | %install_kernel_modules -m ramzswap -d kernel/block |
842f5350 ER |
65 | %endif |
66 | ||
67 | %clean | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
d3fcad82 | 70 | %post -n kernel%{_alt_kernel}-block-compcache |
842f5350 ER |
71 | %depmod %{_kernel_ver} |
72 | ||
d3fcad82 | 73 | %postun -n kernel%{_alt_kernel}-block-compcache |
842f5350 ER |
74 | %depmod %{_kernel_ver} |
75 | ||
76 | %if %{with kernel} | |
d3fcad82 | 77 | %files -n kernel%{_alt_kernel}-block-compcache |
842f5350 ER |
78 | %defattr(644,root,root,755) |
79 | %doc README Changelog | |
d3fcad82 | 80 | /lib/modules/%{_kernel_ver}/kernel/block/*.ko* |
842f5350 | 81 | %endif |