summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/p9/p910nd/package.nix
blob: 50ca44d1eaca40a3dbef7902e0cb0a2a56e626d0 (plain)
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
50
51
52
53
54
55
56
{
  lib,
  stdenv,
  fetchFromGitHub,
  installShellFiles,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "p910nd";
  version = "0.97";

  src = fetchFromGitHub {
    owner = "kenyapcomau";
    repo = "p910nd";
    rev = finalAttrs.version;
    hash = "sha256-MM4o7d3L3XIRYWJ/KPM2OltlVfVA/BgMuyhJMm/BS3c=";
  };

  postPatch = lib.optionalString stdenv.cc.isClang ''
    substituteInPlace Makefile --replace gcc clang
  '';

  nativeBuildInputs = [ installShellFiles ];

  enableParallelBuilding = true;

  # instead of mucking around with the Makefile, just install the bits we need
  installPhase = ''
    runHook preInstall

    install -Dm555 -t $out/bin p910nd
    install -Dm444 -t $out/share/doc/p910nd *.md
    installManPage p910nd.?

    runHook postInstall
  '';

  meta = {
    description = "Small printer daemon passing jobs directly to the printer";
    longDescription = ''
      p910nd is a small printer daemon intended for diskless platforms that
      does not spool to disk but passes the job directly to the printer.
      Normally a lpr daemon on a spooling host connects to it with a TCP
      connection on port 910n (where n=0, 1, or 2 for lp0, 1 and 2
      respectively). p910nd is particularly useful for diskless platforms.
      Common Unix Printing System (CUPS) supports this protocol, it's called
      the AppSocket protocol and has the scheme socket://. LPRng also supports
      this protocol and the syntax is lp=remotehost%9100 in /etc/printcap.
    '';
    homepage = "https://github.com/kenyapcomau/p910nd";
    license = lib.licenses.gpl2Only;
    maintainers = with lib.maintainers; [ peterhoeg ];
    platforms = lib.platforms.unix;
    mainProgram = "p910nd";
  };
})