Update ChangeLog for 3.0.717.
[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 bsd.c \
31 bsd.h \
32 cap.c \
33 cap.h \
34 cdefs.h \
35 contrib \
36 conv.c \
37 conv.h \
38 darkstat.8.in \
39 darkstat.c \
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 graphjs.h \
54 hosts_db.c \
55 hosts_db.h \
56 hosts_sort.c \
57 html.c \
58 html.h \
59 http.c \
60 http.h \
61 install-sh \
62 localip.c \
63 localip.h \
64 ncache.c \
65 ncache.h \
66 now.c \
67 now.h \
68 opt.h \
69 pidfile.c \
70 pidfile.h \
71 queue.h \
72 static \
73 str.c \
74 str.h \
75 stylecss.h \
76 tree.h \
77 "
78 # end packing list
79
80 say() {
81 echo ==\> "$@" >&2
82 }
83
84 run() {
85 say "$@"
86 "$@" || { say ERROR!; exit 1; }
87 }
88
89 PKG=$NAME-$VERSION
90 say releasing $PKG
91 run make depend
92 run make graphjs.h stylecss.h
93 run autoconf
94 run autoheader
95 run ./config.status
96 run ./test_headers.sh
97 if git status --porcelain | egrep -v '^\?\?' -q; then
98 say ERROR: uncommitted changes:
99 git status
100 exit 1
101 fi
102 run mkdir $PKG
103 run cp -r $files $PKG/.
104 run sed -e "/AC_INIT/s/darkstat, [^,)]*/darkstat, $VERSION/" configure.ac > $PKG/configure.ac
105 say set version: `grep '^AC_INIT' $PKG/configure.ac`
106 (cd $PKG
107 run autoconf
108 run autoheader
109 run rm -r autom4te.cache
110 ) || exit 1
111
112 # package it up
113 run tar chof $PKG.tar $PKG
114 run bzip2 -9vv $PKG.tar
115 say output:
116 ls -l $PKG.tar.bz2
117 say FINISHED!