SPECS: dmcache.spec - build using src package, add userspace tool

glen glen at pld-linux.org
Mon Nov 19 11:58:05 CET 2007


Author: glen                         Date: Mon Nov 19 10:58:05 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- build using src package, add userspace tool

---- Files affected:
SPECS:
   dmcache.spec (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SPECS/dmcache.spec
diff -u SPECS/dmcache.spec:1.3 SPECS/dmcache.spec:1.4
--- SPECS/dmcache.spec:1.3	Mon Nov 19 10:26:16 2007
+++ SPECS/dmcache.spec	Mon Nov 19 11:58:00 2007
@@ -1,10 +1,6 @@
 # $Revision$, $Date$
 # TODO
-# - build fails as internal kernel headers are used like:
-#include "dm.h"
-#include "dm-io.h"
-#include "dm-bio-list.h"
-#include "kcopyd.h"
+# - make it use kernel headers, not -source
 #
 # Conditional build:
 %bcond_without	dist_kernel	# allow non-distribution kernel
@@ -16,9 +12,6 @@
 %undefine	with_dist_kernel
 %endif
 
-#
-# main package.
-#
 %define		_rel	0.1
 Summary:	DM-Cache: A Generic Block-level Disk Cache
 Name:		dmcache
@@ -26,14 +19,19 @@
 Release:	%{_rel}
 License:	GPL
 Group:		Base/Kernel
-# http://www.acis.ufl.edu/~ming/dmcache/patch-2.6.21
+Source0:	http://www.acis.ufl.edu/~ming/dmcache/dmc-setup.pl
+# Source0-md5:	f9a214936265781d30a11fbc1d6c0878
 Patch0:		linux-%{name}.patch
 URL:		http://www.acis.ufl.edu/~ming/dmcache/index.html
 BuildRequires:	patchutils
 %if %{with kernel}
-%{?with_dist_kernel:BuildRequires:	kernel%{_alt_kernel}-module-build >= 3:2.6.20.2}
+%if %{with dist_kernel}
+BuildRequires:	kernel%{_alt_kernel}-module-build >= 3:2.6.20.2
+BuildRequires:	kernel%{_alt_kernel}-source >= 3:2.6.20.2
+%endif
 BuildRequires:	rpmbuild(macros) >= 1.379
 %endif
+%{?with_userspace:BuildRequires:	perl-tools-pod}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -70,18 +68,18 @@
 
 %prep
 %setup -qcT
+install %{SOURCE0} .
 filterdiff -x '*/Kconfig' -x '*/Makefile' %{PATCH0} | %{__patch} -p1
 # prepare makefile:
 cat > drivers/md/Makefile << EOF
-
 obj-m += dm-cache.o
 
-# XXX
-CFLAGS += -I$(pwd)/../linux-2.6.22/drivers/md
+CFLAGS += -I%{_kernelsrcdir}/drivers/md
 EOF
 
 %build
 %if %{with userspace}
+pod2man dmc-setup.pl > dmc-setup.1
 %endif
 
 %if %{with kernel}
@@ -91,6 +89,9 @@
 %install
 rm -rf $RPM_BUILD_ROOT
 %if %{with userspace}
+install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man1}
+install dmc-setup.pl $RPM_BUILD_ROOT%{_sbindir}/dmc-setup
+install dmc-setup.1 $RPM_BUILD_ROOT%{_mandir}/man1
 %endif
 
 %if %{with kernel}
@@ -115,6 +116,8 @@
 %if %{with userspace}
 %files
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_sbindir}/dmc-setup
+%{_mandir}/man1/dmc-setup.1*
 %endif
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
@@ -123,6 +126,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2007-11-19 10:58:00  glen
+- build using src package, add userspace tool
+
 Revision 1.3  2007-11-19 09:26:16  glen
 - revert excess replace
 
@@ -131,4 +137,3 @@
 
 Revision 1.1  2007-11-19 09:15:10  glen
 - try compile outside kernel src
-
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/dmcache.spec?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list