From 0610134445a461b916373cd90e223c9fc844c8db Mon Sep 17 00:00:00 2001 From: Steve Wills Date: Thu, 31 Jan 2019 12:37:45 +0000 Subject: [PATCH] sysutils/smartmontools: update to 7.0 PR: 234562 Submitted by: samm@os2.kiev.ua (maintainer) --- sysutils/smartmontools/Makefile | 6 +-- sysutils/smartmontools/distinfo | 6 +-- sysutils/smartmontools/files/patch-configure | 11 +++++ .../files/patch-freebsd__nvme__ioctl.h | 13 ----- .../smartmontools/files/patch-os__freebsd.cpp | 49 +++++++++---------- .../files/patch-update-smart-drivedb.in | 29 ----------- 6 files changed, 39 insertions(+), 75 deletions(-) create mode 100644 sysutils/smartmontools/files/patch-configure delete mode 100644 sysutils/smartmontools/files/patch-freebsd__nvme__ioctl.h delete mode 100644 sysutils/smartmontools/files/patch-update-smart-drivedb.in diff --git a/sysutils/smartmontools/Makefile b/sysutils/smartmontools/Makefile index edf89b18ea71..c00ef92ac2b6 100644 --- a/sysutils/smartmontools/Makefile +++ b/sysutils/smartmontools/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= smartmontools -PORTVERSION= 6.6 -PORTREVISION= 3 +PORTVERSION= 7.0 CATEGORIES= sysutils MASTER_SITES= SF @@ -13,11 +12,12 @@ COMMENT= S.M.A.R.T. disk monitoring tools LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING +USES= alias compiler:c++11-lib gmake shebangfix + CONFLICTS= smartmontools-devel-[0-9]* OPTIONS_DEFINE= DOCS -USES= alias compiler:c++11-lib gmake shebangfix SHEBANG_FILES= examplescripts/Example5 GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-dependency-tracking \ diff --git a/sysutils/smartmontools/distinfo b/sysutils/smartmontools/distinfo index 84db22c1d8ed..e5334da3d31c 100644 --- a/sysutils/smartmontools/distinfo +++ b/sysutils/smartmontools/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1509917610 -SHA256 (smartmontools-6.6.tar.gz) = 51f43d0fb064fccaf823bbe68cf0d317d0895ff895aa353b3339a3b316a53054 -SIZE (smartmontools-6.6.tar.gz) = 903847 +TIMESTAMP = 1546416586 +SHA256 (smartmontools-7.0.tar.gz) = e5e1ac2786bc87fdbd6f92d0ee751b799fbb3e1a09c0a6a379f9eb64b3e8f61c +SIZE (smartmontools-7.0.tar.gz) = 944925 diff --git a/sysutils/smartmontools/files/patch-configure b/sysutils/smartmontools/files/patch-configure new file mode 100644 index 000000000000..c78ab48cfe74 --- /dev/null +++ b/sysutils/smartmontools/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig 2018-12-30 14:49:08 UTC ++++ configure +@@ -6891,7 +6891,7 @@ case "${host}" in + *-*-freebsd*|*-*-dragonfly*|*-*-kfreebsd*-gnu*) + os_deps='os_freebsd.o cciss.o dev_areca.o' + os_libs='-lcam -lsbuf' +- os_dltools='curl wget lynx fetch svn' ++ os_dltools='fetch curl wget lynx svn' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb20_dev_get_device_desc in -lusb" >&5 + $as_echo_n "checking for libusb20_dev_get_device_desc in -lusb... " >&6; } + if ${ac_cv_lib_usb_libusb20_dev_get_device_desc+:} false; then : diff --git a/sysutils/smartmontools/files/patch-freebsd__nvme__ioctl.h b/sysutils/smartmontools/files/patch-freebsd__nvme__ioctl.h deleted file mode 100644 index d66e0193b2d0..000000000000 --- a/sysutils/smartmontools/files/patch-freebsd__nvme__ioctl.h +++ /dev/null @@ -1,13 +0,0 @@ ---- freebsd_nvme_ioctl.h.orig 2017-09-20 10:34:38.000000000 -0700 -+++ freebsd_nvme_ioctl.h 2018-02-22 23:04:32.250104000 -0800 -@@ -148,8 +148,10 @@ - #include - #endif - -+#if __FreeBSD_version < 1200058 - #define nvme_completion_is_error(cpl) \ - ((cpl)->status.sc != 0 || (cpl)->status.sct != 0) -+#endif - - #define NVME_CTRLR_PREFIX "/dev/nvme" - #define NVME_NS_PREFIX "ns" diff --git a/sysutils/smartmontools/files/patch-os__freebsd.cpp b/sysutils/smartmontools/files/patch-os__freebsd.cpp index 1418f1925d51..ff28e86e220e 100644 --- a/sysutils/smartmontools/files/patch-os__freebsd.cpp +++ b/sysutils/smartmontools/files/patch-os__freebsd.cpp @@ -1,32 +1,19 @@ ---- os_freebsd.cpp.orig 2017-04-24 09:34:16.000000000 -0700 -+++ os_freebsd.cpp 2018-02-27 19:15:54.338861000 +0000 -@@ -16,6 +16,8 @@ +Index: os_freebsd.cpp +=================================================================== +--- os_freebsd.cpp.orig 2018-12-05 18:30:46 UTC ++++ os_freebsd.cpp +@@ -9,6 +9,7 @@ */ - #include + #include +#include -+#include + #include #include #include - #include -@@ -484,7 +486,7 @@ - } - nsid = 0xFFFFFFFF; // broadcast id - } -- else if (sscanf(dev, NVME_CTRLR_PREFIX"%d"NVME_NS_PREFIX"%d%c", -+ else if (sscanf(dev, NVME_CTRLR_PREFIX"%d" NVME_NS_PREFIX "%d%c", - &ctrlid, &nsid, &tmp) == 2) - { - if(ctrlid < 0 || nsid < 0) { -@@ -521,16 +523,20 @@ - struct nvme_pt_command pt; - memset(&pt, 0, sizeof(pt)); - -+#if __FreeBSD_version >= 1200058 && __FreeBSD_version < 1200081 -+ pt.cmd.opc_fuse = NVME_CMD_SET_OPC(in.opcode); -+#else +@@ -522,29 +523,29 @@ bool freebsd_nvme_device::nvme_pass_through(const nvme + pt.cmd.opc = in.opcode; + #endif pt.cmd.opc = in.opcode; -+#endif - pt.cmd.nsid = in.nsid; + pt.cmd.nsid = htole32(in.nsid); pt.buf = in.buffer; @@ -46,13 +33,21 @@ pt.is_read = 1; // should we use in.direction()? int status = ioctl(get_fd(), NVME_PASSTHROUGH_CMD, &pt); -@@ -538,6 +544,9 @@ + if (status < 0) return set_err(errno, "NVME_PASSTHROUGH_CMD: %s", strerror(errno)); - +- +#if __FreeBSD_version >= 1200058 + nvme_completion_swapbytes(&pt.cpl); +#endif - out.result=pt.cpl.cdw0; // Command specific result (DW0) + cp_p = &pt.cpl; + out.result=cp_p->cdw0; // Command specific result (DW0) - if (nvme_completion_is_error(&pt.cpl)) + if (nvme_completion_is_error(cp_p)) { /* ignore DNR and More bits */ +- uint16_t nvme_status = ((cp_p->status.sct << 8) | cp_p->status.sc) & 0x3ff; +- +- return set_nvme_err(out, nvme_status); ++ return set_nvme_err(out, nvme_completion_is_error(&pt.cpl)); + } + + return true; diff --git a/sysutils/smartmontools/files/patch-update-smart-drivedb.in b/sysutils/smartmontools/files/patch-update-smart-drivedb.in deleted file mode 100644 index c10bf0f88d69..000000000000 --- a/sysutils/smartmontools/files/patch-update-smart-drivedb.in +++ /dev/null @@ -1,29 +0,0 @@ ---- update-smart-drivedb.in.orig 2016-02-26 23:29:24.000000000 +0300 -+++ update-smart-drivedb.in 2016-05-12 23:07:17.558810000 +0300 -@@ -51,7 +51,8 @@ - -s SMARTCTL Use SMARTCTL for syntax check ('-s -' to disable) - [default: $SMARTCTL] - -t TOOL Use TOOL for download: $os_dltools -- [default: first one found in PATH] -+ [default: fetch, which is always available -+ on FreeBSD.] - -u LOCATION Use URL of LOCATION for download: - sf (Sourceforge code browser via HTTPS) - svn (SVN repository via HTTPS) [default] -@@ -262,14 +263,8 @@ - esac - - if [ -z "$tool" ]; then -- # Find download tool in PATH -- for t in $os_dltools; do -- if inpath "$t"; then -- tool=$t -- break -- fi -- done -- test -n "$tool" || error "found none of: $os_dltools" -+ # Set to fetch by default -+ tool="fetch" - fi - - test -n "$url" || selecturl "svn"