release-tools.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. cat <<MOO
  31. # Release tools used for curl $version
  32. The following tools and their Debian package version numbers were used to
  33. produce this release tarball.
  34. MOO
  35. exists=$(command -v dpkg 2>/dev/null)
  36. if test ! -e "$exists"; then
  37. echo "(unknown, could not find dpkg)"
  38. exit
  39. fi
  40. debian() {
  41. echo "- $1: $(dpkg -l "$1" | grep ^ii | awk '{print $3}')"
  42. }
  43. debian autoconf
  44. debian automake
  45. debian libtool
  46. debian make
  47. debian perl
  48. debian git
  49. cat <<MOO
  50. # Reproduce the tarball
  51. - Clone the repo and checkout the tag: $tag
  52. - Install the same set of tools + versions as listed above
  53. ## Do a standard build
  54. - autoreconf -fi
  55. - ./configure [...]
  56. - make
  57. ## Generate the tarball with the same timestamp
  58. - export SOURCE_DATE_EPOCH=$timestamp
  59. - ./maketgz [version]
  60. MOO