Blob Blame History Raw
Name:           scsi-target-utils
Version:        1.0.1
Release:        4%{?dist}
Summary:        The SCSI target daemon and utility programs

Group:          System Environment/Daemons
License:        GPLv2
URL:            http://stgt.sourceforge.net/
Source0:        http://stgt.sourceforge.net/releases/tgt-%{version}.tar.gz
Source1:        tgtd.init
Source2:        sysconfig.tgtd
Source3:        targets.conf
Patch0:         scsi-target-utils-redhatify-docs.patch
Patch1:         scsi-target-utils-dynamic-link-iser.patch
Patch2:         scsi-target-utils-hack-check-for-eventfd.patch
Patch3:         scsi-target-utils-snprintf-fix.patch
Patch4:         scsi-target-utils-fix-isns-of.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  pkgconfig libibverbs-devel librdmacm-devel
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts

%description
The SCSI target package contains the daemon and tools to setup a SCSI targets.
Currently, software iSCSI targets are supported.


%prep
%setup -q -n tgt-%{version}
%patch0 -p1 -b .redhatify-docs
%patch1 -p1 -b .dynamic-link-iser
%patch2 -p1 -b .hack-check-for-eventfd
%patch3 -p1 -b .snprintf-fix
%patch4 -p1 -b .fix-isns-of

%build
pushd usr
%{__sed} -i -e 's|-g -O2 -Wall|%{optflags}|' Makefile
%{__make} %{?_smp_mflags} ISCSI=1 ISCSI_RDMA=1
popd


%install
%{__rm} -rf %{buildroot}
%{__install} -d %{buildroot}%{_sbindir}
%{__install} -d %{buildroot}%{_mandir}/man8
%{__install} -d %{buildroot}%{_initrddir}
%{__install} -d %{buildroot}%{_sysconfdir}/tgt
%{__install} -d %{buildroot}%{_sysconfdir}/sysconfig

%{__install} -p -m 0755 scripts/tgt-setup-lun %{buildroot}%{_sbindir}
%{__install} -p -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/tgtd
%{__install} -p -m 0755 scripts/tgt-admin %{buildroot}/%{_sbindir}/tgt-admin
%{__install} -p -m 0644 doc/manpages/tgtadm.8 %{buildroot}/%{_mandir}/man8
%{__install} -p -m 0644 doc/manpages/tgt-admin.8 %{buildroot}/%{_mandir}/man8
%{__install} -p -m 0644 doc/manpages/tgt-setup-lun.8 %{buildroot}/%{_mandir}/man8
%{__install} -p -m 0600 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/tgtd
%{__install} -p -m 0600 %{SOURCE3} %{buildroot}%{_sysconfdir}/tgt

pushd usr
%{__make} install DESTDIR=%{buildroot} sbindir=%{_sbindir}


%post
/sbin/chkconfig --add tgtd

%postun
if [ "$1" -ge "1" ] ; then
     /sbin/service tgtd condrestart > /dev/null 2>&1 || :
fi

%preun
if [ "$1" = "0" ] ; then
     /sbin/service tgtd stop > /dev/null 2>&1 || :
     /sbin/chkconfig --del tgtd
fi


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-, root, root, -)
%doc README doc/README.iscsi doc/README.iser doc/README.lu_configuration doc/README.mmc doc/README.ssc
%{_sbindir}/tgtd
%{_sbindir}/tgtadm
%{_sbindir}/tgt-setup-lun
%{_sbindir}/tgt-admin
%{_sbindir}/tgtimg
%{_mandir}/man8/*
%{_initrddir}/tgtd
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/tgtd
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/tgt/targets.conf


%changelog
* Tue Jun 29 2010 Mike Christie <mchristie@redhat.com> - 1.0.1-4
- Fix iSNS scn pdu overflows (CVE-2010-2221).

* Thu Apr 8 2010 Mike Christie <mchristi@redhat.com> - 1.0.1-3
- Fix format string vulnerability  (CVE-2010-0743)

* Sun Feb 14 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.0.1-2
- Update iser patch to build with new link rules
- Fix optflags

* Sun Jan 24 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> - 1.0.1-1
- Update to new upstream release
- Upstream moved to Sourceforge
- Fix %%preun snippet (#532176)
- Start after network service but before iscsid. Prevents failed mounts from localhost at boot.
- Replace paths with macros in spec
- Add one more doc

* Mon Dec 21 2009 Hans de Goede <hdegoede@redhat.com> - 0.9.11-1.20091205snap
- Rebase to 0.9.11 + some fixes from git (git id
  97832d8dcd00202a493290b5d134b581ce20885c)
- Rewrite initscript, make it follow:
  http://fedoraproject.org/wiki/Packaging/SysVInitScript
  And merge in RHEL-5 initscript improvements:
  - Parse /etc/tgt/targets.conf, which allows easy configuration of targets
  - Better initiator status checking in stop
  - Add force-stop, to stop even when initiators are still connected
  - Make reload reload configuration from /etc/tgt/targets.conf without
    stopping tgtd (but only for unused targets)
  - Add force-reload (reloads configs for all targets including busy ones)

* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.9.5-3
- rebuilt with new openssl

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Mar 16 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.9.5-1
- 0.9.5
- remove patch now upstream
- add patch to fix mising destdir in usr/Makefile
- mktape and dump_tape has moved to tgtimg
- add more docs

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-3
- rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 0.9.2-2
- rebuild with new openssl

* Tue Dec 16 2008 Jarod Wilson <jarod@redhat.com> - 0.9.2-1
- update to 0.9.2 release

* Tue Oct 21 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.0-6.20080805snap
- add tgt-admin man page, tgt-admin and tgt-core-test

* Fri Aug 22 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.0-5.20080805snap
- update to 20080805 snapshot

* Sun Feb 10 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.0-4.20071227snap
- update to 20071227 snapshot
- add patch to compile with newer glibc

* Sat Feb  9 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.0-3.20070803snap
- rebuild

* Sun Dec 07 2007 Alex Lancaster <alexlan[AT]fedoraproject.org> - 0.0-2.20070803snap
- rebuild for new openssl soname bump

* Wed Sep 26 2007 Terje Rosten <terje.rosten@ntnu.no> - 0.0-1.20070803snap
- random cleanup

* Wed Sep 26 2007 Terje Rosten <terje.rosten@ntnu.no> - 0.0-0.20070803snap
- update to 20070803
- fix license tag
- use date macro
- build with correct flags (%%optflags)

* Tue Jul 10 2007 Mike Christie <mchristie@redhat.com> - 0.0-0.20070620snap
- first build