Remove includes of darkstat.h, add cdefs.h where needed.
[darkstat.git] / 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"
10 # Remember to run "make depend" to update deps in Makefile.in
11 #
12
13 if [ $# -ne 1 ]; then
14   echo "usage: $0 3.0.0rc0" >&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 addr.c \
33 addr.h \
34 cap.c \
35 cap.h \
36 cdefs.h \
37 contrib \
38 conv.c \
39 conv.h \
40 darkstat.8.in \
41 darkstat.c \
42 daylog.c \
43 daylog.h \
44 db.c \
45 db.h \
46 decode.c \
47 decode.h \
48 dns.c \
49 dns.h \
50 err.c \
51 err.h \
52 export-format.txt \
53 graph_db.c \
54 graph_db.h \
55 graphjs.h \
56 hosts_db.c \
57 hosts_db.h \
58 hosts_sort.c \
59 html.c \
60 html.h \
61 http.c \
62 http.h \
63 install-sh \
64 localip.c \
65 localip.h \
66 ncache.c \
67 ncache.h \
68 now.h \
69 opt.h \
70 pidfile.c \
71 pidfile.h \
72 queue.h \
73 static \
74 str.c \
75 str.h \
76 stylecss.h \
77 tree.h \
78 "
79 # end packing list
80
81 say() {
82   echo ==\> "$@" >&2
83 }
84
85 PKG=$NAME-$VERSION
86 say releasing $PKG
87
88 run() {
89   say "$@"
90   "$@" || { say ERROR!; exit 1; }
91 }
92
93 run mkdir $PKG
94 run cp -r $files $PKG/.
95
96 # set the version number
97 run sed -e "/AC_INIT/s/darkstat, [^,)]*/darkstat, $VERSION/" configure.ac > $PKG/configure.ac
98
99 say set version: `grep '^AC_INIT' $PKG/configure.ac`
100 (
101  cd $PKG
102  run autoconf
103  run autoheader
104  run rm -r autom4te.cache
105 )
106
107 # package it up
108 run tar -cf $PKG.tar $PKG
109 run bzip2 -9vv $PKG.tar
110 say output:
111 ls -l $PKG.tar.bz2
112 say FINISHED!