feat: add package hickory-dns
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
1 parent
91fbbe42de
commit
4bef61e2be
4 files changed
+74
No files matched your search
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
prefix=$(dirname $0)/../../
|
||||
|
||||
[ -e "/var/config/network/named.toml" ] && exit 0
|
||||
|
||||
echo "Copying the default named.toml to /var/config/network/ since it does not exist..."
|
||||
mkdir -m 755 -p /var/config/network
|
||||
cp "$prefix/share/hickory-dns/named.toml" "/var/config/network/named.toml"
|
||||
@@ -0,0 +1,14 @@
|
||||
[service]
|
||||
display-name = "Hickory DNS"
|
||||
description = "Stand-alone Hickory DNS service."
|
||||
|
||||
[exec]
|
||||
pre-start = "%PREFIX%/share/hickory-dns/ensure-config"
|
||||
start = "%PREFIX%/bin/hickory-dns --config /var/config/network/named.toml"
|
||||
|
||||
[env]
|
||||
working_dir = "/var/empty"
|
||||
clear_vars = true
|
||||
|
||||
[env.vars]
|
||||
PATH = "/bin"
|
||||
@@ -0,0 +1,7 @@
|
||||
listen_addrs_ipv4 = ["0.0.0.0"]
|
||||
listen_port = 53
|
||||
|
||||
[[zones]]
|
||||
zone = "."
|
||||
zone_type = "External"
|
||||
stores = { type = "forward", name_servers = [{ ip = "1.1.1.1", connections = [{protocol = { type = "udp" }}] }] }
|
||||
@@ -0,0 +1,44 @@
|
||||
import os
|
||||
|
||||
from lib import rust
|
||||
from lib.make import *
|
||||
|
||||
|
||||
version("0.26.3")
|
||||
description("A cross-platform, high-performance and asynchronous web server for static files-serving.")
|
||||
maintainer("sisungo <[email protected]>")
|
||||
source_managed("github://hickory-dns/hickory-dns#v0.26.3", "rust")
|
||||
|
||||
builddep("shortcut/rust")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
pkgdir = os.getcwd()
|
||||
def service_file():
|
||||
with open(f"{pkgdir}/hickory-dns.airs") as fd:
|
||||
s = fd.read()
|
||||
s = s.replace("%PREFIX%", get_prefix("hickory-dns"))
|
||||
with open("hickory-dns.airs") as fd:
|
||||
fd.write(s)
|
||||
return "hickory-dns.airs"
|
||||
|
||||
def pack(composer):
|
||||
composer.makedir("bin")
|
||||
for i in ["dns", "hickory-dns", "recurse", "resolve"]:
|
||||
composer.add(rust.artifacts_dir() + "/" + i, "bin/" + i)
|
||||
composer.makedir("share")
|
||||
composer.makedir("share/services")
|
||||
composer.add(service_file, "share/services/hickory-dns.airs")
|
||||
composer.makedir("share/hickory-dns")
|
||||
composer.add(f"{pkgdir}/named.toml", "share/hickory-dns/named.toml")
|
||||
composer.add(f"{pkgdir}/ensure-config", "share/hickory-dns/ensure-config")
|
||||
|
||||
package("hickory-dns")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("libunwind @same-arch")
|
||||
on_pack(pack)
|
||||
Reference in new issue
Block a user