45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
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", "wt+") 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)
|