Script to test if headers are self-sufficient.
[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.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 pidfile.c \
66 pidfile.h \
67 queue.h \
68 static \
69 str.c \
70 str.h \
71 tree.h \
72 "
73 # end packing list
74
75 PKG=$NAME-$VERSION
76 echo ==\> releasing $PKG
77
78 run() {
79 echo ==\> $@
80 eval $@ || { echo ERROR!; exit 1; }
81 }
82
83 run mkdir $PKG
84 run cp -r $files $PKG/.
85
86 # set the version number
87 (echo "AC_INIT(darkstat, $VERSION)"
88 grep -v "^AC_INIT" configure.ac) > $PKG/configure.ac
89
90 echo ==\> set version: `grep '^AC_INIT' $PKG/configure.ac`
91 (
92 cd $PKG
93 run autoconf
94 run autoheader
95 run rm -r autom4te.cache
96 )
97
98 # package it up
99 run tar -cf $PKG.tar $PKG
100 run bzip2 -9vv $PKG.tar
101 echo ==\> output:
102 ls -l $PKG.tar.bz2
103 echo ==\> FINISHED!