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