Merge pull request #123084 from Yarny0/hylafax
hylafaxplus & nixos/hylafax: small improvements
This commit is contained in:
commit
c455f3ccaf
@ -1,4 +1,4 @@
|
|||||||
#! @shell@ -e
|
#! @runtimeShell@ -e
|
||||||
|
|
||||||
# skip this if there are no modems at all
|
# skip this if there are no modems at all
|
||||||
if ! stat -t "@spoolAreaPath@"/etc/config.* >/dev/null 2>&1
|
if ! stat -t "@spoolAreaPath@"/etc/config.* >/dev/null 2>&1
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
let
|
let
|
||||||
|
|
||||||
inherit (lib.options) literalExample mkEnableOption mkOption;
|
inherit (lib.options) literalExample mkEnableOption mkOption;
|
||||||
inherit (lib.types) bool enum int lines attrsOf nullOr path str submodule;
|
inherit (lib.types) bool enum ints lines attrsOf nullOr path str submodule;
|
||||||
inherit (lib.modules) mkDefault mkIf mkMerge;
|
inherit (lib.modules) mkDefault mkIf mkMerge;
|
||||||
|
|
||||||
commonDescr = ''
|
commonDescr = ''
|
||||||
@ -18,7 +18,6 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
str1 = lib.types.addCheck str (s: s!=""); # non-empty string
|
str1 = lib.types.addCheck str (s: s!=""); # non-empty string
|
||||||
int1 = lib.types.addCheck int (i: i>0); # positive integer
|
|
||||||
|
|
||||||
configAttrType =
|
configAttrType =
|
||||||
# Options in HylaFAX configuration files can be
|
# Options in HylaFAX configuration files can be
|
||||||
@ -27,7 +26,7 @@ let
|
|||||||
# This type definition resolves all
|
# This type definition resolves all
|
||||||
# those types into a list of strings.
|
# those types into a list of strings.
|
||||||
let
|
let
|
||||||
inherit (lib.types) attrsOf coercedTo listOf;
|
inherit (lib.types) attrsOf coercedTo int listOf;
|
||||||
innerType = coercedTo bool (x: if x then "Yes" else "No")
|
innerType = coercedTo bool (x: if x then "Yes" else "No")
|
||||||
(coercedTo int (toString) str);
|
(coercedTo int (toString) str);
|
||||||
in
|
in
|
||||||
@ -290,7 +289,7 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
faxcron.infoDays = mkOption {
|
faxcron.infoDays = mkOption {
|
||||||
type = int1;
|
type = ints.positive;
|
||||||
default = 30;
|
default = 30;
|
||||||
description = ''
|
description = ''
|
||||||
Set the expiration time for data in the
|
Set the expiration time for data in the
|
||||||
@ -298,7 +297,7 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
faxcron.logDays = mkOption {
|
faxcron.logDays = mkOption {
|
||||||
type = int1;
|
type = ints.positive;
|
||||||
default = 30;
|
default = 30;
|
||||||
description = ''
|
description = ''
|
||||||
Set the expiration time for
|
Set the expiration time for
|
||||||
@ -306,7 +305,7 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
faxcron.rcvDays = mkOption {
|
faxcron.rcvDays = mkOption {
|
||||||
type = int1;
|
type = ints.positive;
|
||||||
default = 7;
|
default = 7;
|
||||||
description = ''
|
description = ''
|
||||||
Set the expiration time for files in
|
Set the expiration time for files in
|
||||||
@ -343,7 +342,7 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
faxqclean.doneqMinutes = mkOption {
|
faxqclean.doneqMinutes = mkOption {
|
||||||
type = int1;
|
type = ints.positive;
|
||||||
default = 15;
|
default = 15;
|
||||||
example = literalExample "24*60";
|
example = literalExample "24*60";
|
||||||
description = ''
|
description = ''
|
||||||
@ -353,7 +352,7 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
faxqclean.docqMinutes = mkOption {
|
faxqclean.docqMinutes = mkOption {
|
||||||
type = int1;
|
type = ints.positive;
|
||||||
default = 60;
|
default = 60;
|
||||||
example = literalExample "24*60";
|
example = literalExample "24*60";
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#! @shell@ -e
|
#! @runtimeShell@ -e
|
||||||
|
|
||||||
# The following lines create/update the HylaFAX spool directory:
|
# The following lines create/update the HylaFAX spool directory:
|
||||||
# Subdirectories/files with persistent data are kept,
|
# Subdirectories/files with persistent data are kept,
|
||||||
@ -80,7 +80,7 @@ touch clientlog faxcron.lastrun xferfaxlog
|
|||||||
chown @faxuser@:@faxgroup@ clientlog faxcron.lastrun xferfaxlog
|
chown @faxuser@:@faxgroup@ clientlog faxcron.lastrun xferfaxlog
|
||||||
|
|
||||||
# create symlinks for frozen directories/files
|
# create symlinks for frozen directories/files
|
||||||
lnsym --target-directory=. "@hylafax@"/spool/{COPYRIGHT,bin,config}
|
lnsym --target-directory=. "@hylafaxplus@"/spool/{COPYRIGHT,bin,config}
|
||||||
|
|
||||||
# create empty temporary directories
|
# create empty temporary directories
|
||||||
update --mode=0700 -d client dev status
|
update --mode=0700 -d client dev status
|
||||||
@ -93,7 +93,7 @@ install -d "@spoolAreaPath@/etc"
|
|||||||
cd "@spoolAreaPath@/etc"
|
cd "@spoolAreaPath@/etc"
|
||||||
|
|
||||||
# create symlinks to all files in template's etc
|
# create symlinks to all files in template's etc
|
||||||
lnsym --target-directory=. "@hylafax@/spool/etc"/*
|
lnsym --target-directory=. "@hylafaxplus@/spool/etc"/*
|
||||||
|
|
||||||
# set LOCKDIR in setup.cache
|
# set LOCKDIR in setup.cache
|
||||||
sed --regexp-extended 's|^(UUCP_LOCKDIR=).*$|\1'"'@lockPath@'|g" --in-place setup.cache
|
sed --regexp-extended 's|^(UUCP_LOCKDIR=).*$|\1'"'@lockPath@'|g" --in-place setup.cache
|
||||||
|
@ -13,11 +13,10 @@ let
|
|||||||
# creates hylafax config file,
|
# creates hylafax config file,
|
||||||
# makes sure "Include" is listed *first*
|
# makes sure "Include" is listed *first*
|
||||||
let
|
let
|
||||||
mkLines = conf:
|
mkLines = lib.flip lib.pipe [
|
||||||
(lib.concatLists
|
(lib.mapAttrsToList (key: map (val: "${key}: ${val}")))
|
||||||
(lib.flip lib.mapAttrsToList conf
|
lib.concatLists
|
||||||
(k: map (v: "${k}: ${v}")
|
];
|
||||||
)));
|
|
||||||
include = mkLines { Include = conf.Include or []; };
|
include = mkLines { Include = conf.Include or []; };
|
||||||
other = mkLines ( conf // { Include = []; } );
|
other = mkLines ( conf // { Include = []; } );
|
||||||
in
|
in
|
||||||
@ -48,13 +47,12 @@ let
|
|||||||
name = "hylafax-setup-spool.sh";
|
name = "hylafax-setup-spool.sh";
|
||||||
src = ./spool.sh;
|
src = ./spool.sh;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit (pkgs.stdenv) shell;
|
|
||||||
hylafax = pkgs.hylafaxplus;
|
|
||||||
faxuser = "uucp";
|
faxuser = "uucp";
|
||||||
faxgroup = "uucp";
|
faxgroup = "uucp";
|
||||||
lockPath = "/var/lock";
|
lockPath = "/var/lock";
|
||||||
inherit globalConfigPath modemConfigPath;
|
inherit globalConfigPath modemConfigPath;
|
||||||
inherit (cfg) sendmailPath spoolAreaPath userAccessFile;
|
inherit (cfg) sendmailPath spoolAreaPath userAccessFile;
|
||||||
|
inherit (pkgs) hylafaxplus runtimeShell;
|
||||||
};
|
};
|
||||||
|
|
||||||
waitFaxqScript = pkgs.substituteAll {
|
waitFaxqScript = pkgs.substituteAll {
|
||||||
@ -64,8 +62,8 @@ let
|
|||||||
src = ./faxq-wait.sh;
|
src = ./faxq-wait.sh;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
timeoutSec = toString 10;
|
timeoutSec = toString 10;
|
||||||
inherit (pkgs.stdenv) shell;
|
|
||||||
inherit (cfg) spoolAreaPath;
|
inherit (cfg) spoolAreaPath;
|
||||||
|
inherit (pkgs) runtimeShell;
|
||||||
};
|
};
|
||||||
|
|
||||||
sockets.hylafax-hfaxd = {
|
sockets.hylafax-hfaxd = {
|
||||||
@ -108,8 +106,10 @@ let
|
|||||||
PrivateDevices = true; # breaks /dev/tty...
|
PrivateDevices = true; # breaks /dev/tty...
|
||||||
PrivateNetwork = true;
|
PrivateNetwork = true;
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
|
#ProtectClock = true; # breaks /dev/tty... (why?)
|
||||||
ProtectControlGroups = true;
|
ProtectControlGroups = true;
|
||||||
#ProtectHome = true; # breaks custom spool dirs
|
#ProtectHome = true; # breaks custom spool dirs
|
||||||
|
ProtectKernelLogs = true;
|
||||||
ProtectKernelModules = true;
|
ProtectKernelModules = true;
|
||||||
ProtectKernelTunables = true;
|
ProtectKernelTunables = true;
|
||||||
#ProtectSystem = "strict"; # breaks custom spool dirs
|
#ProtectSystem = "strict"; # breaks custom spool dirs
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
, lib
|
, lib
|
||||||
, fakeroot
|
, fakeroot
|
||||||
, fetchurl
|
, fetchurl
|
||||||
|
, fetchpatch
|
||||||
, libfaketime
|
, libfaketime
|
||||||
, substituteAll
|
, substituteAll
|
||||||
## runtime dependencies
|
## runtime dependencies
|
||||||
@ -29,12 +30,12 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
name = "hylafaxplus-${version}";
|
pname = "hylafaxplus";
|
||||||
version = "7.0.3";
|
version = "7.0.3";
|
||||||
sha256 = "139iwcwrn9i5lragxi33ilzah72w59wg4midfjjgx5cly3ah0iy4";
|
sha256 = "139iwcwrn9i5lragxi33ilzah72w59wg4midfjjgx5cly3ah0iy4";
|
||||||
|
|
||||||
configSite = substituteAll {
|
configSite = substituteAll {
|
||||||
name = "hylafaxplus-config.site";
|
name = "${pname}-config.site";
|
||||||
src = ./config.site;
|
src = ./config.site;
|
||||||
config_maxgid = lib.optionalString (maxgid!=null) ''CONFIG_MAXGID=${builtins.toString maxgid}'';
|
config_maxgid = lib.optionalString (maxgid!=null) ''CONFIG_MAXGID=${builtins.toString maxgid}'';
|
||||||
ghostscript_version = ghostscript.version;
|
ghostscript_version = ghostscript.version;
|
||||||
@ -43,7 +44,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
postPatch = substituteAll {
|
postPatch = substituteAll {
|
||||||
name = "hylafaxplus-post-patch.sh";
|
name = "${pname}-post-patch.sh";
|
||||||
src = ./post-patch.sh;
|
src = ./post-patch.sh;
|
||||||
inherit configSite;
|
inherit configSite;
|
||||||
maxuid = lib.optionalString (maxuid!=null) (builtins.toString maxuid);
|
maxuid = lib.optionalString (maxuid!=null) (builtins.toString maxuid);
|
||||||
@ -54,7 +55,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
postInstall = substituteAll {
|
postInstall = substituteAll {
|
||||||
name = "hylafaxplus-post-install.sh";
|
name = "${pname}-post-install.sh";
|
||||||
src = ./post-install.sh;
|
src = ./post-install.sh;
|
||||||
inherit fakeroot libfaketime;
|
inherit fakeroot libfaketime;
|
||||||
};
|
};
|
||||||
@ -62,13 +63,18 @@ let
|
|||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit name version;
|
inherit pname version;
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/hylafax/hylafax-${version}.tar.gz";
|
url = "mirror://sourceforge/hylafax/hylafax-${version}.tar.gz";
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
patches = [
|
patches = [
|
||||||
./libtiff-4.2.patch # adjust configure check to work with libtiff > 4.1
|
# adjust configure check to work with libtiff > 4.1
|
||||||
|
(fetchpatch {
|
||||||
|
name = "libtiff-4.2.patch";
|
||||||
|
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/net-misc/hylafaxplus/files/hylafaxplus-7.0.2-tiff-4.2.patch?id=82e3eefd5447f36e5bb00068a54b91d8c891ccf6";
|
||||||
|
sha256 = "0hhf4wpgj842gz4nxq8s55vnzmciqkyjjaaxdpqawns2746vx0sw";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
# Note that `configure` (and maybe `faxsetup`) are looking
|
# Note that `configure` (and maybe `faxsetup`) are looking
|
||||||
# for a couple of standard binaries in the `PATH` and
|
# for a couple of standard binaries in the `PATH` and
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
diff --git a/configure b/configure
|
|
||||||
index 7456dcb..90f0e8d 100755
|
|
||||||
--- a/configure
|
|
||||||
+++ b/configure
|
|
||||||
@@ -2583,7 +2583,7 @@ EOF
|
|
||||||
echo '#define TIFFSTRIPBYTECOUNTS uint32'
|
|
||||||
echo '#define TIFFVERSION TIFF_VERSION'
|
|
||||||
echo '#define TIFFHEADER TIFFHeader';;
|
|
||||||
- 4.[01]) tiff_runlen_t="uint32"
|
|
||||||
+ 4.[012]) tiff_runlen_t="uint32"
|
|
||||||
tiff_offset_t="uint64"
|
|
||||||
echo '#define TIFFSTRIPBYTECOUNTS uint64'
|
|
||||||
echo '#define TIFFVERSION TIFF_VERSION_CLASSIC'
|
|
@ -1,10 +1,3 @@
|
|||||||
# `configure` (maybe others) set `POSIXLY_CORRECT`, which
|
|
||||||
# breaks the gcc wrapper script of nixpkgs (maybe others).
|
|
||||||
# We simply un-export `POSIXLY_CORRECT` after each export so
|
|
||||||
# its effects don't apply within nixpkgs wrapper scripts.
|
|
||||||
grep -rlF POSIXLY_CORRECT | xargs \
|
|
||||||
sed '/export *POSIXLY_CORRECT/a export -n POSIXLY_CORRECT' -i
|
|
||||||
|
|
||||||
# Replace strange default value for the nobody account.
|
# Replace strange default value for the nobody account.
|
||||||
if test -n "@maxuid@"
|
if test -n "@maxuid@"
|
||||||
then
|
then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user