Subject: [PATCH] gnu: Add iozone.
From: Ricardo Wurmus <[email-masked]>
To: [email-masked]
Cc: Ricardo Wurmus <[email-masked]>
Date: Tue, 12 Jun 2018 13:23:25 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/profiling.scm (iozone): New variable.
---
 gnu/packages/profiling.scm | 47 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/profiling.scm b/gnu/packages/profiling.scm
index b2def45cc..b248af0b3 100644
--- a/gnu/packages/profiling.scm
+++ b/gnu/packages/profiling.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Dave Love <[email-masked]>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <[email-masked]>
+;;; Copyright © 2018 Ricardo Wurmus <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -399,3 +400,49 @@ high-performance computing (HPC) applications.")
     (license license:cpl1.0)))
 
 (define-public scorep-openmpi (make-scorep openmpi))
+
+(define-public iozone
+  (package
+    (name "iozone")
+    (version "3.482")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://www.iozone.org/src/current/"
+                                  "iozone"
+                                  (string-map (lambda (c)
+                                                (if (char=? c #\.) #\_ c))
+                                              version)
+                                  ".tar"))
+              (sha256
+               (base32
+                "0c5fyfr3iqfb8my7dcjlhm6kkmcl4a7r6gcgqrvp3xwn7jvgwcr7"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags (list "linux" "CC=gcc")
+       #:tests? #f ; none included
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'chdir
+           (lambda _ (chdir "src/current/")))
+         (delete 'configure)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out  (assoc-ref outputs "out"))
+                    (bin  (string-append out "/bin"))
+                    (man1 (string-append out "/share/man/man1")))
+               (for-each (lambda (file)
+                           (install-file file bin))
+                         '("iozone" "fileop" "pit_server"))
+               (install-file "../../docs/iozone.1" man1))
+             #t)))))
+    (home-page "http://www.iozone.org")
+    (synopsis "Filesystem benchmark tool")
+    (description "IOzone is a filesystem benchmark tool.  The benchmark
+generates and measures a variety of file operations.  Iozone is useful for
+performing a broad filesystem analysis of a vendor’s computer platform.  The
+benchmark tests file I/O performance for the following operations: Read,
+write, re-read, re-write, read backwards, read strided, @code{fread},
+@code{fwrite}, random read, @code{pread}, @code{mmap}, @code{aio_read},
+@code{aio_write}.")
+    (license (license:non-copyleft
+              "http://www.iozone.org/docs/Iozone_License.txt"))))
-- 
2.17.1