2021-06-01 20:03:08 +01:00
|
|
|
{ lib, fetchFromGitHub, perlPackages, iproute2, perl }:
|
2009-09-16 12:27:18 +01:00
|
|
|
|
2018-10-13 00:10:38 +01:00
|
|
|
perlPackages.buildPerlPackage rec {
|
2019-06-20 14:07:56 +01:00
|
|
|
pname = "ddclient";
|
2021-06-01 15:47:35 +01:00
|
|
|
version = "3.9.1";
|
2009-09-16 12:27:18 +01:00
|
|
|
|
2021-06-01 20:03:08 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ddclient";
|
|
|
|
repo = "ddclient";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w";
|
2009-09-16 12:27:18 +01:00
|
|
|
};
|
|
|
|
|
2018-03-12 15:25:28 +00:00
|
|
|
# perl packages by default get devdoc which isn't present
|
2016-04-28 18:48:33 +01:00
|
|
|
outputs = [ "out" ];
|
|
|
|
|
2021-04-17 15:40:49 +01:00
|
|
|
buildInputs = with perlPackages; [ IOSocketSSL DigestSHA1 DataValidateIP JSONPP IOSocketInet6 ];
|
2009-09-16 12:27:18 +01:00
|
|
|
|
2012-11-08 12:54:53 +00:00
|
|
|
# Use iproute2 instead of ifconfig
|
2016-02-20 11:14:29 +00:00
|
|
|
preConfigure = ''
|
2009-09-16 12:27:18 +01:00
|
|
|
touch Makefile.PL
|
2017-08-13 14:45:25 +01:00
|
|
|
substituteInPlace ddclient \
|
|
|
|
--replace 'in the output of ifconfig' 'in the output of ip addr show' \
|
2021-03-14 16:05:16 +00:00
|
|
|
--replace 'ifconfig -a' '${iproute2}/sbin/ip addr show' \
|
|
|
|
--replace 'ifconfig $arg' '${iproute2}/sbin/ip addr show $arg' \
|
2019-05-29 16:51:17 +01:00
|
|
|
--replace '/usr/bin/perl' '${perl}/bin/perl' # Until we get the patchShebangs fixed (issue #55786) we need to patch this manually
|
2016-02-20 11:14:29 +00:00
|
|
|
'';
|
2009-09-16 12:27:18 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2018-03-12 15:25:28 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2017-08-13 14:45:25 +01:00
|
|
|
install -Dm755 ddclient $out/bin/ddclient
|
2018-03-12 15:25:28 +00:00
|
|
|
install -Dm644 -t $out/share/doc/ddclient COP* ChangeLog README.* RELEASENOTE
|
|
|
|
|
|
|
|
runHook postInstall
|
2009-09-16 12:27:18 +01:00
|
|
|
'';
|
|
|
|
|
2017-08-13 14:45:25 +01:00
|
|
|
# there are no tests distributed with ddclient
|
2009-09-16 12:27:18 +01:00
|
|
|
doCheck = false;
|
2016-02-20 11:14:29 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-02-20 11:14:29 +00:00
|
|
|
description = "Client for updating dynamic DNS service entries";
|
2021-06-01 20:03:08 +01:00
|
|
|
homepage = "https://ddclient.net/";
|
|
|
|
license = licenses.gpl2Plus;
|
2016-02-21 19:24:07 +00:00
|
|
|
# Mostly since `iproute` is Linux only.
|
2021-06-01 20:03:08 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2016-02-20 11:14:29 +00:00
|
|
|
};
|
2009-09-16 12:27:18 +01:00
|
|
|
}
|