Project

General

Profile

Release-Procedure ยป packdist.sh

Creates new tarballs in distbuild/ with CHANGES/DOWNLOAD files (including make distcheck) - stbuehler, 2009-03-10 09:02

 
#!/bin/sh

SRCTEST=src/spawn-fcgi.c
PACKAGE=spawn-fcgi

# may take one argument for prereleases like
# ./packdist.sh [--nopack] rc1-r10

if [ ! -f ${SRCTEST} ]; then
echo "Current directory is not the source directory"
exit 1
fi

dopack=1
if [ "$1" = "--nopack" ]; then
dopack=0
shift
fi

append="$1"

function force() {
"$@" || {
echo "Command failed: $*"
exit 1
}
}

function genchanges() {
(
echo "h1. Changes"
echo
cat ../NEWS | sed "/^- ${version}/,/^-/p;d" | sed "/^- /d;/^$/d" | sed -e 's/^ \*/\*/'
) > CHANGES
return 0
}

if [ ${dopack} = "1" ]; then
force ./autogen.sh

if [ -d distbuild ]; then
# make distcheck may leave readonly files
chmod u+w -R distbuild
rm -rf distbuild
fi

force mkdir distbuild
force cd distbuild

force ../configure --prefix=/usr
version=`./config.status -V | head -n 1 | cut -d' ' -f3`
name="${PACKAGE}-${version}"

# force make
# force make check

force make distcheck
force make dist-gzip
force make dist-bzip2

if [ -n "${append}" ]; then
cp "${name}.tar.gz" "${name}${append}.tar.gz"
cp "${name}.tar.bz2" "${name}${append}.tar.bz2"
name="${name}${append}"
fi
fi

force md5sum "${name}.tar."{gz,bz2} > "${name}.md5sum"
force sha1sum "${name}.tar."{gz,bz2} > "${name}.sha1sum"

(
echo "h1. Downloads"
echo
echo "* http://www.lighttpd.net/download/${name}.tar.gz"
echo "** MD5: $(md5sum ${name}.tar.gz | cut -d' ' -f1)"
echo "** SHA1: $(sha1sum ${name}.tar.gz | cut -d' ' -f1)"
echo "* http://www.lighttpd.net/download/${name}.tar.bz2"
echo "** MD5: $(md5sum ${name}.tar.bz2 | cut -d' ' -f1)"
echo "** SHA1: $(sha1sum ${name}.tar.bz2 | cut -d' ' -f1)"
echo "* SHA1 checksums: http://www.lighttpd.net/download/${name}.sha1sum"
echo "* MD5 checksums: http://www.lighttpd.net/download/${name}.md5sum"
) > DOWNLOADS

force genchanges
    (1-1/1)