Skip to content

Commit 8c209ee

Browse files
committed
Change tarball making procedure
Since recently, OpenSSL tarballs are produced with 'make tar' rather than 'make dist', as the latter has turned out to be more troublesome than useful. The next step to look at is why we would need to configure at all to produce a Makefile just to produce a tarball. After all, the tarball should now only contain source files that are present even without configuring. Furthermore, the current method for producing tarballs is a bit complex, and can be greatly simplified with the right tools. Since we have everything versioned with git, we might as well use the tool that comes with it. Added: util/mktar.sh, a simple script to produce OpenSSL tarballs. It takes the options --name to modify the prefix of the distribution, and --tarfile tp modify the tarball file name specifically. This also adds a few entries in .gitattributes to specify files that should never end up in a distribution tarball. Reviewed-by: Matt Caswell <[email protected]> (Merged from openssl#7692)
1 parent 4b801fd commit 8c209ee

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Diff for: .gitattributes

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
*.der binary
22
/fuzz/corpora/** binary
33
*.pfx binary
4+
5+
# For git archive
6+
fuzz/corpora/** export-ignore
7+
Configurations/*.norelease.conf export-ignore
8+
.* export-ignore

Diff for: util/mktar.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /bin/sh
2+
3+
HERE=`dirname $0`
4+
5+
version=`grep 'OPENSSL_VERSION_TEXT *"OpenSSL' $HERE/../include/openssl/opensslv.h | sed -e 's|.*"OpenSSL ||' -e 's| .*||'`
6+
basename=openssl
7+
8+
NAME="$basename-$version"
9+
10+
while [ $# -gt 0 ]; do
11+
case "$1" in
12+
--name=* ) NAME=`echo "$1" | sed -e 's|[^=]*=||'` ;;
13+
--name ) shift; NAME="$1" ;;
14+
--tarfile=* ) TARFILE=`echo "$1" | sed -e 's|[^=]*=||'` ;;
15+
--tarfile ) shift; TARFILE="$1" ;;
16+
* ) echo >&2 "Could not parse '$1'"; exit 1 ;;
17+
esac
18+
shift
19+
done
20+
21+
if [ -z "$TARFILE" ]; then TARFILE="$NAME.tar"; fi
22+
23+
# This counts on .gitattributes to specify what files should be ignored
24+
git archive --worktree-attributes --format=tar --prefix="$NAME/" -v HEAD \
25+
| gzip -9 > "$TARFILE.gz"
26+
27+
ls -l "$TARFILE.gz"

0 commit comments

Comments
 (0)