make depend
[darkstat] / release.sh
1 #!/bin/sh
2 #
3 # release.sh: script to roll a release tarball of darkstat.
4 # copyright (c) 2006-2013 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 # Release checklist:
10 # - git tag 3.0.xxx
11 # - git push --tags
12 # - Update website
13 # - Mail announcement to darkstat-announce@googlegroups.com
14 # - Update FreeBSD port, eg: http://www.freebsd.org/cgi/query-pr.cgi?pr=181277
15 # - Update freecode.com
16 #
17 if [ $# -ne 1 ]; then
18 echo "usage: $0 3.0.0rc0" >&2
19 exit 1
20 fi
21
22 NAME=darkstat
23 VERSION="$1"
24
25 files="\
26 AUTHORS \
27 ChangeLog \
28 COPYING.GPL \
29 INSTALL \
30 LICENSE \
31 Makefile.in \
32 NEWS \
33 README \
34 acct.c \
35 acct.h \
36 addr.c \
37 addr.h \
38 bsd.c \
39 bsd.h \
40 cap.c \
41 cap.h \
42 cdefs.h \
43 contrib \
44 conv.c \
45 conv.h \
46 darkstat.8.in \
47 darkstat.c \
48 daylog.c \
49 daylog.h \
50 db.c \
51 db.h \
52 decode.c \
53 decode.h \
54 dns.c \
55 dns.h \
56 err.c \
57 err.h \
58 export-format.txt \
59 graph_db.c \
60 graph_db.h \
61 graphjs.h \
62 hosts_db.c \
63 hosts_db.h \
64 hosts_sort.c \
65 html.c \
66 html.h \
67 http.c \
68 http.h \
69 install-sh \
70 localip.c \
71 localip.h \
72 ncache.c \
73 ncache.h \
74 now.c \
75 now.h \
76 opt.h \
77 pidfile.c \
78 pidfile.h \
79 queue.h \
80 static \
81 str.c \
82 str.h \
83 stylecss.h \
84 tree.h \
85 "
86 # end packing list
87
88 say() {
89 echo ==\> "$@" >&2
90 }
91
92 run() {
93 say "$@"
94 "$@" || { say ERROR!; exit 1; }
95 }
96
97 PKG=$NAME-$VERSION
98 say releasing $PKG
99 run make depend
100 run make graphjs.h stylecss.h
101 run autoconf
102 run autoheader
103 run ./config.status
104 run ./test_headers.sh
105 if git status --porcelain | egrep -v '^\?\?' -q; then
106 say ERROR: uncommitted changes:
107 git status
108 exit 1
109 fi
110 run mkdir $PKG
111 run cp -r $files $PKG/.
112 run sed -e "/AC_INIT/s/darkstat, [^,)]*/darkstat, $VERSION/" configure.ac > $PKG/configure.ac
113 say set version: `grep '^AC_INIT' $PKG/configure.ac`
114 (cd $PKG
115 run autoconf
116 run autoheader
117 run rm -r autom4te.cache
118 ) || exit 1
119
120 # package it up
121 run tar chof $PKG.tar $PKG
122 run bzip2 -9vv $PKG.tar
123 say output:
124 ls -l $PKG.tar.bz2
125 say FINISHED!