SPECS: open-iscsi.spec - up to 2.0-754; new style kernel module bu...

zbyniu zbyniu at pld-linux.org
Thu Apr 19 02:28:11 CEST 2007


Author: zbyniu                       Date: Thu Apr 19 00:28:11 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- up to 2.0-754; new style kernel module build macros
- removed up, smp bcond and smp package

---- Files affected:
SPECS:
   open-iscsi.spec (1.7 -> 1.8) 

---- Diffs:

================================================================
Index: SPECS/open-iscsi.spec
diff -u SPECS/open-iscsi.spec:1.7 SPECS/open-iscsi.spec:1.8
--- SPECS/open-iscsi.spec:1.7	Wed Mar 14 01:23:26 2007
+++ SPECS/open-iscsi.spec	Thu Apr 19 02:28:06 2007
@@ -3,33 +3,32 @@
 # Conditional build:
 %bcond_without	dist_kernel	# allow non-distribution kernel
 %bcond_without	kernel		# don't build kernel modules
-%bcond_without	up		# don't build UP module
-%bcond_without	smp		# don't build SMP module
 %bcond_without	userspace	# don't build userspace module
 %bcond_with	verbose		# verbose build (V=1)
 #
-%define		_rc  rc7-383
+%define		_rc  -754
 %define		_rel 0.1
 Summary:	iSCSI - SCSI over IP
 Summary(pl.UTF-8):	iSCSI - SCSI po IP
 Name:		open-iscsi
-Version:	0.3
+Version:	2.0
 Release:	%{_rel}
 License:	GPL
 Group:		Base/Kernel
 Source0:	http://www.open-iscsi.org/bits/%{name}-%{version}%{_rc}.tar.gz
-# Source0-md5:	5009c7f2756b8c08d1000dee6dc600c1
+# Source0-md5:	2e7ce941ea4e4eda7c82f0b272a33bf9
 Source1:	%{name}.init
 Source2:	%{name}.sysconfig
 URL:		http://www.open-iscsi.org/
 BuildRequires:	db-devel
-%{?with_dist_kernel:BuildRequires:	kernel-headers >= 2.6.0}
-BuildRequires:	rpmbuild(macros) >= 1.268
+%{?with_dist_kernel:BuildRequires:	kernel-headers >= 2.6.20.2}
+BuildRequires:	rpmbuild(macros) >= 1.379
 Requires(post,preun):	/sbin/chkconfig
 Requires:	rc-scripts
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		_sbindir	/sbin
+%define		_moddir		kernel/2.6.20
 
 %description
 The Linux iSCSI driver acts as an iSCSI protocol initiator to
@@ -52,7 +51,7 @@
 Summary(pl.UTF-8):	Moduł jądra ISCSI
 Release:	%{_rel}@%{_kernel_ver_str}
 Group:		Base/Kernel
-Requires:	%{name} = %{version}-%{_rel}
+%{?with_dist_kernel:%requires_releq_kernel}
 
 %description -n kernel-iscsi
 IP over SCSI kernel module.
@@ -60,67 +59,26 @@
 %description -n kernel-iscsi -l pl.UTF-8
 Moduł jądra dla protokołu IP over SCSI.
 
-%package -n kernel-smp-iscsi
-Summary:	ISCSI SMP kernel module
-Summary(pl.UTF-8):	Moduł jądra SMP ISCSI
-Release:	%{_rel}@%{_kernel_ver_str}
-Group:		Base/Kernel
-Requires:	%{name} = %{version}-%{_rel}
-
-%description -n kernel-smp-iscsi
-IP over SCSI SMP kernel module.
-
-%description -n kernel-smp-iscsi -l pl.UTF-8
-Moduł jądra SMP dla protokołu IP over SCSI.
-
 %prep
 %setup -q -n %{name}-%{version}%{_rc}
 
+cat > %{_moddir}/Makefile << EOF
+EXTRA_CFLAGS += -I%{_moddir} -I$PWD/include
+
+obj-m += scsi_transport_iscsi.o
+obj-m += libiscsi.o
+obj-m += iscsi_tcp.o
+EOF
+
 %build
 %if %{with kernel}
