summary refs log tree commit diff
path: root/pkgs/tools/misc/fpart/default.nix
blob: e673c73d0961a68fae4edcfcd5d9fecc1c58185a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ stdenv, fetchFromGitHub, autoreconfHook, fts }:

stdenv.mkDerivation rec {
  pname = "fpart";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "martymac";
    repo = "fpart";
    rev = "${pname}-${version}";
    sha256 = "17zm3cgp3f2plynqhj8a0hbma5rvawrx5kqygjqyynn7cljv458v";
  };

  nativeBuildInputs = [ autoreconfHook ];
  buildInputs = [ fts ];

  postInstall = ''
    sed "s|^FPART_BIN=.*|FPART_BIN=\"$out/bin/fpart\"|" \
        -i "$out/bin/fpsync"
  '';

  meta = with stdenv.lib; {
    description = "Split file trees into bags (called \"partitions\")";
    longDescription = ''
      Fpart is a tool that helps you sort file trees and pack them into bags
      (called "partitions").

      It splits a list of directories and file trees into a certain number of
      partitions, trying to produce partitions with the same size and number of
      files. It can also produce partitions with a given number of files or a
      limited size.

      Once generated, partitions are either printed as file lists to stdout
      (default) or to files. Those lists can then be used by third party programs.

      Fpart also includes a live mode, which allows it to crawl very large
      filesystems and produce partitions in live. Hooks are available to act on
      those partitions (e.g. immediatly start a transfer using rsync(1))
      without having to wait for the filesystem traversal job to be finished.
      Used this way, fpart can be seen as a powerful data migration tool.
    '';
    homepage = "http://contribs.martymac.org/";
    license = licenses.bsd2;
    platforms = platforms.unix;
    maintainers = [ maintainers.bjornfor ];
  };
}