60e6aa
%global rescan_script rescan-scsi-bus.sh
60e6aa
60e6aa
Summary: Utilities for devices that use SCSI command sets
60e6aa
Name: sg3_utils
60e6aa
Version: 1.44
4229cc
Release: 6%{?dist}
60e6aa
License: GPLv2+ and BSD
60e6aa
Group: Applications/System
60e6aa
Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
60e6aa
Source2: scsi-rescan.8
ae6605
Source10: 40-usb-blacklist.rules
ae6605
Source11: 59-fc-wwpn-id.rules
60e6aa
Patch0: BZ_1633235-sg3_utils-1.44-covscan-fix.patch
60e6aa
# https://bugzilla.redhat.com/show_bug.cgi?id=1683343
60e6aa
# sg_turs: improper usage show
60e6aa
Patch1: sg_turs-help.patch
60e6aa
# https://bugzilla.redhat.com/show_bug.cgi?id=1627657
60e6aa
# sg_raw -V fail
60e6aa
Patch2: sg_raw-version.patch
ae6605
# https://bugzilla.redhat.com/show_bug.cgi?id=1760847
ae6605
# FC_TARGET_LUN attribute assigned for non FC device
ae6605
Patch3: fc_wwpn_id-non_FC-devices.patch
4229cc
# https://bugzilla.redhat.com/show_bug.cgi?id=2078107
4229cc
# sg_ses: --page= is incorrectly overridden when --control and --data= are also used
4229cc
Patch4: sg_ses-1.45-page_control_data_args.patch
60e6aa
URL: http://sg.danny.cz/sg/sg3_utils.html
60e6aa
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
ae6605
BuildRequires: systemd
ae6605
60e6aa
60e6aa
60e6aa
%description
60e6aa
Collection of Linux utilities for devices that use the SCSI command set.
60e6aa
Includes utilities to copy data based on "dd" syntax and semantics (called
60e6aa
sg_dd, sgp_dd and sgm_dd); check INQUIRY data and VPD pages (sg_inq); check
60e6aa
mode and log pages (sginfo, sg_modes and sg_logs); spin up and down
60e6aa
disks (sg_start); do self tests (sg_senddiag); and various other functions.
60e6aa
See the README, CHANGELOG and COVERAGE files. Requires the linux kernel 2.4
60e6aa
series or later. In the 2.4 series SCSI generic device names (e.g. /dev/sg0)
60e6aa
must be used. In the 2.6 series other device names may be used as
60e6aa
well (e.g. /dev/sda).
60e6aa
60e6aa
Warning: Some of these tools access the internals of your system
60e6aa
and the incorrect usage of them may render your system inoperable.
60e6aa
60e6aa
%package libs
60e6aa
Summary: Shared library for %{name}
60e6aa
Group: System Environment/Libraries
60e6aa
60e6aa
%description libs
60e6aa
This package contains the shared library for %{name}.
60e6aa
60e6aa
%package devel
60e6aa
Summary: Development library and header files for the sg3_utils library
60e6aa
Group: Development/Libraries
60e6aa
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
60e6aa
60e6aa
%description devel
60e6aa
This package contains the %{name} library and its header files for
60e6aa
developing applications.
60e6aa
60e6aa
%prep
60e6aa
%autosetup -p 1
60e6aa
60e6aa
%build
60e6aa
%configure --disable-static
60e6aa
60e6aa
# Don't use rpath!
60e6aa
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
60e6aa
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
60e6aa
60e6aa
make %{?_smp_mflags}
60e6aa
60e6aa
60e6aa
%install
60e6aa
make install DESTDIR=$RPM_BUILD_ROOT
60e6aa
rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
60e6aa
60e6aa
install -p -m 755 scripts/%{rescan_script} $RPM_BUILD_ROOT%{_bindir}
60e6aa
( cd $RPM_BUILD_ROOT%{_bindir}; ln -sf %{rescan_script} scsi-rescan )
60e6aa
60e6aa
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8
60e6aa
ae6605
# install all extra udev rules
ae6605
mkdir -p $RPM_BUILD_ROOT%{_udevrulesdir}
ae6605
mkdir -p $RPM_BUILD_ROOT/usr/lib/udev
d4489f
install -p -m 644 scripts/55-scsi-sg3_id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/61-scsi-sg3_id.rules
d4489f
install -p -m 644 scripts/58-scsi-sg3_symlink.rules $RPM_BUILD_ROOT%{_udevrulesdir}/63-scsi-sg3_symlink.rules
ae6605
install -p -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_udevrulesdir}
d4489f
install -p -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{_udevrulesdir}/63-fc-wwpn-id.rules
ae6605
install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT/usr/lib/udev
ae6605
60e6aa
60e6aa
%post libs -p /sbin/ldconfig
60e6aa
60e6aa
%postun libs -p /sbin/ldconfig
60e6aa
60e6aa
60e6aa
%files
60e6aa
%doc AUTHORS BSD_LICENSE COPYING COVERAGE CREDITS ChangeLog README README.sg_start
60e6aa
%{_bindir}/*
60e6aa
%{_mandir}/man8/*
d4489f
%{_udevrulesdir}/61-scsi-sg3_id.rules
d4489f
%{_udevrulesdir}/63-scsi-sg3_symlink.rules
d4489f
%{_udevrulesdir}/63-fc-wwpn-id.rules
d4489f
%{_udevrulesdir}/40-usb-blacklist.rules
ae6605
/usr/lib/udev/*
60e6aa
60e6aa
%files libs
60e6aa
%doc BSD_LICENSE COPYING
60e6aa
%{_libdir}/*.so.*
60e6aa
60e6aa
%files devel
60e6aa
%{_includedir}/scsi/*.h
60e6aa
%{_libdir}/*.so
60e6aa
60e6aa
60e6aa
%changelog
4229cc
* Wed Jun 08 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.44-6
4229cc
- Fix sg_ses --page argument override when --control and --data are specified (#2078107)
4229cc
d4489f
* Thu Jan 02 2020 Tomas Bzatek <tbzatek@redhat.com> - 1.44-5
d4489f
- Reorder the udev rules to run after 60-persistent-storage.rules (RHBZ #1785062)
d4489f
ae6605
* Tue Dec 10 2019 Tomas Bzatek <tbzatek@redhat.com> - 1.44-4
ae6605
- Enable supplemental udev rules by default (RHBZ #1746414)
ae6605
60e6aa
* Tue May 28 2019 Tomas Bzatek <tbzatek@redhat.com> - 1.44-3
60e6aa
- Fix sg_turs help invocation in an old mode (#1683343)
60e6aa
- Fix sg_raw printing error about device not specified on version request (#1627657)
60e6aa
60e6aa
* Fri Sep 28 2018 Gris Ge <fge@redhat.com> - 1.44-2
60e6aa
- Fix coverity scan warninings (RHBZ#1633235)
60e6aa
60e6aa
* Tue Sep 18 2018 Gris Ge <fge@redhat.com> - 1.44-1
60e6aa
- Upgrade to 1.44. (RHBZ#1631347)
60e6aa
60e6aa
* Fri Aug 10 2018 Gris Ge <fge@redhat.com> 1.43-0.beta785.1
60e6aa
- Upgrade to 1.43 beta r785.
60e6aa
60e6aa
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-4
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
60e6aa
60e6aa
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-3
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
60e6aa
60e6aa
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-2
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
60e6aa
60e6aa
* Tue Feb 21 2017 Than Ngo <than@redhat.com> - 1.42-1
60e6aa
- bz#1306078, update to 1.42
60e6aa
- bz#1230493, dropped Requires glibc-headers
60e6aa
60e6aa
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.41-4
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
60e6aa
60e6aa
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.41-3
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
60e6aa
60e6aa
* Wed Jul 08 2015 David Sommerseth <davids@redhat.com> - 1.41-1
60e6aa
- updated to version 1.41
60e6aa
- Corrected day/date mismatches in the changelog
60e6aa
60e6aa
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.40-2
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
60e6aa
60e6aa
* Sat Dec 06 2014 Dan Horák <dan@danny.cz> - 1.40-1
60e6aa
- update to version 1.40 (#1164172)
60e6aa
60e6aa
* Wed Sep 03 2014 Dan Horák <dan@danny.cz> - 1.39-1
60e6aa
- update to version 1.39 (#1111893)
60e6aa
60e6aa
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.38-3
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
60e6aa
60e6aa
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.38-2
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
60e6aa
60e6aa
* Fri Apr 18 2014 Dan Horák <dan@danny.cz> - 1.38-1
60e6aa
- update to version 1.38 (#1083995)
60e6aa
- rebuild configure for ppc64le (#1079542)
60e6aa
60e6aa
* Wed Jan 29 2014 Dan Horák <dan@danny.cz> - 1.37-3
60e6aa
- fix various man pages (#948463)
60e6aa
- add man page for the rescan-scsi-bus.sh script
60e6aa
60e6aa
* Fri Oct 18 2013 Dan Horák <dan@danny.cz> - 1.37-2
60e6aa
- include fix for #920687
60e6aa
60e6aa
* Wed Oct 16 2013 Dan Horák <dan@danny.cz> - 1.37-1
60e6aa
- update to version 1.37
60e6aa
- switch to included rescan-scsi-bus script
60e6aa
60e6aa
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.36-2
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
60e6aa
60e6aa
* Thu Jun 06 2013 Dan Horák <dan@danny.cz> - 1.36-1
60e6aa
- update to version 1.36
60e6aa
- modernize spec
60e6aa
60e6aa
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.35-2
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
60e6aa
60e6aa
* Mon Jan 21 2013 Dan Horák <dan@danny.cz> - 1.35-1
60e6aa
- update to version 1.35
60e6aa
60e6aa
* Thu Oct 18 2012 Dan Horák <dan@danny.cz> - 1.34-1
60e6aa
- update to version 1.34
60e6aa
60e6aa
* Fri Sep 14 2012 Dan Horák <dan@danny.cz> - 1.33-4
60e6aa
- add fix for sg3_utils >= 1.32 to the rescan-scsi-bus script
60e6aa
60e6aa
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.33-3
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
60e6aa
60e6aa
* Wed Apr  4 2012 Dan Horák <dan@danny.cz> - 1.33-2
60e6aa
- include rescan-scsi-bus script 1.56
60e6aa
60e6aa
* Tue Apr  3 2012 Dan Horák <dan@danny.cz> - 1.33-1
60e6aa
- update to version 1.33
60e6aa
60e6aa
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.31-2
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
60e6aa
60e6aa
* Fri Feb 18 2011 Dan Horák <dan@danny.cz> - 1.31-1
60e6aa
- update to version 1.31
60e6aa
60e6aa
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.29-3
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
60e6aa
60e6aa
* Thu Jul  8 2010 Dan Horák <dan@danny.cz> - 1.29-2
60e6aa
- added license texts into -libs subpackage
60e6aa
60e6aa
* Mon Apr 12 2010 Dan Horák <dan@danny.cz> - 1.29-1
60e6aa
- update to version 1.29
60e6aa
60e6aa
* Thu Jan 14 2010 Dan Horák <dan@danny.cz> - 1.28-2
60e6aa
- include rescan-scsi-bus script 1.35
60e6aa
- rebase patches and add fix for issue mentioned in #538787
60e6aa
60e6aa
* Thu Oct 22 2009 Dan Horák <dan@danny.cz> - 1.28-1
60e6aa
- update to version 1.28
60e6aa
- added fixes from RHEL to rescan-scsi-bus.sh
60e6aa
- added scsi-rescan symlink to the rescan-scsi-bus.sh script
60e6aa
60e6aa
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.27-2
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
60e6aa
60e6aa
* Tue Apr 28 2009 Dan Horák <dan@danny.cz> - 1.27-1
60e6aa
- update to version 1.27
60e6aa
- changelog: http://sg.danny.cz/sg/p/sg3_utils.ChangeLog
60e6aa
60e6aa
* Tue Mar 31 2009 Dan Horák <dan@danny.cz> - 1.26-4
60e6aa
- add dependency between the libs subpackage and the main package (#492921)
60e6aa
60e6aa
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.26-3
60e6aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
60e6aa
60e6aa
* Mon Nov  3 2008 Dan Horák <dan@danny.cz> - 1.26-2
60e6aa
- update URL
60e6aa
- include rescan-scsi-bus script 1.29
60e6aa
60e6aa
* Mon Jun 30 2008 Dan Horák <dan@danny.cz> - 1.26-1
60e6aa
- update to upstream version 1.26
60e6aa
60e6aa
* Fri Mar 28 2008 Phil Knirsch <pknirsch@redhat.com> - 1.25-4
60e6aa
- Dropped really unnecessary Provides of sg_utils (#226414)
60e6aa
- Use --disable-static in configure (#226414)
60e6aa
60e6aa
* Thu Mar 27 2008 Phil Knirsch <pknirsch@redhat.com> - 1.25-3
60e6aa
- Specfile cleanup, removal of static development libraries (#226414)
60e6aa
60e6aa
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.25-2
60e6aa
- Autorebuild for GCC 4.3
60e6aa
60e6aa
* Mon Oct 22 2007 Phil Knirsch <pknirsch@redhat.com> - 1.25-1
60e6aa
- Fixed URLs
60e6aa
- Updated to sg3_utils-1.25
60e6aa
60e6aa
* Thu Aug 16 2007 Phil Knirsch <pknirsch@redhat.com> - 1.23-2
60e6aa
- License review and update
60e6aa
60e6aa
* Fri Feb 02 2007 Phil Knirsch <pknirsch@redhat.com> - 1.23-1
60e6aa
- Update to sg3_utils-1.23
60e6aa
- Updated summary
60e6aa
60e6aa
* Mon Nov 13 2006 Phil Knirsch <pknirsch@redhat.com> - 1.22-1
60e6aa
- Update to sg3_utils-1.22
60e6aa
60e6aa
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.20-2.1
60e6aa
- rebuild
60e6aa
60e6aa
* Wed Jun 07 2006 Phil Knirsch <pknirsch@redhat.com> - 1.20-2
60e6aa
- Fixed rebuild problem on latest toolchain
60e6aa
- Added missing buildprereqs
60e6aa
60e6aa
* Fri May 19 2006 Phil Knirsch <pknirsch@redhat.com> - 1.20-1
60e6aa
- Update to sg3_utils-1.20.
60e6aa
60e6aa
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.19-1.1
60e6aa
- bump again for double-long bug on ppc(64)
60e6aa
60e6aa
* Fri Feb 10 2006 Phil Knirsch <pknirsch@redhat.com> - 1.19-1
60e6aa
- Update to sg3_utils-1.19.
60e6aa
- Fixed rebuild problem on 64bit archs.
60e6aa
60e6aa
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.17-1.1
60e6aa
- rebuilt for new gcc4.1 snapshot and glibc changes
60e6aa
60e6aa
* Mon Nov 07 2005 Phil Knirsch <pknirsch@redhat.com> 1.17-1
60e6aa
- Update to sg3-utils-1.17
60e6aa
- Split package up into 3 subpackages: sg3_utils, devel and libs
60e6aa
- Some minor updates to the specfile
60e6aa
60e6aa
* Wed Mar 02 2005 Phil Knirsch <pknirsch@redhat.com> 1.06-5
60e6aa
- bump release and rebuild with gcc 4
60e6aa
60e6aa
* Fri Feb 18 2005 Phil Knirsch <pknirsch@redhat.com> 1.06-4
60e6aa
- rebuilt
60e6aa
60e6aa
* Tue Aug 03 2004 Phil Knirsch <pknirsch@redhat.com> 1.06-3
60e6aa
- rebuilt
60e6aa
60e6aa
* Thu Mar 11 2004 Tim Powers <timp@redhat.com> 1.06-2
60e6aa
- rebuild
60e6aa
60e6aa
* Wed Feb 18 2004 Phil Knirsch <pknirsch@redhat.com> 1.06-1
60e6aa
- Initial version for RHEL3 U2.
60e6aa
60e6aa
* Fri Jan 09 2004 - dgilbert@interlog.com
60e6aa
- sg3_utils.spec for mandrake; more sginfo work, sg_scan, sg_logs
60e6aa
  * sg3_utils-1.06
60e6aa
60e6aa
* Wed Nov 12 2003 - dgilbert@interlog.com
60e6aa
- sg_readcap: sizes; sg_logs: double fetch; sg_map 256 sg devices; sginfo
60e6aa
  * sg3_utils-1.05
60e6aa
60e6aa
* Tue May 13 2003 - dgilbert@interlog.com
60e6aa
- default sg_turs '-n=' to 1, sg_logs gets '-t' for temperature, CREDITS
60e6aa
  * sg3_utils-1.04
60e6aa
60e6aa
* Wed Apr 02 2003 - dgilbert@interlog.com
60e6aa
- 6 byte CDBs for sg_modes, sg_start on block devs, sg_senddiag, man pages
60e6aa
  * sg3_utils-1.03
60e6aa
60e6aa
* Wed Jan 01 2003 - dgilbert@interlog.com
60e6aa
- interwork with block SG_IO, fix in sginfo, '-t' for sg_turs
60e6aa
  * sg3_utils-1.02
60e6aa
60e6aa
* Wed Aug 14 2002 - dgilbert@interlog.com
60e6aa
- raw switch in sg_inq
60e6aa
  * sg3_utils-1.01
60e6aa
60e6aa
* Sun Jul 28 2002 - dgilbert@interlog.com
60e6aa
- decode sg_logs pages, add dio to sgm_dd, drop "gen=1" arg, "of=/dev/null"
60e6aa
  * sg3_utils-1.00
60e6aa
60e6aa
* Sun Mar 17 2002 - dgilbert@interlog.com
60e6aa
- add sg_modes+sg_logs for sense pages, expand sg_inq, add fua+sync to sg_dd++
60e6aa
  * sg3_utils-0.99
60e6aa
60e6aa
* Sat Feb 16 2002 - dgilbert@interlog.com
60e6aa
- resurrect sg_reset; snprintf cleanup, time,gen+cdbsz args to sg_dd++
60e6aa
  * sg3_utils-0.98
60e6aa
60e6aa
* Sun Dec 23 2001 - dgilbert@interlog.com
60e6aa
- move isosize to archive directory; now found in util-linux-2.10s and later
60e6aa
  * sg3_utils-0.97
60e6aa
60e6aa
* Fri Dec 21 2001 - dgilbert@interlog.com
60e6aa
- add sgm_dd, sg_read, sg_simple4 and sg_simple16 [add mmap-ed IO support]
60e6aa
  * sg3_utils-0.96
60e6aa
60e6aa
* Sat Sep 15 2001 - dgilbert@interlog.com
60e6aa
- sg_map can do inquiry; sg_dd, sgp_dd + sgq_dd dio help
60e6aa
  * sg3_utils-0.95
60e6aa
60e6aa
* Thu Apr 19 2001 - dgilbert@interlog.com
60e6aa
- add sg_start, improve sginfo and sg_map [Kurt Garloff]
60e6aa
  * sg3_utils-0.94
60e6aa
60e6aa
* Mon Mar 5 2001 - dgilbert@interlog.com
60e6aa
- add scsi_devfs_scan, add sg_include.h, 'coe' more general in sgp_dd
60e6aa
  * sg3_utils-0.93
60e6aa
60e6aa
* Tue Jan 16 2001 - dgilbert@interlog.com
60e6aa
- clean sg_err.h include dependencies, bug fixes, Makefile in archive directory
60e6aa
  * sg3_utils-0.92
60e6aa
60e6aa
* Thu Dec 21 2000 - dgilbert@interlog.com
60e6aa
- signals for sg_dd, man pages and additions for sg_rbuf and isosize
60e6aa
  * sg3_utils-0.91
60e6aa
60e6aa
* Mon Dec 11 2000 - dgilbert@interlog.com
60e6aa
- Initial creation of package, containing
60e6aa
  * sg3_utils-0.90