36 lines
1.8 KiB
Python
36 lines
1.8 KiB
Python
pkgname = "coreutils"
|
|
pkgver = "9.9"
|
|
source = f"https://ftpmirror.gnu.org//gnu/coreutils/coreutils-{pkgver}.tar.xz"
|
|
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 = []
|
|
|
|
build = [
|
|
# Extract
|
|
f"mkdir /tmp/fempkg/build {fembuilddir} || true && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/{pkgname}-{pkgver}.tar.xz && wget https://www.linuxfromscratch.org/patches/lfs/development/coreutils-9.9-i18n-1.patch",
|
|
|
|
# 64-bit build
|
|
f"cd {builddir} && patch -Np1 -i ../coreutils-{pkgver}-i18n-1.patch",
|
|
f"cd {builddir} && autoreconf -fv && automake -af && FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr --enable-no-install-program=kill,uptime",
|
|
f"cd {builddir} && make -j$(nproc)",
|
|
f"cd {builddir} && make DESTDIR={destdir} install",
|
|
f"cd {builddir} && mkdir -pv {destdir}/usr/sbin &&mv -v {destdir}/usr/bin/chroot {destdir}/usr/sbin/chroot",
|
|
f"cd {builddir} && install -d -m 755 {destdir}/usr/share/man/man8",
|
|
f"cd {builddir} && mv -v {destdir}/usr/share/man/man1/chroot.1 {destdir}/usr/share/man/man8/chroot.8",
|
|
f"cd {builddir} && sed -i 's/\"1\"/\"8\"/' {destdir}/usr/share/man/man8/chroot.8",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"install -v -m644 {builddir}/COPYING {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}"
|
|
]
|