| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com> |
| 3 | ;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr> |
| 4 | ;;; Copyright © 2021 Noisytoot <noisytoot@disroot.org> |
| 5 | ;;; |
| 6 | ;;; This file is part of GNU Guix. |
| 7 | ;;; |
| 8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 9 | ;;; under the terms of the GNU General Public License as published by |
| 10 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 11 | ;;; your option) any later version. |
| 12 | ;;; |
| 13 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | ;;; GNU General Public License for more details. |
| 17 | ;;; |
| 18 | ;;; You should have received a copy of the GNU General Public License |
| 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | (define-module (gnu packages scsi) |
| 22 | #:use-module ((guix licenses) |
| 23 | #:select (gpl2+ bsd-2 bsd-3 lgpl2.1+)) |
| 24 | #:use-module (guix packages) |
| 25 | #:use-module (guix download) |
| 26 | #:use-module (guix git-download) |
| 27 | #:use-module (guix build-system gnu) |
| 28 | #:use-module (gnu packages autotools)) |
| 29 | |
| 30 | (define-public sg3-utils |
| 31 | (package |
| 32 | (name "sg3-utils") |
| 33 | (version "1.47") |
| 34 | (source (origin |
| 35 | (method url-fetch) |
| 36 | (uri (string-append "http://sg.danny.cz/sg/p/sg3_utils-" |
| 37 | version ".tar.xz")) |
| 38 | (sha256 |
| 39 | (base32 |
| 40 | "1ckj2kjcs23lbjfyl5mz2rb0aylnyq13yghg0bdv1n7dbywcmc6x")))) |
| 41 | (build-system gnu-build-system) |
| 42 | (arguments |
| 43 | `(#:configure-flags |
| 44 | (list "--disable-static"))) |
| 45 | (home-page "http://sg.danny.cz/sg/sg3_utils.html") |
| 46 | (synopsis "SCSI device utilities") |
| 47 | (description |
| 48 | "sg3-utils is a collection of utilities for devices that use the Small |
| 49 | Computer System Interface (@dfn{SCSI}) command set. It includes utilities to |
| 50 | read data from, write data to, control, modify, and query the state of SCSI |
| 51 | devices. |
| 52 | |
| 53 | For example, this package provides command-line tools to: |
| 54 | @itemize |
| 55 | @item copy data based on @code{dd} syntax and semantics (called @command{sg_dd}, |
| 56 | @command{sgp_dd}, and @command{sgm_dd}) |
| 57 | @item check @code{INQUIRY} data and @code{VPD pages} (@command{sg_inq}) |
| 58 | @item check mode and log pages (@command{sginfo}, @command{sg_modes}, and |
| 59 | @command{sg_logs}) |
| 60 | @item spin up and down disks (@command{sg_start}) |
| 61 | @item do self-tests (@code{sg_senddiag}) |
| 62 | @item parse sense data (@code{sg_decode_sense}) |
| 63 | @item and perform various other functions. |
| 64 | @end itemize |
| 65 | |
| 66 | In addition, this package includes a library, called libsgutils, which can be |
| 67 | used in C and C++ programs to interact with SCSI devices.") |
| 68 | ;; See README: "All utilities and libraries have either a "2 clause" BSD |
| 69 | ;; license or are "GPL-2ed". [...] That BSD license was updated from the |
| 70 | ;; "3 clause" to the newer "2 clause" version on 20180119. To save space |
| 71 | ;; various source code files refer to a file called "BSD_LICENSE" [...]." |
| 72 | ;; Some files (like sg_compare_and_write.c) retain their 3-clause headers! |
| 73 | (license (list gpl2+ bsd-2 bsd-3)))) |
| 74 | |
| 75 | (define-public libiscsi |
| 76 | (package |
| 77 | (name "libiscsi") |
| 78 | (version "1.19.0") |
| 79 | (source |
| 80 | (origin |
| 81 | (method git-fetch) |
| 82 | (uri (git-reference |
| 83 | (url "https://github.com/sahlberg/libiscsi") |
| 84 | (commit version))) |
| 85 | (sha256 |
| 86 | (base32 |
| 87 | "0ajrkkg5awmi8m4b3mha7h07ylg18k252qprvk1sgq0qbyd66zy7")) |
| 88 | (file-name (git-file-name name version)))) |
| 89 | (build-system gnu-build-system) |
| 90 | (native-inputs (list autoconf automake libtool)) |
| 91 | (synopsis "Client-side library for iSCSI") |
| 92 | (description "Libiscsi is a client-side library to implement the iSCSI |
| 93 | protocol that can be used to access the resources of an iSCSI target. It is |
| 94 | fully asynchronous with regards to iSCSI commands and SCSI tasks, but a |
| 95 | synchronous layer is also provided for ease of use for simpler applications.") |
| 96 | (home-page "https://github.com/sahlberg/libiscsi") |
| 97 | (license (list |
| 98 | ;; For the src, examples and test-tool directories, except |
| 99 | ;; src/ld_iscsi.c. |
| 100 | gpl2+ |
| 101 | ;; For the lib and include directories. |
| 102 | lgpl2.1+)))) |