37 lines
2.0 KiB
Python
37 lines
2.0 KiB
Python
pkgname = "avahi"
|
|
pkgver = "0.8"
|
|
source = f"https://github.com/lathiat/avahi/releases/download/v{pkgver}/avahi-{pkgver}.tar.gz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-{pkgver}"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
|
|
deps = ["glib", "gtk3", "libdaemon"]
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir /tmp/fempkg/build {fembuilddir} || true && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}-{pkgver}.tar.gz && wget https://www.linuxfromscratch.org/patches/blfs/svn/avahi-{pkgver}-ipv6_race_condition_fix-1.patch",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && patch -Np1 -i ../avahi-{pkgver}-ipv6_race_condition_fix-1.patch && "
|
|
f"sed -i '426a if (events & AVAHI_WATCH_HUP) {{ client_free(c); return; }}' avahi-daemon/simple-protocol.c && ./configure --prefix=/usr "
|
|
f"--sysconfdir=/etc --localstatedir=/var --disable-static --disable-libevent --disable-mono --disable-monodoc --disable-python "
|
|
f"--disable-qt3 --disable-qt4 --disable-qt5 --enable-core-docs --with-distro=none --with-systemdsystemunitdir=no "
|
|
f"--with-dbus-system-address='unix:path=/run/dbus/system_bus_socket'",
|
|
f"cd {builddir} && make -j$(nproc)",
|
|
f"cd {builddir} && make DESTDIR={destdir} install",
|
|
# patch for nss-mdns which references this socket in this location
|
|
f"mkdir -p {destdir}/usr/var/run/avahi-daemon && ln -sf /run/avahi-daemon/socket {destdir}/usr/var/run/avahi-daemon/socket",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"install -v -m644 {builddir}/LICENSE {destdir}/usr/share/licenses/{pkgname}/LICENSE",
|
|
|
|
# Make tarball + manifests
|
|
f"mkdir -p {outputdir} && cd {destdir} && tar --transform 's|^\\.||' -I zstd -cf {outputdir}/{pkgname}-{pkgver}.tar.zst .",
|
|
f"mkdir -p {manifestdir} && tar -tf {outputdir}/{pkgname}-{pkgver}.tar.zst | grep -v '/$' > {manifestdir}/{pkgname}.txt",
|
|
|
|
# Cleanup
|
|
f"rm -rf {builddir} {fembuilddir}"
|
|
]
|