Subject: [bug#31999] [PATCH 5/7] gnu: Add dmraid.

From: Marius Bakke <[email-masked]>
Date: Mon, 30 Jul 2018 00:42:39 +0200

Pierre Neidhardt <[email-masked]> writes:

> * gnu/package/disk.scm (dmraid): New variable.

[...]

> +(define-public dmraid
> +  (package
> +    (name "dmraid")
> +    (version "1.0.0.rc16-3")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "http://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-"
> +                                  version
> +                                  ".tar.bz2"))

*HTTPS.  Also you can save a line here :-)

> +              (sha256
> +               (base32
> +                "1n7vsqvh7y6yvil682q129d21yhb0cmvd5fvsbkza7ypd78inhlk"))))

14 years since the last release and still going strong!

> +    (build-system gnu-build-system)
> +    (native-inputs
> +     `(("lvm2" ,lvm2)
> +       ("which" ,which)))

Is LVM2 really a native input?

> +    (arguments
> +     `(#:tests? #f                      ; No tests.
> +       #:phases (modify-phases %standard-phases
> +                  (add-before 'configure 'change-directory
> +                    (lambda _
> +                      (chdir (string-append ,version "/dmraid"))
> +                      (substitute* "make.tmpl.in"
> +                        (("/bin/sh") (which "sh")))
> +                      #t)))

Nit-pick: I prefer having the chdir just after unpack.  It's a huge
benefit on tarballs with lots of unrelated directories, so that the
various patching phases don't have to traverse everything.

I doubt it makes a difference in this case, though :P

> +       #:configure-flags (list ;; Make sure programs such as 'dmevent_tool' can
> +                               ;; find libdmraid.so.
> +                               (string-append "LDFLAGS=-Wl,-rpath="
> +                                              (assoc-ref %outputs "out")
> +                                              "/lib"))))
> +    (home-page "http://people.redhat.com/~heinzm/sw/dmraid/")

*HTTPS

> +    (synopsis "Device mapper RAID interface")
> +    (description
> +     "This software supports RAID device discovery, RAID set activation, creation,
> +removal, rebuild and display of properties for ATARAID/DDF1 metadata.
> +
> +@command{dmraid} uses @file{libdevmapper} and the device-mapper kernel runtime
> +to create devices with respective mappings for the ATARAID sets discovered.")
> +    (license license:gpl2+)))

OK!  I realized this is the "fake RAID" driver, apparently it's called
ATARAID.  It would be good to mention this is for specialized hardware,
and LVM itself can do "normal" RAID, but if you can't think of a good
way to squeeze it in don't sweat about it :-)