dmaketgz 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. # docker-maketgz
  3. #
  4. #***************************************************************************
  5. # _ _ ____ _
  6. # Project ___| | | | _ \| |
  7. # / __| | | | |_) | |
  8. # | (__| |_| | _ <| |___
  9. # \___|\___/|_| \_\_____|
  10. #
  11. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  12. #
  13. # This software is licensed as described in the file COPYING, which
  14. # you should have received as part of this distribution. The terms
  15. # are also available at https://curl.se/docs/copyright.html.
  16. #
  17. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  18. # copies of the Software, and permit persons to whom the Software is
  19. # furnished to do so, under the terms of the COPYING file.
  20. #
  21. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  22. # KIND, either express or implied.
  23. #
  24. # SPDX-License-Identifier: curl
  25. #
  26. ###########################################################################
  27. set -eu
  28. version="${1:-}"
  29. if [ -z "$version" ]; then
  30. echo "Specify a version number!"
  31. exit
  32. fi
  33. timestamp="${2:-$(date -u +%s)}"
  34. if test -f Makefile; then
  35. make distclean
  36. fi
  37. docker build \
  38. --no-cache \
  39. --build-arg SOURCE_DATE_EPOCH="$timestamp" \
  40. --build-arg UID="$(id -u)" \
  41. --build-arg GID="$(id -g)" \
  42. -t curl/curl .
  43. docker run --rm -u "$(id -u):$(id -g)" \
  44. -v "$(pwd):/usr/src" -w /usr/src curl/curl sh -c "
  45. set -e
  46. autoreconf -fi
  47. ./configure --without-ssl --without-libpsl
  48. make -sj8
  49. ./scripts/maketgz $version"