Automate release more - run test, make depend.
[darkstat] / release.sh
1 #!/bin/sh
2 #
3 # release.sh: script to roll a release tarball of darkstat.
4 # copyright (c) 2006-2011 Emil Mikulic.
5 #
6 # This is for developer use only and lives in the repo but
7 # shouldn't end up in a tarball.
8 #
9 if [ $# -ne 1 ]; then
10 echo "usage: $0 3.0.0rc0" >&2
11 exit 1
12 fi
13
14 NAME=darkstat
15 VERSION="$1"
16
17 files="\
18 AUTHORS \
19 ChangeLog \
20 COPYING.GPL \
21 INSTALL \
22 LICENSE \
23 Makefile.in \
24 NEWS \
25 README \
26 acct.c \
27 acct.h \
28 addr.c \
29 addr.h \
30 cap.c \
31 cap.h \
32 cdefs.h \
33 contrib \
34 conv.c \
35 conv.h \
36 darkstat.8.in \
37 darkstat.c \
38 daylog.c \
39 daylog.h \
40 db.c \
41 db.h \
42 decode.c \
43 decode.h \
44 dns.c \
45 dns.h \
46 err.c \
47 err.h \
48 export-format.txt \
49 graph_db.c \
50 graph_db.h \
51 graphjs.h \
52 hosts_db.c \
53 hosts_db.h \
54 hosts_sort.c \
55 html.c \
56 html.h \
57 http.c \
58 http.h \
59 install-sh \
60 localip.c \
61 localip.h \
62 ncache.c \
63 ncache.h \
64 now.h \
65 opt.h \
66 pidfile.c \
67 pidfile.h \
68 queue.h \
69 static \
70 str.c \
71 str.h \
72 stylecss.h \
73 tree.h \
74 "
75 # end packing list
76
77 say() {
78 echo ==\> "$@" >&2
79 }
80
81 run() {
82 say "$@"
83 "$@" || { say ERROR!; exit 1; }
84 }
85
86 PKG=$NAME-$VERSION
87 say releasing $PKG
88
89 run ./test_headers.sh
90 run make depend
91 run make graphjs.h stylecss.h
92 run mkdir $PKG
93 run cp -r $files $PKG/.
94
95 # set the version number
96 run sed -e "/AC_INIT/s/darkstat, [^,)]*/darkstat, $VERSION/" configure.ac > $PKG/configure.ac
97
98 say set version: `grep '^AC_INIT' $PKG/configure.ac`
99 (
100 cd $PKG
101 run autoconf
102 run autoheader
103 run rm -r autom4te.cache
104 )
105
106 # package it up
107 run tar chof $PKG.tar $PKG
108 run bzip2 -9vv $PKG.tar
109 say output:
110 ls -l $PKG.tar.bz2
111 say FINISHED!