release-tools.sh (2103B)
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 26 set -eu 27 28 # this should ideally be passed in 29 timestamp=${1:-unknown} 30 version=${2:-unknown} 31 tag=$(echo "curl-$version" | tr '.' '_') 32 commit=${3} 33 if [ -n "$commit" ] && [ -r "docs/tarball-commit.txt.dist" ]; then 34 # If commit is given, then the tag likely doesn't actually exist 35 tag="$(cat docs/tarball-commit.txt.dist)" 36 fi 37 38 cat <<MOO 39 # Release tools used for curl $version 40 41 The following tools and their Debian package version numbers were used to 42 produce this release tarball. 43 44 MOO 45 46 if ! command -v dpkg >/dev/null; then 47 echo "Error: could not find dpkg" >&2 48 exit 1 49 fi 50 51 debian() { 52 echo "- $1: $(dpkg -l "$1" | grep ^ii | awk '{print $3}')" 53 } 54 debian autoconf 55 debian automake 56 debian libtool 57 debian make 58 debian perl 59 debian git 60 61 cat <<MOO 62 63 # Reproduce the tarball 64 65 - Clone the repo and checkout the tag/commit: $tag 66 - Install the same set of tools + versions as listed above 67 68 ## Do a standard build 69 70 - autoreconf -fi 71 - ./configure [...] 72 - make 73 74 ## Generate the tarball with the same timestamp 75 76 - export SOURCE_DATE_EPOCH=$timestamp 77 - ./scripts/maketgz [version] 78 79 MOO