commit 5461e2c22da98a498efee257e0e5a7a526dc957f Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:54:55 2019 -0400 Package init diff --git a/libatasmart-0.19-wd-fix.patch b/libatasmart-0.19-wd-fix.patch new file mode 100644 index 0000000..90062b8 --- /dev/null +++ b/libatasmart-0.19-wd-fix.patch @@ -0,0 +1,26 @@ +Author: Phillip Susi +Subject: fix an incorrect IO error reading SMART status +Description: The read SMART status command's return status + was testing for a success/failure value that included 8 + bits that are "N/A" according to the standard, and required + that they be zeros. At least some drives do not fill them + with zeros, so correct this by masking off the undefined + bits. + +Index: b/atasmart.c +=================================================================== +--- a/atasmart.c ++++ b/atasmart.c +@@ -925,10 +925,10 @@ + /* SAT/USB bridges truncate packets, so we only check for 4F, + * not for 2C on those */ + if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x00C2U)) && +- cmd[4] == htons(0x4F00U)) ++ (cmd[4] & htons(0xFF00U)) == htons(0x4F00U)) + *good = TRUE; + else if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x002CU)) && +- cmd[4] == htons(0xF400U)) ++ (cmd[4] & htons(0xFF00U)) == htons(0xF400U)) + *good = FALSE; + else { + errno = EIO; diff --git a/libatasmart-0.19.tar.xz b/libatasmart-0.19.tar.xz new file mode 100644 index 0000000..88b5117 Binary files /dev/null and b/libatasmart-0.19.tar.xz differ diff --git a/libatasmart.spec b/libatasmart.spec new file mode 100644 index 0000000..a7a1454 --- /dev/null +++ b/libatasmart.spec @@ -0,0 +1,56 @@ +Name: libatasmart +Version: 0.19 +Release: 16 +Summary: ATA S.M.A.R.T. Disk Health Monitoring Library +License: LGPLv2+ +URL: https://github.com/Rupan/libatasmart +Source0: https://0pointer.de/public/libatasmart-%{version}.tar.xz +Patch0: libatasmart-0.19-wd-fix.patch +BuildRequires: gcc systemd-devel + +%description +a lean, small and clean implementation of an ATA S.M.A.R.T. reading and parsing library. + +%package devel +Summary: Development Files for libatasmart Client Development +Requires: %{name} = %{version}-%{release} pkgconfig vala + +%description devel +Development Files for libatasmart Client Development + +%package_help + +%ldconfig_scriptlets + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +%configure +%make_build + +%install +%make_install +%delete_la_and_a + +%files +%defattr(-,root,root) +%doc LGPL +%{_libdir}/*.so.* +%{_sbindir}/* + +%files devel +%defattr(-,root,root) +%{_includedir}/atasmart.h +%{_libdir}/pkgconfig/*.pc +%{_libdir}/*.so +%{_datadir}/vala/*/*.vapi +%exclude %{_docdir}/libatasmart/README + +%files help +%defattr(-,root,root) +%doc README */SAMSUNG* */ST* */Maxtor* */WDC* */FUJITSU* */INTEL* */TOSHIBA* */MCC* + +%changelog +* Mon Sep 2 2019 openEuler Buildteam - 0.19-16 +- Package init