-cd kernel
-%if "%{_kernel_ver}" < "2.6.12.0"
-# fix the patch
-grep -B 1000 -m 1 'Index: backward-compile-2.6.11.patch' backward-compile-2.6.11.patch > backward-compile-2.6.11n.patch
-grep -A 1000 'Index: scsi_transport_iscsi.c' backward-compile-2.6.11.patch >> backward-compile-2.6.11n.patch
-patch < backward-compile-2.6.11n.patch
-%else
-%if  "%{_kernel_ver}" < "2.6.13.0"
-patch < backward-compile-2.6.12.patch
-%endif
-%endif
-
-# kernel module(s)
-for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
-	if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
-		exit 1
-	fi
-	rm -rf include
-	install -d include/{linux,config}
-	ln -sf %{_kernelsrcdir}/config-$cfg .config
-	ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
-	ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
-	ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
-	touch include/config/MARKER
-
-	%{__make} -C %{_kernelsrcdir} clean \
-		RCS_FIND_IGNORE="-name '*.ko' -o" \
-		M=$PWD O=$PWD \
-		%{?with_verbose:V=1}
-	%{__make} -C %{_kernelsrcdir} modules \
-		CC="%{__cc}" \
-		M=$PWD O=$PWD \
-		%{?with_verbose:V=1}
-	mv iscsi_tcp{,-$cfg}.ko
-	mv scsi_transport_iscsi{,-$cfg}.ko
-done
-cd ..
+%build_kernel_modules -C %{_moddir} -m scsi_transport_iscsi,libiscsi,iscsi_tcp
 %endif
 
 %if %{with userspace}
 %{__make} -C usr \
 	CC="%{__cc}" \
-	CFLAGS="%{rpmcflags} -I../include -DLinux -DNETLINK_ISCSI=12"
+	CFLAGS="%{rpmcflags} -I../include -DLinux -DNETLINK_ISCSI=12 -D_GNU_SOURCE"
 %endif
 
 %install
@@ -128,19 +86,7 @@
 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{1,5,8},/etc/{rc.d/init.d,sysconfig}}
 
 %if %{with kernel}
-install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
-
-install kernel/iscsi_tcp-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
-	$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/iscsi_tcp.ko
-install kernel/scsi_transport_iscsi-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
-        $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/scsi_transport_iscsi.ko
-
-%if %{with smp} && %{with dist_kernel}
-install kernel/iscsi_tcp-smp.ko \
-	$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/iscsi_tcp.ko
-install kernel/scsi_transport_iscsi-smp.ko \
-        $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/scsi_transport_iscsi.ko
-%endif
+%install_kernel_modules -m %{_moddir}/{iscsi_tcp,libiscsi,scsi_transport_iscsi} -d misc
 %endif
 
 %if %{with userspace}
@@ -163,12 +109,6 @@
 %postun -n kernel-iscsi
 %depmod %{_kernel_ver}
 
-%post -n kernel-smp-iscsi
-%depmod %{_kernel_ver}smp
-
-%postun -n kernel-smp-iscsi
-%depmod %{_kernel_ver}smp
-
 %post
 if ! grep -q "^InitiatorName=[^ \t\n]" %{_sysconfdir}/initiatorname.iscsi 2>/dev/null ; then
 	echo "InitiatorName=$(hostname -f)" >> %{_sysconfdir}/initiatorname.iscsi
@@ -186,7 +126,7 @@
 %if %{with userspace}
 %files
 %defattr(644,root,root,755)
-%doc README THANKS TODO
+%doc README THANKS
 %attr(755,root,root) %{_sbindir}/*
 %attr(750,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/iscsid.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/initiatorname.iscsi
@@ -195,25 +135,21 @@
 %endif
 
 %if %{with kernel}
-%if %{with up} || %{without dist_kernel}
 %files -n kernel-iscsi
 %defattr(644,root,root,755)
 /lib/modules/%{_kernel_ver}/misc/*
 %endif
 
-%if %{with smp} && %{with dist_kernel}
-%files -n kernel-smp-iscsi
-%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}smp/misc/*
-%endif
-%endif
-
 %define	date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <feedback at pld-linux.org>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.8  2007/04/19 00:28:06  zbyniu
+- up to 2.0-754; new style kernel module build macros
+- removed up, smp bcond and smp package
+
 Revision 1.7  2007/03/14 00:23:26  glen
 - up bcond
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/open-iscsi.spec?r1=1.7&r2=1.8&f=u



More information about the pld-cvs-commit mailing list