-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/sh | ||
# | ||
# Use this script to easily make releases of Jansson. It configures | ||
# the source tree, and builds and signs all tarballs. | ||
|
||
die() { | ||
echo $1 >&2 | ||
exit 1 | ||
} | ||
|
||
confirm() { | ||
local answer | ||
read -p "$1 [yN]: " answer | ||
[ "$answer" = "Y" -o "$answer" = "y" ] || exit 0 | ||
} | ||
|
||
set -e | ||
[ -f configure.ac ] || die "Must be run at project root directory" | ||
|
||
# Determine version | ||
v=$(grep AC_INIT configure.ac | sed -r 's/.*, \[(.+?)\],.*/\1/') | ||
[ -n "$v" ] || die "Unable to determine version" | ||
confirm "Version is $v, proceed?" | ||
|
||
# Sanity checks | ||
vi=$(grep version-info src/Makefile.am | sed 's/^[ \t]*//g' | cut -d" " -f2) | ||
confirm "Libtool version-info is $vi, proceed?" | ||
|
||
r=$(grep 'Released ' CHANGES | head -n 1) | ||
confirm "Last CHANGES entry says \"$r\", proceed??" | ||
|
||
dv=$(grep ^version doc/conf.py | sed -r "s/.*'(.*)'.*/\1/") | ||
if [ "$dv" != "$v" ]; then | ||
die "Documentation version ($dv) doesn't match library version" | ||
fi | ||
|
||
[ -f Makefile ] && make distclean || true | ||
rm -f jansson-$v.tar.* | ||
rm -rf jansson-$v-doc | ||
rm -f jansson-$v-doc.tar.* | ||
|
||
autoreconf -fi | ||
./configure | ||
|
||
# Run tests and make gz source tarball | ||
: ${VALGRIND:=1} | ||
export VALGRIND | ||
make distcheck | ||
|
||
# Make bzip2 source tarball | ||
make dist-bzip2 | ||
|
||
# Sign source tarballs | ||
for s in gz bz2; do | ||
gpg --detach-sign --armor jansson-$v.tar.$s | ||
done | ||
|
||
# Build documentation | ||
make html | ||
mv doc/_build/html jansson-$v-doc | ||
|
||
# Make and sign documentation tarballs | ||
for s in gz bz2; do | ||
tar czf jansson-$v-doc.tar.$s jansson-$v-doc | ||
gpg --detach-sign --armor jansson-$v-doc.tar.$s | ||
done | ||
|
||
echo "All done" |