3c30fa7
%global oname tgt
cebdd1c
24fb4a4
%ifnarch s390 s390x
24fb4a4
%global with_rdma 1
24fb4a4
%endif
24fb4a4
8e3dfc6
# Disable rbd on epel7 b/c deps are not present
8e3dfc6
%{!?rhel:%global with_rbd 1}
8e3dfc6
efe3e95
%ifnarch ppc64
efe3e95
%global with_glfs 1
efe3e95
%endif
efe3e95
8e3dfc6
4350be4
Name:           scsi-target-utils
731a183
Version:        1.0.55
f54d0da
Release:        2%{?dist}
4350be4
Summary:        The SCSI target daemon and utility programs
4350be4
4350be4
Group:          System Environment/Daemons
4350be4
License:        GPLv2
2980c24
URL:            http://stgt.sourceforge.net/
3c30fa7
Source0:        http://fujita.github.com/tgt/downloads/%{oname}-%{version}.tar.gz
ae144d8
Source1:        tgtd.service
3a5b6ad
Source2:        sysconfig.tgtd
3a5b6ad
Source3:        targets.conf
fe43e53
Source4:        sample.conf
1f9f004
Source5:        tgtd.conf
cebdd1c
Patch0:         0001-redhatify-docs.patch
cebdd1c
Patch1:         0002-remove-check-for-xsltproc.patch
cebdd1c
Patch2:         0003-default-config.patch
731a183
Patch3:         0004-Fix-libs-for-current-systemd-linker-name.patch
3a5b6ad
4350be4
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
4350be4
f54d0da
BuildRequires:  pkgconfig libxslt docbook-style-xsl systemd-units libaio-devel systemd-devel
24fb4a4
%if 0%{?with_rdma}
f54d0da
BuildRequires:  libibverbs-devel librdmacm-devel
2dffac8
Requires:       libibverbs librdmacm
4d28ff9
%endif
ae1e3ed
Requires: lsof sg3_utils
ae144d8
Requires(post): systemd-units
4350be4
4350be4
%description
4350be4
The SCSI target package contains the daemon and tools to setup a SCSI targets.
4350be4
Currently, software iSCSI targets are supported.
4350be4
158f9e2
8e3dfc6
%if 0%{?with_rbd}
cebdd1c
%package rbd
cebdd1c
Summary:        Support for the Ceph rbd backstore to scsi-target-utils
cebdd1c
Group:          System Environment/Daemons
cebdd1c
BuildRequires: ceph-devel
cebdd1c
Requires: %{name}%{?_isa} = %{version}-%{release}
cebdd1c
cebdd1c
%description rbd
cebdd1c
Adds support for the Ceph rbd backstore to scsi-target-utils.
8e3dfc6
%endif
cebdd1c
cebdd1c
efe3e95
%if 0%{?with_glfs}
158f9e2
%package gluster
158f9e2
Summary:        Support for the Gluster backstore to scsi-target-utils
158f9e2
Group:          System Environment/Daemons
158f9e2
BuildRequires: glusterfs-api-devel
158f9e2
Requires: %{name}%{?_isa} = %{version}-%{release}
158f9e2
158f9e2
%description gluster
158f9e2
Adds support for the Gluster glfs backstore to scsi-target-utils.
efe3e95
%endif
158f9e2
8e3dfc6
4350be4
%prep
3c30fa7
%setup -q -n %{oname}-%{version}
9373fe8
%patch0 -p1
9373fe8
%patch1 -p1
1f9f004
%patch2 -p1
731a183
%patch3 -p1
4350be4
158f9e2
4350be4
%build
f5bef55
%{__sed} -i -e 's|-g -O2 -Wall|%{optflags}|' Makefile
aaa0071
%{__make} %{?_smp_mflags} %{?with_rdma:ISCSI_RDMA=1} %{?with_rbd:CEPH_RBD=1} %{?with_glfs:GLFS_BD=1} SD_NOTIFY=1 libdir=%{_libdir}/tgt
3a5b6ad
4350be4
4350be4
%install
4350be4
%{__rm} -rf %{buildroot}
4350be4
%{__install} -d %{buildroot}%{_sbindir}
4f269f9
%{__install} -d %{buildroot}%{_mandir}/man5
4350be4
%{__install} -d %{buildroot}%{_mandir}/man8
ae144d8
%{__install} -d %{buildroot}%{_unitdir}
2980c24
%{__install} -d %{buildroot}%{_sysconfdir}/tgt
fe43e53
%{__install} -d %{buildroot}%{_sysconfdir}/tgt/conf.d
2980c24
%{__install} -d %{buildroot}%{_sysconfdir}/sysconfig
4350be4
3a5b6ad
%{__install} -p -m 0755 scripts/tgt-setup-lun %{buildroot}%{_sbindir}
ae144d8
%{__install} -p -m 0755 %{SOURCE1} %{buildroot}%{_unitdir}
f7f8aec
%{__install} -p -m 0755 scripts/tgt-admin %{buildroot}/%{_sbindir}/tgt-admin
4f269f9
%{__install} -p -m 0644 doc/manpages/targets.conf.5 %{buildroot}/%{_mandir}/man5
4350be4
%{__install} -p -m 0644 doc/manpages/tgtadm.8 %{buildroot}/%{_mandir}/man8
f7f8aec
%{__install} -p -m 0644 doc/manpages/tgt-admin.8 %{buildroot}/%{_mandir}/man8
3a5b6ad
%{__install} -p -m 0644 doc/manpages/tgt-setup-lun.8 %{buildroot}/%{_mandir}/man8
2980c24
%{__install} -p -m 0600 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/tgtd
2980c24
%{__install} -p -m 0600 %{SOURCE3} %{buildroot}%{_sysconfdir}/tgt
fe43e53
%{__install} -p -m 0600 %{SOURCE4} %{buildroot}%{_sysconfdir}/tgt/conf.d
1f9f004
%{__install} -p -m 0600 %{SOURCE5} %{buildroot}%{_sysconfdir}/tgt
f7f8aec
4350be4
pushd usr
aaa0071
%{__make} install %{?with_rdma:ISCSI_RDMA=1} %{?with_rbd:CEPH_RBD=1} %{?with_glfs:GLFS_BD=1} SD_NOTIFY=1 DESTDIR=%{buildroot} sbindir=%{_sbindir} libdir=%{_libdir}/tgt
4350be4
4350be4
%post
158f9e2
%systemd_post tgtd.service
4350be4
4350be4
%preun
158f9e2
%systemd_preun tgtd.service
ae144d8
ae144d8
%postun
158f9e2
# don't restart daemon on upgrade
158f9e2
%systemd_postun
3a5b6ad
4350be4
%clean
4350be4
%{__rm} -rf %{buildroot}
4350be4
3a5b6ad
4350be4
%files
cebdd1c
%doc README doc/README.iscsi doc/README.iser doc/README.lu_configuration doc/README.mmc doc/README.ssc
4350be4
%{_sbindir}/tgtd
4350be4
%{_sbindir}/tgtadm
a9a1f1e
%{_sbindir}/tgt-setup-lun
f7f8aec
%{_sbindir}/tgt-admin
d7642b1
%{_sbindir}/tgtimg
4f269f9
%{_mandir}/man5/*
4350be4
%{_mandir}/man8/*
ae144d8
%{_unitdir}/tgtd.service
2980c24
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/tgtd
2980c24
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/tgt/targets.conf
1f9f004
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/tgt/tgtd.conf
fe43e53
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/tgt/conf.d/sample.conf
3a5b6ad
8e3dfc6
%if 0%{?with_rbd}
cebdd1c
%files rbd
cebdd1c
%{_libdir}/tgt/backing-store/bs_rbd.so
cebdd1c
%doc doc/README.rbd
8e3dfc6
%endif
cebdd1c
efe3e95
%if 0%{?with_glfs}
158f9e2
%files gluster
158f9e2
%{_libdir}/tgt/backing-store/bs_glfs.so
158f9e2
%doc doc/README.glfs
efe3e95
%endif
4350be4
4350be4
%changelog
f54d0da
* Mon Feb 16 2015 Andy Grover <agrover@redhat.com> - 1.0.55-2
f54d0da
- Fix for #1193043, make BuildDep on systemd-devel unconditional
f54d0da
731a183
* Tue Feb 10 2015 Andy Grover <agrover@redhat.com> - 1.0.55-1
731a183
- New upstream version
731a183
8e72c10
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.48-3
8e72c10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
8e72c10
c012b0a
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.48-2
c012b0a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c012b0a
aaa0071
* Mon Jun 2 2014 Andy Grover <agrover@redhat.com> - 1.0.48-1
aaa0071
- New upstream version
aaa0071
- Add systemd sd_notify support
aaa0071
efe3e95
* Thu Apr 17 2014 Andy Grover <agrover@redhat.com> - 1.0.46-3
efe3e95
- Add switches to easily build w/o fancy backstores
8e3dfc6
158f9e2
* Fri Apr 4 2014 Andy Grover <agrover@redhat.com> - 1.0.46-1
158f9e2
- New upstream version
158f9e2
- Add support for gluster backend
158f9e2
- Use systemd scriptlets
158f9e2
317a60a
* Mon Feb 3 2014 Andy Grover <agrover@redhat.com> - 1.0.44-1
317a60a
- New upstream version
317a60a
184fe6a
* Mon Dec 2 2013 Andy Grover <agrover@redhat.com> - 1.0.42-1
184fe6a
- New upstream version
184fe6a
baf6a75
* Fri Nov 1 2013 Andy Grover <agrover@redhat.com> - 1.0.41-1
baf6a75
- New upstream version
baf6a75
- Remove patches:
baf6a75
  * fix-no-module-build.patch
baf6a75
  * usr-Makefile-fix-typo-in-bs_aio-so-filename.patch
baf6a75
- Disable aio in a subpackage
baf6a75
cebdd1c
* Fri Oct 4 2013 Andy Grover <agrover@redhat.com> - 1.0.40-1
cebdd1c
- New upstream version
cebdd1c
- Break out Ceph (bs_rbd) support into a subpackage
cebdd1c
- Repackage patches based on git
cebdd1c
- Add patches:
cebdd1c
  * fix-no-module-build.patch
cebdd1c
  * usr-Makefile-fix-typo-in-bs_aio-so-filename.patch
cebdd1c
- Fix some weird date issues in changelog
cebdd1c
- Enable aio in a subpackage
cebdd1c
- Remove defattrs from file sections
cebdd1c
8ca24e4
* Tue Sep 3 2013 Andy Grover <agrover@redhat.com> - 1.0.39-1
8ca24e4
- New upstream version
8ca24e4
- Move with_rbd outside ifnarch, and add comment
8ca24e4
a90025e
* Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 1.0.38-2
a90025e
- Perl 5.18 rebuild
a90025e
47023ea
* Wed Jul 31  2013 Andy Grover <agrover@redhat.com> - 1.0.38-1
47023ea
- New upstream version
47023ea
f7012b8
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 1.0.32-6
f7012b8
- Perl 5.18 rebuild
f7012b8
5de1dd1
* Wed Apr 10 2013 Andy Grover <agrover@redhat.com> - 1.0.32-5
5de1dd1
- Fix ExecStartPost line in tgtd.service to have full path
5de1dd1
3a25fe7
* Mon Mar 25 2013 Andy Grover <agrover@redhat.com> - 1.0.32-4
3a25fe7
- Add workaround fo BZ 848942.
3a25fe7
5681bcd
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.32-3
5681bcd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
5681bcd
3c30fa7
58b0a09
* Wed Nov  7 2012 Pádraig Brady <P@draigBrady.com> - 1.0.32-2
58b0a09
- Fix `tgt-admin --update` so that it uses /etc/tgt/tgtd.conf
58b0a09
58b0a09
* Mon Oct 15 2012 Andy Grover <agrover@redhat> - 1.0.32-1
3c30fa7
- New upstream version
3c30fa7
- Change .spec for new download.tgz format
3c30fa7
1f9f004
* Thu Sep 27 2012 Pádraig Brady <P@draigBrady.com> - 1.0.30-4
1f9f004
- Allow config files to include (all files from) directories
1f9f004
- Support conf.d/ on upgrade even with modified targets.conf
1f9f004
fe43e53
* Tue Aug 7 2012 Andy Grover <agrover@redhat.com> - 1.0.30-3
2af989c
- Add /etc/tgt/conf.d directory, and move samples from targets.conf
2af989c
  into conf.d/samples.conf. See #643302, thanks ssato@redhat.com.
fe43e53
a385212
* Mon Aug 6 2012 Andy Grover <agrover@redhat.com> - 1.0.30-2
a385212
- Fix typo in service file
a385212
2dffac8
* Thu Aug 2 2012 Andy Grover <agrover@redhat.com> - 1.0.30-1
2dffac8
- New upstream release
2dffac8
- Refresh patches
2dffac8
- Drop separate package for iser
2dffac8
b7ce60e
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.24-3
b7ce60e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
b7ce60e
fd7a806
* Wed Feb 1 2012 Andy Grover <agrover@redhat.com> - 1.0.24-1
fd7a806
- New upstream release
fd7a806
8cad325
* Tue Jan 3 2012 Andy Grover <agrover@redhat.com> - 1.0.23-1
8cad325
- New upstream release
8cad325
24fb4a4
* Tue Dec 20 2011 Dan Horák <dan[at]danny.cz> - 1.0.22-4
24fb4a4
- fix build on s390(x) by introducing new conditional
24fb4a4
fa03c86
* Thu Dec 15 2011 Andy Grover <agrover@redhat.com> - 1.0.22-3
fa03c86
- Fix leftover fcoe references
fa03c86
ae144d8
* Thu Dec 15 2011 Andy Grover <agrover@redhat.com> - 1.0.22-2
ae144d8
- Convert to systemd init (based on fcoe-utils.spec)
ae144d8
- Correct arch excludes for subpackage only
ae144d8
377ad4a
* Sat Dec 3 2011 Andy Grover <agrover@redhat.com> - 1.0.22-1
377ad4a
- New upstream release
377ad4a
- Remove patch scsi-target-utils-hack-check-for-eventfd.patch,
377ad4a
    upstream now checks for eventfd support
377ad4a
- Refresh scsi-target-utils-dynamic-link-iser.patch
377ad4a
- Refresh scsi-target-utils-remove-xsltproc-check.patch
377ad4a
6ed9dea
* Thu Nov 3 2011 Andy Grover <agrover@redhat.com> - 1.0.21-5
6ed9dea
- iser subpackage requires base package
6ed9dea
6ed9dea
* Thu Nov 3 2011 Andy Grover <agrover@redhat.com> - 1.0.21-4
6ed9dea
- Break out iser into a separate subpackage
6ed9dea
2128201
* Wed Nov 2 2011 Andy Grover <agrover@redhat.com> - 1.0.21-3
2128201
- Use local stylesheets for manpage generation
2128201
4f269f9
* Wed Nov 2 2011 Andy Grover <agrover@redhat.com> - 1.0.21-2
4f269f9
- Include targets.conf.5 manpage in pkg
4f269f9
- Add libxslt as buildrequire for xsltproc (manpage generation)
4f269f9
e9a3808
* Wed Nov 2 2011 Andy Grover <agrover@redhat.com> - 1.0.21-1
4f269f9
- New upstream version
e9a3808
  - Refresh dynamic-link-iser.patch
e9a3808
  - Remove upstreamed fix-segfault-on-exit.patch
e9a3808
ae1e3ed
* Tue Oct 25 2011 Andy Grover <agrover@redhat.com> - 1.0.20-2
ae1e3ed
- Add missing requires lsof and sg3_utils
ae1e3ed
d7e508b
* Tue Oct 4 2011 Andy Grover <agrover@redhat.com> - 1.0.20-1
d7e508b
- New upstream version
d7e508b
  * New file location on Github
d7e508b
  * Update dynamic-link-iser.patch
d7e508b
- ISCSI=1 make param no longer needed, removed
d7e508b
4b8e4f5
* Thu Sep 29 2011 Andy Grover <agrover@redhat.com> - 1.0.18-2
f69ecab
- Add patch
f69ecab
  * scsi-target-utils-fix-segfault-on-exit.patch
f69ecab
dbf158b
* Wed Jun 29 2011 Andy Grover <agrover@redhat.com> - 1.0.18-1
dbf158b
- Update to new upstream release
dbf158b
- Remove git-sync patch
dbf158b
4d28ff9
* Fri Apr 29 2011 Dan Horák <dan[at]danny.cz> - 1.0.14-3
4d28ff9
- no InfiniBand on s390(x)
4d28ff9
9373fe8
* Thu Mar 17 2011 Andy Grover <agrover@redhat.com> - 1.0.14-2
9373fe8
- Add git-sync patch to get up to 9c1cd78.
9373fe8
0b68e2b
* Thu Mar 17 2011 Andy Grover <agrover@redhat.com> - 1.0.14-1
0b68e2b
- Update to new upstream release
0b68e2b
cf2145c
* Tue Feb 22 2011 Andy Grover <agrover@redhat.com> - 1.0.13-1
cf2145c
- Update to new upstream release
cf2145c
  - Drop merged snprintf-fix and fix-isns-of patches
cf2145c
  - Update dynamic-link-iser patch for new iser module
cf2145c
  - Small fixes to redhatify-docs
cf2145c
9e1d773
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-5
9e1d773
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
9e1d773
d7c5088
* Tue Jun 29 2010 Mike Christie <mchristie@redhat.com> - 1.0.1-4
d7c5088
- Fix iSNS scn pdu overflows (CVE-2010-2221).
d7c5088
d7c5088
* Thu Apr 8 2010 Mike Christie <mchristi@redhat.com> - 1.0.1-3
d7c5088
- Fix format string vulnerability  (CVE-2010-0743)
d7c5088
f5bef55
* Sun Feb 14 2010 Terje Rosten <terje.rosten@ntnu.no> - 1.0.1-2
f5bef55
- Update iser patch to build with new link rules
f5bef55
- Fix optflags
f5bef55
2980c24
* Sun Jan 24 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> - 1.0.1-1
2980c24
- Update to new upstream release
2980c24
- Upstream moved to Sourceforge
2980c24
- Fix %%preun snippet (#532176)
2980c24
- Start after network service but before iscsid. Prevents failed mounts from localhost at boot.
2980c24
- Replace paths with macros in spec
2980c24
- Add one more doc
2980c24
3a5b6ad
* Mon Dec 21 2009 Hans de Goede <hdegoede@redhat.com> - 0.9.11-1.20091205snap
3a5b6ad
- Rebase to 0.9.11 + some fixes from git (git id
3a5b6ad
  97832d8dcd00202a493290b5d134b581ce20885c)
3a5b6ad
- Rewrite initscript, make it follow:
3a5b6ad
  http://fedoraproject.org/wiki/Packaging/SysVInitScript
3a5b6ad
  And merge in RHEL-5 initscript improvements:
3a5b6ad
  - Parse /etc/tgt/targets.conf, which allows easy configuration of targets
3a5b6ad
  - Better initiator status checking in stop
3a5b6ad
  - Add force-stop, to stop even when initiators are still connected
3a5b6ad
  - Make reload reload configuration from /etc/tgt/targets.conf without
3a5b6ad
    stopping tgtd (but only for unused targets)
3a5b6ad
  - Add force-reload (reloads configs for all targets including busy ones)
3a5b6ad
272437c
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 0.9.5-3
272437c
- rebuilt with new openssl
272437c
12db1f5
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-2
12db1f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
12db1f5
d7642b1
* Mon Mar 16 2009 Terje Rosten <terje.rosten@ntnu.no> - 0.9.5-1
d7642b1
- 0.9.5
d7642b1
- remove patch now upstream
d7642b1
- add patch to fix mising destdir in usr/Makefile
d7642b1
- mktape and dump_tape has moved to tgtimg
d7642b1
- add more docs
d7642b1
dad18be
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-3
d7642b1
- rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
dad18be
349b093
* Sat Jan 17 2009 Tomas Mraz <tmraz@redhat.com> - 0.9.2-2
349b093
- rebuild with new openssl
349b093
8b98403
* Tue Dec 16 2008 Jarod Wilson <jarod@redhat.com> - 0.9.2-1
d7642b1
- update to 0.9.2 release
8b98403
f7f8aec
* Tue Oct 21 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.0-6.20080805snap
d7642b1
- add tgt-admin man page, tgt-admin and tgt-core-test
f7f8aec
a9a1f1e
* Fri Aug 22 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.0-5.20080805snap
a9a1f1e
- update to 20080805 snapshot
a9a1f1e
b79f90a
* Sun Feb 10 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.0-4.20071227snap
b79f90a
- update to 20071227 snapshot
b79f90a
- add patch to compile with newer glibc
b79f90a
cebdd1c
* Sat Feb 9 2008 Terje Rosten <terje.rosten@ntnu.no> - 0.0-3.20070803snap
29febb8
- rebuild
29febb8
cebdd1c
* Fri Dec 7 2007 Alex Lancaster <alexlan[AT]fedoraproject.org> - 0.0-2.20070803snap
d7642b1
- rebuild for new openssl soname bump
d832e58
4350be4
* Wed Sep 26 2007 Terje Rosten <terje.rosten@ntnu.no> - 0.0-1.20070803snap
4350be4
- random cleanup
4350be4
4350be4
* Wed Sep 26 2007 Terje Rosten <terje.rosten@ntnu.no> - 0.0-0.20070803snap
4350be4
- update to 20070803
4350be4
- fix license tag
4350be4
- use date macro
4350be4
- build with correct flags (%%optflags)
4350be4
4350be4
* Tue Jul 10 2007 Mike Christie <mchristie@redhat.com> - 0.0-0.20070620snap
4350be4
- first build