nixpkgs-suyu/pkgs/tools/networking/ddclient/default.nix

47 lines
1.5 KiB
Nix
Raw Normal View History

2019-05-25 22:15:03 +02:00
{ stdenv, fetchurl, perlPackages, iproute, perl }:
perlPackages.buildPerlPackage rec {
pname = "ddclient";
version = "3.9.0";
src = fetchurl {
url = "mirror://sourceforge/ddclient/${pname}-${version}.tar.gz";
sha256 = "0fwyhab8yga2yi1kdfkbqxa83wxhwpagmj1w1mwkg2iffh1fjjlw";
};
# perl packages by default get devdoc which isn't present
outputs = [ "out" ];
buildInputs = with perlPackages; [ IOSocketSSL DigestSHA1 DataValidateIP JSONPP ];
2012-11-08 13:54:53 +01:00
# Use iproute2 instead of ifconfig
preConfigure = ''
touch Makefile.PL
2017-08-13 15:45:25 +02:00
substituteInPlace ddclient \
--replace 'in the output of ifconfig' 'in the output of ip addr show' \
2019-05-29 17:51:17 +02:00
--replace 'ifconfig -a' '${iproute}/sbin/ip addr show' \
--replace 'ifconfig $arg' '${iproute}/sbin/ip addr show $arg' \
--replace '/usr/bin/perl' '${perl}/bin/perl' # Until we get the patchShebangs fixed (issue #55786) we need to patch this manually
'';
installPhase = ''
runHook preInstall
2017-08-13 15:45:25 +02:00
install -Dm755 ddclient $out/bin/ddclient
install -Dm644 -t $out/share/doc/ddclient COP* ChangeLog README.* RELEASENOTE
runHook postInstall
'';
2017-08-13 15:45:25 +02:00
# there are no tests distributed with ddclient
doCheck = false;
meta = with stdenv.lib; {
description = "Client for updating dynamic DNS service entries";
2017-08-13 15:45:25 +02:00
homepage = https://sourceforge.net/p/ddclient/wiki/Home/;
license = licenses.gpl2Plus;
2016-02-21 20:24:07 +01:00
# Mostly since `iproute` is Linux only.
2017-08-13 15:45:25 +02:00
platforms = platforms.linux;
};
}