diff options
author | Rob Vermaas <rob.vermaas@gmail.com> | 2009-09-16 11:27:18 +0000 |
---|---|---|
committer | Rob Vermaas <rob.vermaas@gmail.com> | 2009-09-16 11:27:18 +0000 |
commit | 5d6ee123ed7cea0ba4df0e78ddf8a54d4b9040c8 (patch) | |
tree | ee0b56bb146d26fc04737fe0c061dd7c105f8f3b /pkgs/tools/networking/ddclient | |
parent | 94642f08a620206d9443b81adc2cd14d1dc4db82 (diff) | |
download | nixpkgs-5d6ee123ed7cea0ba4df0e78ddf8a54d4b9040c8.tar nixpkgs-5d6ee123ed7cea0ba4df0e78ddf8a54d4b9040c8.tar.gz nixpkgs-5d6ee123ed7cea0ba4df0e78ddf8a54d4b9040c8.tar.bz2 nixpkgs-5d6ee123ed7cea0ba4df0e78ddf8a54d4b9040c8.tar.lz nixpkgs-5d6ee123ed7cea0ba4df0e78ddf8a54d4b9040c8.tar.xz nixpkgs-5d6ee123ed7cea0ba4df0e78ddf8a54d4b9040c8.tar.zst nixpkgs-5d6ee123ed7cea0ba4df0e78ddf8a54d4b9040c8.zip |
ddclient
svn path=/nixpkgs/trunk/; revision=17181
Diffstat (limited to 'pkgs/tools/networking/ddclient')
-rw-r--r-- | pkgs/tools/networking/ddclient/ddclient-foreground.patch | 80 | ||||
-rw-r--r-- | pkgs/tools/networking/ddclient/default.nix | 24 |
2 files changed, 104 insertions, 0 deletions
diff --git a/pkgs/tools/networking/ddclient/ddclient-foreground.patch b/pkgs/tools/networking/ddclient/ddclient-foreground.patch new file mode 100644 index 00000000000..954b3e1132f --- /dev/null +++ b/pkgs/tools/networking/ddclient/ddclient-foreground.patch @@ -0,0 +1,80 @@ +diff -rc ddclient-3.8.0/ddclient ddclient-3.8.0-new/ddclient +*** ddclient-3.8.0/ddclient 2009-01-27 20:14:02.000000000 +0100 +--- ddclient-3.8.0-new/ddclient 2009-09-16 12:56:43.720654327 +0200 +*************** +*** 307,313 **** + my %variables = ( + 'global-defaults' => { + 'daemon' => setv(T_DELAY, 0, 0, 1, 0, interval('60s')), +! 'file' => setv(T_FILE, 0, 0, 1, "$etc$program.conf", undef), + 'cache' => setv(T_FILE, 0, 0, 1, "$cachedir$program.cache", undef), + 'pid' => setv(T_FILE, 0, 0, 1, "", undef), + 'proxy' => setv(T_FQDNP, 0, 0, 1, '', undef), +--- 307,314 ---- + my %variables = ( + 'global-defaults' => { + 'daemon' => setv(T_DELAY, 0, 0, 1, 0, interval('60s')), +! 'foreground' => setv(T_BOOL, 0, 0, 1, 0, undef), +! 'file' => setv(T_FILE, 0, 0, 1, "$etc$program.conf", undef), + 'cache' => setv(T_FILE, 0, 0, 1, "$cachedir$program.cache", undef), + 'pid' => setv(T_FILE, 0, 0, 1, "", undef), + 'proxy' => setv(T_FQDNP, 0, 0, 1, '', undef), +*************** +*** 535,540 **** +--- 536,542 ---- + "usage: ${program} [options]", + "options are:", + [ "daemon", "=s", "-daemon delay : run as a daemon, specify delay as an interval." ], ++ [ "foreground", "!", "-foreground : do not fork" ], + [ "proxy", "=s", "-proxy host : use 'host' as the HTTP proxy" ], + [ "server", "=s", "-server host : update DNS information on 'host'" ], + [ "protocol", "=s", "-protocol type : update protocol used" ], +*************** +*** 623,629 **** + $SIG{'HUP'} = sub { $caught_hup = 1; }; + $SIG{'TERM'} = sub { $caught_term = 1; }; + $SIG{'KILL'} = sub { $caught_kill = 1; }; +! if (opt('daemon') && !opt('force')) { + $SIG{'CHLD'} = 'IGNORE'; + my $pid = fork; + if ($pid < 0) { +--- 625,634 ---- + $SIG{'HUP'} = sub { $caught_hup = 1; }; + $SIG{'TERM'} = sub { $caught_term = 1; }; + $SIG{'KILL'} = sub { $caught_kill = 1; }; +! # don't fork() if foreground or force is on +! if (opt('foreground') || opt('force')) { +! ; +! } elsif (opt('daemon')) { + $SIG{'CHLD'} = 'IGNORE'; + my $pid = fork; + if ($pid < 0) { +*************** +*** 633,644 **** + exit 0; + } + $SIG{'CHLD'} = 'DEFAULT'; +- $opt{'syslog'} = 1; + open(STDOUT, ">/dev/null"); + open(STDERR, ">/dev/null"); + open(STDIN, "</dev/null"); +! +! write_pid(); + } + + umask 077; +--- 638,650 ---- + exit 0; + } + $SIG{'CHLD'} = 'DEFAULT'; + open(STDOUT, ">/dev/null"); + open(STDERR, ">/dev/null"); + open(STDIN, "</dev/null"); +! } +! if(opt('daemon')) { +! write_pid(); +! $opt{'syslog'} = 1; + } + + umask 077; +Only in ddclient-3.8.0-new: ddclient~ diff --git a/pkgs/tools/networking/ddclient/default.nix b/pkgs/tools/networking/ddclient/default.nix new file mode 100644 index 00000000000..7c1e89083b8 --- /dev/null +++ b/pkgs/tools/networking/ddclient/default.nix @@ -0,0 +1,24 @@ +{buildPerlPackage, fetchurl, perl}: + +buildPerlPackage { + name = "ddclient-3.8.0"; + + src = fetchurl { + url = mirror://sourceforge/ddclient/ddclient-3.8.0.tar.gz ; + sha256 = "1cqz6fwx8bcl7zdrvm6irh3bzs8858gkyficww9simyjmz7z3w48"; + }; + + patches = [ ./ddclient-foreground.patch ]; + + preConfigure = '' + touch Makefile.PL + ''; + + installPhase = '' + ensureDir $out/bin + cp ddclient $out/bin + ''; + + doCheck = false; + +} |