diff --git a/scsi-rescan.8 b/scsi-rescan.8 new file mode 100644 index 0000000000000000000000000000000000000000..7252653949d56000a0d07950a3f47e3eab15fa22 --- /dev/null +++ b/scsi-rescan.8 @@ -0,0 +1 @@ +.so man8/rescan-scsi-bus.sh.8 diff --git a/sg3_utils-1.47.tar.xz b/sg3_utils-1.47.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..f52f9c408ac6d3386d70bd2979f5764b3cd549fb Binary files /dev/null and b/sg3_utils-1.47.tar.xz differ diff --git a/sg3_utils.spec b/sg3_utils.spec new file mode 100644 index 0000000000000000000000000000000000000000..fbc22e47cc17712ab787f50c45889f542037a987 --- /dev/null +++ b/sg3_utils.spec @@ -0,0 +1,103 @@ +%define anolis_release 1 +%global rescan_script rescan-scsi-bus.sh + +Summary: Utilities for devices that use SCSI command sets +Name: sg3_utils +Version: 1.47 +Release: %{anolis_release}%{?dist} +License: GPLv2+ and BSD +Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz +Source2: scsi-rescan.8 + +URL: http://sg.danny.cz/sg/sg3_utils.html +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +BuildRequires: make +BuildRequires: gcc +BuildRequires: systemd + + +%description +Collection of Linux utilities for devices that use the SCSI command set. +Includes utilities to copy data based on "dd" syntax and semantics (called +sg_dd, sgp_dd and sgm_dd); check INQUIRY data and VPD pages (sg_inq); check +mode and log pages (sginfo, sg_modes and sg_logs); spin up and down +disks (sg_start); do self tests (sg_senddiag); and various other functions. +See the README, CHANGELOG and COVERAGE files. Requires the linux kernel 2.4 +series or later. In the 2.4 series SCSI generic device names (e.g. /dev/sg0) +must be used. In the 2.6 series other device names may be used as +well (e.g. /dev/sda). + +Warning: Some of these tools access the internals of your system +and the incorrect usage of them may render your system inoperable. + +%package libs +Summary: Shared library for %{name} + +%description libs +This package contains the shared library for %{name}. + +%package devel +Summary: Development library and header files for the sg3_utils library +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +This package contains the %{name} library and its header files for +developing applications. + +%prep +%autosetup -p 1 + +%build +%configure --disable-static + +# Don't use rpath! +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +%make_build + + +%install +%make_install +rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la + +install -p -m 755 scripts/%{rescan_script} $RPM_BUILD_ROOT%{_bindir} +( cd $RPM_BUILD_ROOT%{_bindir}; ln -sf %{rescan_script} scsi-rescan ) + +install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8 + +# install all extra udev rules +mkdir -p $RPM_BUILD_ROOT%{_udevrulesdir} +mkdir -p $RPM_BUILD_ROOT/usr/lib/udev +install -p -m 644 scripts/40-usb-blacklist.rules $RPM_BUILD_ROOT%{_udevrulesdir} +# need to run after 60-persistent-storage.rules +install -p -m 644 scripts/55-scsi-sg3_id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/61-scsi-sg3_id.rules +# need to run after 62-multipath.rules +install -p -m 644 scripts/58-scsi-sg3_symlink.rules $RPM_BUILD_ROOT%{_udevrulesdir}/63-scsi-sg3_symlink.rules +install -p -m 644 scripts/59-scsi-cciss_id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/65-scsi-cciss_id.rules +install -p -m 644 scripts/59-fc-wwpn-id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/63-fc-wwpn-id.rules +install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT/usr/lib/udev + +%files +%doc AUTHORS BSD_LICENSE COPYING COVERAGE CREDITS ChangeLog README README.sg_start +%{_bindir}/* +%{_mandir}/man8/* +%{_udevrulesdir}/61-scsi-sg3_id.rules +%{_udevrulesdir}/63-scsi-sg3_symlink.rules +%{_udevrulesdir}/63-fc-wwpn-id.rules +%{_udevrulesdir}/65-scsi-cciss_id.rules +%{_udevrulesdir}/40-usb-blacklist.rules +/usr/lib/udev/fc_wwpn_id + +%files libs +%doc BSD_LICENSE COPYING +%{_libdir}/*.so.* + +%files devel +%{_includedir}/scsi/*.h +%{_libdir}/*.so + + +%changelog +* Fri Mar 11 2022 Chunmei Xu - 1.47-1 +- init from upstream 1.47