2021-01-11 20:44:07 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-02-08 06:23:31 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
2022-03-07 07:58:20 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
|
2021-03-15 13:22:27 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
|
2021-02-08 06:23:31 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-01-11 20:44:07 +00:00
|
|
|
set -ex
|
|
|
|
|
2022-09-29 11:35:31 +01:00
|
|
|
# Check tarball checksums
|
|
|
|
checksum-transcriber sources
|
|
|
|
sha256sum -c sources.SHA256SUM
|
|
|
|
|
2022-04-13 00:08:29 +01:00
|
|
|
mkdir build src
|
2021-01-20 01:43:40 +00:00
|
|
|
cd build
|
|
|
|
|
|
|
|
# Extract
|
2023-11-28 02:16:09 +00:00
|
|
|
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ../src/${pkg}.tar
|
2022-06-02 22:44:02 +01:00
|
|
|
untar --file ../src/${pkg}.tar
|
|
|
|
rm ../src/${pkg}.tar
|
2021-01-20 01:43:40 +00:00
|
|
|
cd ${pkg}
|
|
|
|
|
2022-01-14 05:24:39 +00:00
|
|
|
# Prepare
|
2022-05-14 19:40:52 +01:00
|
|
|
cp ../../mk/main.mk Makefile
|
2022-01-14 05:24:39 +00:00
|
|
|
catm gzip.c.new ../../files/stat_override.c gzip.c
|
|
|
|
cp gzip.c.new gzip.c
|
|
|
|
|
2023-05-31 18:43:21 +01:00
|
|
|
# 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
|
|
|
|
|
2022-05-14 19:40:52 +01:00
|
|
|
# Build
|
|
|
|
make
|
2021-01-11 20:44:07 +00:00
|
|
|
|
|
|
|
# Install
|
2023-11-28 02:16:09 +00:00
|
|
|
cp gzip ${BINDIR}/gzip
|
|
|
|
cp gzip ${BINDIR}/gunzip
|
|
|
|
chmod 755 ${BINDIR}/gzip
|
|
|
|
chmod 755 ${BINDIR}/gunzip
|
2021-01-20 01:43:40 +00:00
|
|
|
|
|
|
|
cd ../..
|
2021-02-13 06:29:49 +00:00
|
|
|
|
|
|
|
# Checksums
|
2022-05-20 15:55:35 +01:00
|
|
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
|
|
|
sha256sum -o ${pkg}.checksums \
|
|
|
|
/usr/bin/gzip
|
|
|
|
|
2023-11-28 02:16:09 +00:00
|
|
|
cp ${pkg}.checksums ${SRCDIR}
|
2022-05-20 15:55:35 +01:00
|
|
|
else
|
|
|
|
sha256sum -c ${pkg}.checksums
|
|
|
|
fi
|