about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/rfc/default.nix
blob: 60d77bfbaca21071837ed5a3b67c3b3311f27a7c (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
48
49
{ lib
, stdenvNoCC
, fetchFromGitHub
, curl
, installShellFiles
, makeWrapper
}:

stdenvNoCC.mkDerivation rec {
  pname = "rfc";
  version = "0.2.6";

  src = fetchFromGitHub {
    owner = "bfontaine";
    repo = "rfc";
    rev = "v${version}";
    hash = "sha256-dfaeTdJiJuKp8/k6LBP+RC60gTRHfHR5hhLD4ZWJufE=";
  };

  nativeBuildInputs = [ installShellFiles makeWrapper ];

  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    runHook preInstall

    install -Dm755 -t $out/bin rfc
    wrapProgram $out/bin/rfc \
      --prefix PATH : ${lib.makeBinPath [ curl ]}
    installManPage man/rfc.1

    runHook postInstall
  '';

  meta = with lib; {
    description = "A tool to read RFCs from the command line";
    longDescription = ''
      rfc is a little tool written in Bash to read RFCs from the command-line.
      It fetches RFCs and drafts from the Web and caches them locally.
    '';
    homepage = "https://github.com/bfontaine/rfc";
    changelog = "https://github.com/bfontaine/rfc/blob/${src.rev}/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ azahi ];
    platforms = platforms.all;
    mainProgram = "rfc";
  };
}