42 lines
1.8 KiB
Python
42 lines
1.8 KiB
Python
pkgname = "os-prober"
|
|
pkgver = "1.83"
|
|
source = f"https://deb.debian.org/debian/pool/main/o/{pkgname}/{pkgname}_{pkgver}.tar.xz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/work"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
|
|
deps = ["bash"]
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir -p {fembuilddir} && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}_{pkgver}.tar.xz",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && sed -i -e \"s:/lib/ld\\*\\.so\\*:/lib*/ld*.so*:g\" os-probes/mounted/common/90linux-distro && make newns",
|
|
f"""cd {builddir} && install -Dm 755 os-prober linux-boot-prober -t "{destdir}/usr/bin"
|
|
install -Dm 755 newns -t "{destdir}/usr/lib/os-prober"
|
|
install -Dm 755 common.sh -t "{destdir}/usr/share/os-prober"
|
|
|
|
for dir in os-probes os-probes/mounted os-probes/init linux-boot-probes linux-boot-probes/mounted; do
|
|
install -dm 755 "{destdir}/usr/lib/${{dir}}"
|
|
install -m 755 -t "{destdir}/usr/lib/${{dir}}" "${{dir}}"/common/*
|
|
[[ -d "${{dir}}"/x86 ]] && cp -r "${{dir}}"/x86/* "{destdir}/usr/lib/${{dir}}"
|
|
done
|
|
|
|
install -Dm 755 os-probes/mounted/powerpc/20macosx "{destdir}"/usr/lib/os-probes/mounted/20macosx
|
|
install -dm 755 "${destdir}"/var/lib/os-prober
|
|
""",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"wget https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt -O {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 {fembuilddir}"
|
|
]
|