#!/bin/sh # SPDX-FileCopyrightText: 2021 Andrius Štikonas # SPDX-FileCopyrightText: 2021-22 fosslinux # SPDX-FileCopyrightText: 2021 Paul Dersey # # SPDX-License-Identifier: GPL-3.0-or-later set -ex # Check tarball checksums checksum-transcriber sources sha256sum -c sources.SHA256SUM mkdir build src cd build # Extract ungz --file ${distfiles}/${pkg}.tar.gz --output ../src/${pkg}.tar untar --file ../src/${pkg}.tar rm ../src/${pkg}.tar cd ${pkg} # Prepare cp ../../mk/main.mk Makefile catm gzip.c.new ../../files/stat_override.c gzip.c cp gzip.c.new gzip.c # Remove generated crc table from util.c patch -Np0 -i ../../patches/removecrc.patch # Since IO redirection is not available yet, patch makecrc.c so that it writes # C code to file crc.c that can be appended to util.c patch -Np0 -i ../../patches/makecrc-write-to-file.patch tcc -static -o makecrc sample/makecrc.c ./makecrc catm util.c.new util.c crc.c cp util.c.new util.c # Build make # Install cp gzip ${bindir}/gzip cp gzip ${bindir}/gunzip chmod 755 ${bindir}/gzip chmod 755 ${bindir}/gunzip cd ../.. # Checksums if match x${UPDATE_CHECKSUMS} xTrue; then sha256sum -o ${pkg}.checksums \ /usr/bin/gzip cp ${pkg}.checksums ${srcdir} else sha256sum -c ${pkg}.checksums fi