64 lines
1.5 KiB
Python
64 lines
1.5 KiB
Python
from lib.make import *
|
|
from lib import cpp
|
|
|
|
|
|
version("1.2")
|
|
description("Jeremie Miller's original mdnsd")
|
|
maintainer("sisungo <[email protected]>")
|
|
source_managed("github://troglobit/mdnsd#v1.2", "autotools")
|
|
|
|
builddep("shortcut/c")
|
|
builddep("shortcut/autotools")
|
|
|
|
|
|
def build():
|
|
cpp.configure([
|
|
f"--prefix=/",
|
|
"--sysconfdir=/var/config/network/mdns.d",
|
|
])
|
|
cpp.make()
|
|
cpp.make_install()
|
|
|
|
on_build(build)
|
|
|
|
|
|
def pack_mdnsd(composer):
|
|
composer.makedir("bin")
|
|
composer.add("sbin/mdnsd", "bin/mdnsd")
|
|
composer.makedirs("share/services")
|
|
with open("mdnsd.airs", "wt+") as fd:
|
|
fd.write("[service]\n")
|
|
fd.write("display-name = \"mDNS Responder\"\n")
|
|
fd.write("description = \"System multicast DNS responder.\"\n")
|
|
fd.write("\n")
|
|
fd.write("[exec]\n")
|
|
fd.write(f'start = "{get_prefix('mdnsd')}/bin/mdnsd -n /var/config/network/mdns.d"\n')
|
|
fd.write("\n")
|
|
fd.write("[env]\n")
|
|
fd.write("working_dir = \"/\"\n")
|
|
fd.write("clear_vars = true\n")
|
|
composer.add("mdnsd.airs", "share/services/mdnsd.airs")
|
|
|
|
def pack_mquery(composer):
|
|
composer.makedir("bin")
|
|
composer.add("bin/mquery")
|
|
|
|
package("libmdnsd")
|
|
dep("semi-libc @same-arch")
|
|
cpp.use_auto_pack(["lib"])
|
|
|
|
package("libmdnsd-dev")
|
|
dep("libmdnsd (same)")
|
|
dep("semi-libc-dev @same-arch")
|
|
cpp.use_auto_pack(["dev"])
|
|
|
|
package("mquery")
|
|
dep("libmdnsd (same)")
|
|
dep("semi-libc @same-arch")
|
|
on_pack(pack_mquery)
|
|
|
|
package("mdnsd")
|
|
dep("libmdnsd (same)")
|
|
dep("semi-libc @same-arch")
|
|
on_pack(pack_mdnsd)
|