about summary refs log tree commit diff
path: root/pkgs/servers/hylafaxplus/default.nix
diff options
context:
space:
mode:
authorYarny0 <41838844+Yarny0@users.noreply.github.com>2018-08-04 14:10:28 +0200
committerYarny0 <41838844+Yarny0@users.noreply.github.com>2018-09-08 14:21:40 +0200
commita08b633fe7b636556ece29cc75448254b6ac3d28 (patch)
treef4ca158658072e16db424cba1febbcd23d732c9a /pkgs/servers/hylafaxplus/default.nix
parentf2c5b98649f20619a61dd43171023bd2b191ed7e (diff)
downloadnixlib-a08b633fe7b636556ece29cc75448254b6ac3d28.tar
nixlib-a08b633fe7b636556ece29cc75448254b6ac3d28.tar.gz
nixlib-a08b633fe7b636556ece29cc75448254b6ac3d28.tar.bz2
nixlib-a08b633fe7b636556ece29cc75448254b6ac3d28.tar.lz
nixlib-a08b633fe7b636556ece29cc75448254b6ac3d28.tar.xz
nixlib-a08b633fe7b636556ece29cc75448254b6ac3d28.tar.zst
nixlib-a08b633fe7b636556ece29cc75448254b6ac3d28.zip
HylaFAX+: init at 5.6.0
Create the top-level packages attribute
'hylafaxplus' that builds HylaFAX+ .

Note:
The nobody uid and the nogroup gid
are hardcoded in the package.
The package build recipe file
contains options to modify these ids.
Diffstat (limited to 'pkgs/servers/hylafaxplus/default.nix')
-rw-r--r--pkgs/servers/hylafaxplus/default.nix95
1 files changed, 95 insertions, 0 deletions
diff --git a/pkgs/servers/hylafaxplus/default.nix b/pkgs/servers/hylafaxplus/default.nix
new file mode 100644
index 000000000000..410d24974268
--- /dev/null
+++ b/pkgs/servers/hylafaxplus/default.nix
@@ -0,0 +1,95 @@
+{ stdenv
+, lib
+, fakeroot
+, fetchurl
+, libfaketime
+, substituteAll
+## runtime dependencies
+, coreutils
+, file
+, findutils
+, gawk
+, ghostscript
+, gnugrep
+, gnused
+, libtiff
+, psmisc
+, sharutils
+, utillinux
+, zlib
+## optional packages (using `null` disables some functionality)
+, jbigkit ? null
+, lcms2 ? null  # for colored faxes
+, openldap ? null
+, pam ? null
+## system-dependent settings that have to be hardcoded
+, maxgid ? 65534  # null -> try to auto-detect (bad on linux)
+, maxuid ? 65534  # null -> hardcoded value 60002
+}:
+
+let
+
+  name = "hylafaxplus-${version}";
+  version = "5.6.0";
+  sha256 = "128514kw9kb5cvznm87z7gis1mpyx4bcqrxx4xa7cbfj1v3v81fr";
+
+  configSite = substituteAll {
+    name = "hylafaxplus-config.site";
+    src = ./config.site;
+    config_maxgid = lib.optionalString (maxgid!=null) ''CONFIG_MAXGID=${builtins.toString maxgid}'';
+    ghostscript_version = ghostscript.version;
+    out_ = "@out@";  # "out" will be resolved in post-install.sh
+    inherit coreutils ghostscript libtiff;
+  };
+
+  postPatch = substituteAll {
+    name = "hylafaxplus-post-patch.sh";
+    src = ./post-patch.sh;
+    inherit configSite;
+    maxuid = lib.optionalString (maxuid!=null) (builtins.toString maxuid);
+    faxcover_binpath = lib.makeBinPath
+      [stdenv.shellPackage coreutils];
+    faxsetup_binpath = lib.makeBinPath
+      [stdenv.shellPackage coreutils findutils gnused gnugrep gawk];
+  };
+
+  postInstall = substituteAll {
+    name = "hylafaxplus-post-install.sh";
+    src = ./post-install.sh;
+    inherit fakeroot libfaketime;
+  };
+
+in
+
+stdenv.mkDerivation {
+  inherit name version;
+  src = fetchurl {
+    url = "mirror://sourceforge/hylafax/hylafax-${version}.tar.gz";
+    inherit sha256;
+  };
+  # Note that `configure` (and maybe `faxsetup`) are looking
+  # for a couple of standard binaries in the `PATH` and
+  # hardcode their absolute paths in the new package.
+  buildInputs = [
+    file  # for `file` command
+    ghostscript
+    libtiff
+    psmisc  # for `fuser` command
+    sharutils  # for `uuencode` command
+    utillinux  # for `agetty` command
+    zlib
+    jbigkit  # optional
+    lcms2  # optional
+    openldap  # optional
+    pam  # optional
+  ];
+  postPatch = ''. ${postPatch}'';
+  dontAddPrefix = true;
+  postInstall = ''. ${postInstall}'';
+  postInstallCheck = ''. ${./post-install-check.sh}'';
+  meta.description = "enterprise-class system for sending and receiving facsimiles";
+  meta.homepage = http://hylafax.sourceforge.net;
+  meta.license = lib.licenses.bsd3;
+  meta.maintainers = [ lib.maintainers.yarny ];
+  meta.platforms = lib.platforms.linux;
+}