From 7550580e19adfa3d4a93774bc9d039b9e2326b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=A4ring?= Date: Sat, 16 Nov 2024 18:31:39 +0100 Subject: [PATCH] technium-dns-server: 13.0.2 -> 13.2 --- nixos/tests/technitium-dns-server.nix | 6 +++ .../nuget-deps.nix} | 0 .../technitium-dns-server-library/package.nix | 40 +++++++++++++++++++ .../te/technitium-dns-server/package.nix | 33 ++++----------- 4 files changed, 53 insertions(+), 26 deletions(-) rename pkgs/by-name/te/{technitium-dns-server/library-nuget-deps.nix => technitium-dns-server-library/nuget-deps.nix} (100%) create mode 100644 pkgs/by-name/te/technitium-dns-server-library/package.nix diff --git a/nixos/tests/technitium-dns-server.nix b/nixos/tests/technitium-dns-server.nix index 016c9d4ecead..12ee57ed52d2 100644 --- a/nixos/tests/technitium-dns-server.nix +++ b/nixos/tests/technitium-dns-server.nix @@ -12,9 +12,15 @@ import ./make-test-python.nix ({pkgs, lib, ...}: }; testScript = '' + import json + start_all() machine.wait_for_unit("technitium-dns-server.service") machine.wait_for_open_port(53) + curl_cmd = 'curl --fail-with-body -X GET "http://localhost:5380/api/user/login?user=admin&pass=admin"' + output = json.loads(machine.wait_until_succeeds(curl_cmd, timeout=10)) + print(output) + assert "ok" == output['status'], "status not ok" ''; meta.maintainers = with lib.maintainers; [ fabianrig ]; diff --git a/pkgs/by-name/te/technitium-dns-server/library-nuget-deps.nix b/pkgs/by-name/te/technitium-dns-server-library/nuget-deps.nix similarity index 100% rename from pkgs/by-name/te/technitium-dns-server/library-nuget-deps.nix rename to pkgs/by-name/te/technitium-dns-server-library/nuget-deps.nix diff --git a/pkgs/by-name/te/technitium-dns-server-library/package.nix b/pkgs/by-name/te/technitium-dns-server-library/package.nix new file mode 100644 index 000000000000..1abde74faa6e --- /dev/null +++ b/pkgs/by-name/te/technitium-dns-server-library/package.nix @@ -0,0 +1,40 @@ +{ + lib, + buildDotnetModule, + fetchFromGitHub, + dotnetCorePackages, + nix-update-script, +}: +buildDotnetModule rec { + pname = "technitium-dns-server-library"; + version = "dns-server-v13.2"; + + src = fetchFromGitHub { + owner = "TechnitiumSoftware"; + repo = "TechnitiumLibrary"; + rev = "refs/tags/${version}"; + hash = "sha256-stfxYe0flE1daPuXw/GAgY52ZD7pkqnBIBvmSVPWWjI="; + name = "${pname}-${version}"; + }; + + dotnet-sdk = dotnetCorePackages.sdk_8_0; + + nugetDeps = ./nuget-deps.nix; + + projectFile = [ + "TechnitiumLibrary.ByteTree/TechnitiumLibrary.ByteTree.csproj" + "TechnitiumLibrary.Net/TechnitiumLibrary.Net.csproj" + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + changelog = "https://github.com/TechnitiumSoftware/DnsServer/blob/master/CHANGELOG.md"; + description = "Library for Authorative and Recursive DNS server for Privacy and Security"; + homepage = "https://github.com/TechnitiumSoftware/DnsServer"; + license = lib.licenses.gpl3Only; + mainProgram = "technitium-dns-server-library"; + maintainers = with lib.maintainers; [ fabianrig ]; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/by-name/te/technitium-dns-server/package.nix b/pkgs/by-name/te/technitium-dns-server/package.nix index ae5cccf2902e..283791658a1c 100644 --- a/pkgs/by-name/te/technitium-dns-server/package.nix +++ b/pkgs/by-name/te/technitium-dns-server/package.nix @@ -3,40 +3,19 @@ buildDotnetModule, fetchFromGitHub, dotnetCorePackages, + technitium-dns-server-library, nixosTests, + nix-update-script, }: -let - technitium-library = buildDotnetModule rec { - pname = "TechnitiumLibrary"; - version = "13.0.2"; - - src = fetchFromGitHub { - owner = "TechnitiumSoftware"; - repo = "TechnitiumLibrary"; - rev = "refs/tags/dns-server-v${version}"; - hash = "sha256-mMNZZvM/UvQTiyeOgPHXXFxmsiGPe4Jal1aSEMEM5Xc="; - name = "${pname}-${version}"; - }; - - dotnet-sdk = dotnetCorePackages.sdk_8_0; - - nugetDeps = ./library-nuget-deps.nix; - - projectFile = [ - "TechnitiumLibrary.ByteTree/TechnitiumLibrary.ByteTree.csproj" - "TechnitiumLibrary.Net/TechnitiumLibrary.Net.csproj" - ]; - }; -in buildDotnetModule rec { pname = "technitium-dns-server"; - version = "13.0.2"; + version = "13.2"; src = fetchFromGitHub { owner = "TechnitiumSoftware"; repo = "DnsServer"; rev = "refs/tags/v${version}"; - hash = "sha256-2dFjr3f4ZlLBJzuObSYIkSdtcyZ8dC6M7/S1p7WoG0c="; + hash = "sha256-oxLMBs+XkzvlfSst6ZD56ZIgiXwm0Px8Tn3Trdd/6H8="; name = "${pname}-${version}"; }; @@ -50,7 +29,7 @@ buildDotnetModule rec { # move dependencies from TechnitiumLibrary to the expected directory preBuild = '' mkdir -p ../TechnitiumLibrary/bin - cp -r ${technitium-library}/lib/TechnitiumLibrary/* ../TechnitiumLibrary/bin/ + cp -r ${technitium-dns-server-library}/lib/${technitium-dns-server-library.pname}/* ../TechnitiumLibrary/bin/ ''; postFixup = '' @@ -61,6 +40,8 @@ buildDotnetModule rec { inherit (nixosTests) technitium-dns-server; }; + passthru.updateScript = nix-update-script { }; + meta = { changelog = "https://github.com/TechnitiumSoftware/DnsServer/blob/master/CHANGELOG.md"; description = "Authorative and Recursive DNS server for Privacy and Security";