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