xref: /curl/scripts/release-tools.sh (revision c72dd0bb)
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
26set -eu
27
28# this should ideally be passed in
29timestamp=${1:-unknown}
30version=${2:-unknown}
31tag=$(echo "curl-$version" | tr '.' '_')
32commit=${3}
33if [ -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)"
36fi
37
38cat <<MOO
39# Release tools used for curl $version
40
41The following tools and their Debian package version numbers were used to
42produce this release tarball.
43
44MOO
45
46if ! command -v dpkg >/dev/null; then
47  echo "Error: could not find dpkg" >&2
48  exit 1
49fi
50
51debian() {
52  echo "- $1: $(dpkg -l "$1" | grep ^ii | awk '{print $3}')"
53}
54debian autoconf
55debian automake
56debian libtool
57debian make
58debian perl
59debian git
60
61cat <<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
79MOO
80