#!/bin/sh
#
# release.sh: script to roll a release tarball of darkstat.
-# copyright (c) 2006-2009 Emil Mikulic.
+# copyright (c) 2006-2011 Emil Mikulic.
#
# This is for developer use only and lives in the repo but
# shouldn't end up in a tarball.
#
-# Remember to run "make depend" to update deps in Makefile.in
-#
-
if [ $# -ne 1 ]; then
- echo "usage: $0 version" >&2
+ echo "usage: $0 3.0.0rc0" >&2
exit 1
fi
Makefile.in \
NEWS \
README \
-THANKS \
acct.c \
acct.h \
+addr.c \
+addr.h \
+bsd.c \
+bsd.h \
cap.c \
cap.h \
+cdefs.h \
contrib \
conv.c \
conv.h \
-darkstat.8 \
+darkstat.8.in \
darkstat.c \
-darkstat.h \
daylog.c \
daylog.h \
db.c \
export-format.txt \
graph_db.c \
graph_db.h \
+graphjs.h \
hosts_db.c \
hosts_db.h \
hosts_sort.c \
+html.c \
html.h \
http.c \
http.h \
ncache.c \
ncache.h \
now.h \
+opt.h \
pidfile.c \
pidfile.h \
queue.h \
static \
str.c \
str.h \
+stylecss.h \
tree.h \
"
# end packing list
-PKG=$NAME-$VERSION
-echo ==\> releasing $PKG
+say() {
+ echo ==\> "$@" >&2
+}
run() {
- echo ==\> $@
- eval $@ || { echo ERROR!; exit 1; }
+ say "$@"
+ "$@" || { say ERROR!; exit 1; }
}
+PKG=$NAME-$VERSION
+say releasing $PKG
+run make depend
+run make graphjs.h stylecss.h
+run autoconf
+run autoheader
+run ./config.status
+run ./test_headers.sh
+if git status --porcelain | egrep -v '^\?\?' -q; then
+ say ERROR: uncommitted changes:
+ git status
+ exit 1
+fi
run mkdir $PKG
run cp -r $files $PKG/.
-
-# set the version number
-(echo "AC_INIT(darkstat, $VERSION)"
- grep -v "^AC_INIT" configure.ac) > $PKG/configure.ac
-
-echo ==\> set version: `grep '^AC_INIT' $PKG/configure.ac`
-(
- cd $PKG
+run sed -e "/AC_INIT/s/darkstat, [^,)]*/darkstat, $VERSION/" configure.ac > $PKG/configure.ac
+say set version: `grep '^AC_INIT' $PKG/configure.ac`
+(cd $PKG
run autoconf
run autoheader
run rm -r autom4te.cache
-)
+) || exit 1
# package it up
-run tar -cf $PKG.tar $PKG
+run tar chof $PKG.tar $PKG
run bzip2 -9vv $PKG.tar
-echo ==\> output:
+say output:
ls -l $PKG.tar.bz2
-echo ==\> FINISHED!
+say FINISHED!