File scst.spec of Package scst
#
# spec file for package scst (Version 1.0.1.1)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: scst
BuildRequires: kernel-syms module-init-tools
Url: http://scst.sourceforge.net/
Group: System/Kernel
Version: 1.0.99
Release: 1
License: GPL
Summary: Generic mid-level layer for the SCST iSCSI Target kernel driver
Source: scst-svn_r2014.tar.bz2
Source99: kmp-preamble
Patch: scst_strict_ser_mod_subdir.patch
Patch1: scst_kernel_scsi_change.patch
Patch2: iscsi-scst-1.99.dif
Patch3: scst_modulebuild.patch
Patch4: scst_modulelists.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReqProv: on
%suse_kernel_module_package -n scst -p %{S:99} kdump um trace xen debug ec2
%description
SCST is an iet fork that adds features and improvements.
%package devel
License: GPL
Group: Development/Sources
Summary: Header files for the generic mid-level layer for the SCST iSCSI Target kernel driver
%description devel
Header files for the generic mid-level layer for the SCST iSCSI Target kernel driver.
%package iscsi
License: GPL
Group: System/Kernel
Summary: The SCST iSCSI target daemon
%description iscsi
SCST is an iet fork that adds features and improvements.
SCST iSCSI Target daemon and utility programs.
%prep
%setup -n scst
pushd scst
%patch -p1
%patch1 -p1
popd
%patch2 -p0
%patch3 -p0
%patch4 -p0
%build
pushd iscsi-scst
make include/iscsi_scst_itf_ver.h
popd
cd ..
mkdir obj
for flavor in %flavors_to_build; do
rm -rf obj/$flavor
cp -a scst obj/$flavor
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
M=$PWD/obj/$flavor CONFIG_SCST=m CONFIG_SCSI_QLA_FC=m CONFIG_SCSI_QLA2XXX_TARGET=m CONFIG_SCST_QLA_TGT_ADDON=m CONFIG_SCST_ISCSI=m \
SUBDIRS=$PWD/scst/scst %{?_smp_mflags}
done
cd scst
pushd qla2x00t/qla2x00-target
cp README README.qla2x00-target
cp AskingQuestions AskingQuestions.qla2x00-target
cp ToDo ToDo.qla2x00-target
popd
pushd usr/fileio
make
cp README README.fileio
popd
pushd scstadmin/scstadmin.procfs/scst-0.8.22
%{__perl} Makefile.PL OPTIMIZE="$RPM_OPT_FLAGS -Wall"
%{__make} %{?_smp_mflags}
popd
pushd scstadmin
cp README README.scstadmin
popd
pushd iscsi-scst
make -C usr
cp README README.iscsi-scst
cp AskingQuestions AskingQuestions.iscsi-scst
cp ToDo ToDo.iscsi-scst
popd
%install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
cd ..
for flavor in %flavors_to_build; do
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/obj/$flavor
done
cd scst
pushd scst
export INCLUDE_DIR=$RPM_BUILD_ROOT/usr/include/scst
install -d $INCLUDE_DIR
install -m 644 include/*.h $INCLUDE_DIR
popd
pushd usr/fileio
install -d $RPM_BUILD_ROOT/usr/bin
make install INSTALL_DIR=$RPM_BUILD_ROOT/usr/bin
popd
pushd scstadmin/scstadmin.procfs/scst-0.8.*
make DESTDIR=$RPM_BUILD_ROOT install_vendor
%perl_process_packlist
popd
pushd scstadmin
install -d $RPM_BUILD_ROOT/usr/sbin
install -d $RPM_BUILD_ROOT/etc/init.d
install -m 755 scstadmin/scstadmin $RPM_BUILD_ROOT/usr/sbin/scstadmin
install -m 755 init.d/scst $RPM_BUILD_ROOT/etc/init.d
popd
pushd iscsi-scst
install -d $RPM_BUILD_ROOT/%{_mandir}/man5
install -d $RPM_BUILD_ROOT/%{_mandir}/man8
install -m 755 usr/iscsi-scstd usr/iscsi-scst-adm $RPM_BUILD_ROOT/usr/sbin
install -m 755 etc/initd/initd $RPM_BUILD_ROOT/etc/init.d
install -m 644 etc/initiators.allow etc/initiators.deny etc/iscsi-scstd.conf etc/scst.conf $RPM_BUILD_ROOT/etc
install -m 644 doc/manpages/*.5 $RPM_BUILD_ROOT/%{_mandir}/man5
install -m 644 doc/manpages/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8
popd
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%config /etc/init.d/scst
%config(noreplace) /etc/scst.conf
/usr/bin/fileio_tgt
/usr/sbin/scstadmin
%{perl_vendorlib}/SCST
%{perl_vendorarch}/auto/SCST-SCST
%{_mandir}/man3/SCST::SCST.3pm.gz
%doc scst/README scst/ChangeLog scst/COPYING scst/AskingQuestions scst/ToDo
%doc usr/fileio/README.fileio scstadmin/README.scstadmin
%doc qla2x00t/qla2x00-target/README.qla2x00-target
%doc qla2x00t/qla2x00-target/AskingQuestions.qla2x00-target
%doc qla2x00t/qla2x00-target/ToDo.qla2x00-target
/var/adm/perl-modules/scst
%files devel
%defattr(-,root,root)
%dir /usr/include/scst
/usr/include/scst/scst*.h
%files iscsi
%defattr(-,root,root)
%config /etc/init.d/initd
%config(noreplace) /etc/initiators.allow
%config(noreplace) /etc/initiators.deny
%config(noreplace) /etc/iscsi-scstd.conf
/usr/sbin/iscsi-scst-adm
/usr/sbin/iscsi-scstd
%{_mandir}/man5/iscsi-scstd.conf.5.gz
%{_mandir}/man8/iscsi-scst-adm.8.gz
%{_mandir}/man8/iscsi-scstd.8.gz
%doc iscsi-scst/README.iscsi-scst
%doc iscsi-scst/AskingQuestions.iscsi-scst
%doc iscsi-scst/ToDo.iscsi-scst
%changelog