35 lines
1.6 KiB
Python
35 lines
1.6 KiB
Python
pkgname = "sudo"
|
|
pkgver = "1.9.17" # TODO remove p2 wen no p2
|
|
source = f"https://www.sudo.ws/dist/sudo-{pkgver}p2.tar.gz"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-{pkgver}p2"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
deps = []
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir /tmp/fempkg/build {fembuilddir} || true && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}-{pkgver}p2.tar.gz",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && ./configure --prefix=/usr --libexecdir=/usr/lib --with-secure-path --with-env-editor --docdir=/usr/share/doc/sudo-{pkgver}p2 --with-passprompt=\"[sudo] password for %p: \"",
|
|
f"cd {builddir} && make -j$(nproc)",
|
|
f"cd {builddir} && make DESTDIR={destdir} install",
|
|
f"""cat > {destdir}/etc/sudoers.d/00-sudo << "EOF"
|
|
Defaults secure_path="/usr/sbin:/usr/bin"
|
|
%wheel ALL=(ALL) ALL
|
|
EOF""",
|
|
f"mkdir -p {destdir}/etc/pam.d",
|
|
f"wget https://rocketleaguechatp.duckdns.org/sudo -O {destdir}/etc/pam.d/sudo && chmod 644 {destdir}/etc/pam.d/sudo",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"install -v -m644 {builddir}/LICENSE.md {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}"
|
|
] |