release-tools.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/sh
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  10. #
  11. # This software is licensed as described in the file COPYING, which
  12. # you should have received as part of this distribution. The terms
  13. # are also available at https://curl.se/docs/copyright.html.
  14. #
  15. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. # copies of the Software, and permit persons to whom the Software is
  17. # furnished to do so, under the terms of the COPYING file.
  18. #
  19. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  20. # KIND, either express or implied.
  21. #
  22. # SPDX-License-Identifier: curl
  23. #
  24. ###########################################################################
  25. set -eu
  26. # this should ideally be passed in
  27. timestamp=${1:-unknown}
  28. version=${2:-unknown}
  29. tag=$(echo "curl-$version" | tr '.' '_')
  30. commit=${3}
  31. if [ -n "$commit" ] && [ -r "docs/tarball-commit.txt.dist" ]; then
  32. # If commit is given, then the tag likely doesn't actually exist
  33. tag="$(cat docs/tarball-commit.txt.dist)"
  34. fi
  35. cat <<MOO
  36. # Release tools used for curl $version
  37. The following tools and their Debian package version numbers were used to
  38. produce this release tarball.
  39. MOO
  40. if ! command -v dpkg >/dev/null; then
  41. echo "Error: could not find dpkg" >&2
  42. exit 1
  43. fi
  44. debian() {
  45. echo "- $1: $(dpkg -l "$1" | grep ^ii | awk '{print $3}')"
  46. }
  47. debian autoconf
  48. debian automake
  49. debian libtool
  50. debian make
  51. debian perl
  52. debian git
  53. cat <<MOO
  54. # Reproduce the tarball
  55. - Clone the repo and checkout the tag/commit: $tag
  56. - Install the same set of tools + versions as listed above
  57. ## Do a standard build
  58. - autoreconf -fi
  59. - ./configure [...]
  60. - make
  61. ## Generate the tarball with the same timestamp
  62. - export SOURCE_DATE_EPOCH=$timestamp
  63. - ./scripts/maketgz [version]
  64. MOO