From 653338b9bec7205439f2cbe4fefeebde22258fa6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 21 Sep 2011 06:49:45 +0000 Subject: [PATCH] - new, kernel part needs fixing Changed files: flashcache.spec -> 1.1 --- flashcache.spec | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 flashcache.spec diff --git a/flashcache.spec b/flashcache.spec new file mode 100644 index 0000000..f7373a2 --- /dev/null +++ b/flashcache.spec @@ -0,0 +1,104 @@ +# +# Conditional build: +%bcond_without dist_kernel # allow non-distribution kernel +%bcond_without kernel # don't build kernel modules +%bcond_without userspace # don't build userspace programs +%bcond_with verbose # verbose build (V=1) + +%if %{without kernel} +%undefine with_dist_kernel +%endif + +%define rel 0.1 +Summary: Flashcache - A Write Back Block Cache for Linux +Name: flashcache +Version: 1.0 +Release: %{rel} +License: GPL v2 +Group: Base/Kernel +Source0: https://github.com/facebook/flashcache/tarball/1.0#/%{name}-%{version}.tgz +# Source0-md5: 7b997160231bc67ce3751019ca7d7de0 +URL: https://github.com/facebook/flashcache/ +%if %{with kernel} +%if %{with dist_kernel} +BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.18 +BuildRequires: kernel%{_alt_kernel}-source +%endif +BuildRequires: rpmbuild(macros) >= 1.379 +%endif +%{?with_userspace:BuildRequires: perl-tools-pod} +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +Flashcache is a write back block cache Linux kernel module. + +Flashcache was built primarily as a block cache for InnoDB but is +general purpose and can be used by other applications as well. + +%package -n kernel%{_alt_kernel}-block-flashcache +Summary: FlashCache is a general purpose writeback block cache for Linux +Release: %{rel}@%{_kernel_ver_str} +Group: Base/Kernel +Requires(post,postun): /sbin/depmod +%if %{with dist_kernel} +%requires_releq_kernel +Requires(postun): %releq_kernel +%endif + +%description -n kernel%{_alt_kernel}-block-flashcache +Flashcache Linux kernel driver. + +%prep +%setup -qc +mv *-flashcache-*/* . + +%build +%if %{with kernel} +%build_kernel_modules -m flashcache +%build_kernel_modules -m flashcache-wt -C flashcache-wt +%endif + +%if %{with userspace} +# as makefile aslo tries to build kernel part, we build userspace ourselves +cd src +%{__cc} %{rpmldflags} %{rpmcflags} -I./ -o utils/flashcache_create utils/flashcache_create.c +%{__cc} %{rpmldflags} %{rpmcflags} -I./ -o utils/flashcache_destroy utils/flashcache_destroy.c +%{__cc} %{rpmldflags} %{rpmcflags} -I./ -o utils/flashcache_load utils/flashcache_load.c +cd - +%endif + +%install +rm -rf $RPM_BUILD_ROOT +%if %{with kernel} +%install_kernel_modules -m flashcache,flashcache-wt -d kernel/block +%endif + +%if %{with userspace} +# as makefile aslo tries to build kernel part, we build userspace ourselves +install -d $RPM_BUILD_ROOT%{_sbindir} +install -p src/utils/flashcache_create $RPM_BUILD_ROOT%{_sbindir} +install -p src/utils/flashcache_destroy $RPM_BUILD_ROOT%{_sbindir} +install -p src/utils/flashcache_load $RPM_BUILD_ROOT%{_sbindir} +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -n kernel%{_alt_kernel}-block-flashcache +%depmod %{_kernel_ver} + +%postun -n kernel%{_alt_kernel}-block-flashcache +%depmod %{_kernel_ver} + +%files +%defattr(644,root,root,755) +%doc README doc/* +%attr(755,root,root) %{_sbindir}/flashcache_create +%attr(755,root,root) %{_sbindir}/flashcache_destroy +%attr(755,root,root) %{_sbindir}/flashcache_load + +%if %{with kernel} +%files -n kernel%{_alt_kernel}-block-flashcache +%defattr(644,root,root,755) +/lib/modules/%{_kernel_ver}/kernel/block/*.ko* +%endif -- 2.44.0