logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

pass1.kaem (1311B)


  1. #!/bin/sh
  2. # SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
  3. # SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
  4. # SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
  5. #
  6. # SPDX-License-Identifier: GPL-3.0-or-later
  7. set -ex
  8. # Check tarball checksums
  9. checksum-transcriber sources
  10. sha256sum -c sources.SHA256SUM
  11. mkdir build
  12. cd build
  13. # Extract
  14. ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar
  15. untar --file ${pkg}.tar
  16. rm ${pkg}.tar
  17. cd ${pkg}
  18. # Prepare
  19. cp ../../mk/main.mk Makefile
  20. catm gzip.c.new ../../files/stat_override.c gzip.c
  21. cp gzip.c.new gzip.c
  22. # Remove generated crc table from util.c
  23. patch -Np1 -i ../../patches/removecrc.patch
  24. # Since IO redirection is not available yet, patch makecrc.c so that it writes
  25. # C code to file crc.c that can be appended to util.c
  26. patch -Np1 -i ../../patches/makecrc-write-to-file.patch
  27. tcc -static -o makecrc sample/makecrc.c
  28. ./makecrc
  29. catm util.c.new util.c crc.c
  30. cp util.c.new util.c
  31. # Build
  32. make
  33. # Install
  34. cp gzip ${BINDIR}/gzip
  35. cp gzip ${BINDIR}/gunzip
  36. chmod 755 ${BINDIR}/gzip
  37. chmod 755 ${BINDIR}/gunzip
  38. cd ../..
  39. # Checksums
  40. if match x${UPDATE_CHECKSUMS} xTrue; then
  41. sha256sum -o ${pkg}.checksums \
  42. /usr/bin/gzip
  43. cp ${pkg}.checksums ${SRCDIR}
  44. else
  45. sha256sum -c ${pkg}.checksums
  46. fi