]> git.pld-linux.org Git - packages/flashcache.git/blob - flashcache.spec
- new, kernel part needs fixing
[packages/flashcache.git] / flashcache.spec
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:        Flashcache - A Write Back Block Cache for Linux
14 Name:           flashcache
15 Version:        1.0
16 Release:        %{rel}
17 License:        GPL v2
18 Group:          Base/Kernel
19 Source0:        https://github.com/facebook/flashcache/tarball/1.0#/%{name}-%{version}.tgz
20 # Source0-md5:  7b997160231bc67ce3751019ca7d7de0
21 URL:            https://github.com/facebook/flashcache/
22 %if %{with kernel}
23 %if %{with dist_kernel}
24 BuildRequires:  kernel%{_alt_kernel}-module-build >= 3:2.6.18
25 BuildRequires:  kernel%{_alt_kernel}-source
26 %endif
27 BuildRequires:  rpmbuild(macros) >= 1.379
28 %endif
29 %{?with_userspace:BuildRequires:        perl-tools-pod}
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 Flashcache is a write back block cache Linux kernel module.
34
35 Flashcache was built primarily as a block cache for InnoDB but is
36 general purpose and can be used by other applications as well.
37
38 %package -n kernel%{_alt_kernel}-block-flashcache
39 Summary:        FlashCache is a general purpose writeback block cache for Linux
40 Release:        %{rel}@%{_kernel_ver_str}
41 Group:          Base/Kernel
42 Requires(post,postun):  /sbin/depmod
43 %if %{with dist_kernel}
44 %requires_releq_kernel
45 Requires(postun):       %releq_kernel
46 %endif
47
48 %description -n kernel%{_alt_kernel}-block-flashcache
49 Flashcache Linux kernel driver.
50
51 %prep
52 %setup -qc
53 mv *-flashcache-*/* .
54
55 %build
56 %if %{with kernel}
57 %build_kernel_modules -m flashcache
58 %build_kernel_modules -m flashcache-wt -C flashcache-wt
59 %endif
60
61 %if %{with userspace}
62 # as makefile aslo tries to build kernel part, we build userspace ourselves
63 cd src
64 %{__cc} %{rpmldflags} %{rpmcflags} -I./ -o utils/flashcache_create utils/flashcache_create.c
65 %{__cc} %{rpmldflags} %{rpmcflags} -I./ -o utils/flashcache_destroy utils/flashcache_destroy.c
66 %{__cc} %{rpmldflags} %{rpmcflags} -I./ -o utils/flashcache_load utils/flashcache_load.c
67 cd -
68 %endif
69
70 %install
71 rm -rf $RPM_BUILD_ROOT
72 %if %{with kernel}
73 %install_kernel_modules -m flashcache,flashcache-wt -d kernel/block
74 %endif
75
76 %if %{with userspace}
77 # as makefile aslo tries to build kernel part, we build userspace ourselves
78 install -d $RPM_BUILD_ROOT%{_sbindir}
79 install -p src/utils/flashcache_create $RPM_BUILD_ROOT%{_sbindir}
80 install -p src/utils/flashcache_destroy $RPM_BUILD_ROOT%{_sbindir}
81 install -p src/utils/flashcache_load $RPM_BUILD_ROOT%{_sbindir}
82 %endif
83
84 %clean
85 rm -rf $RPM_BUILD_ROOT
86
87 %post   -n kernel%{_alt_kernel}-block-flashcache
88 %depmod %{_kernel_ver}
89
90 %postun -n kernel%{_alt_kernel}-block-flashcache
91 %depmod %{_kernel_ver}
92
93 %files
94 %defattr(644,root,root,755)
95 %doc README doc/*
96 %attr(755,root,root) %{_sbindir}/flashcache_create
97 %attr(755,root,root) %{_sbindir}/flashcache_destroy
98 %attr(755,root,root) %{_sbindir}/flashcache_load
99
100 %if %{with kernel}
101 %files -n kernel%{_alt_kernel}-block-flashcache
102 %defattr(644,root,root,755)
103 /lib/modules/%{_kernel_ver}/kernel/block/*.ko*
104 %endif
This page took 0.053006 seconds and 3 git commands to generate.