Try to build with IPv6 by default.
[darkhttpd] / release.sh
1 #!/bin/sh
2 #
3 # release.sh: script to roll a release tarball.
4 # copyright (c) 2006-2013 Emil Mikulic.
5 #
6 # This is for developer use only and lives in the git repo but
7 # shouldn't end up in a tarball.
8 #
9 if [ $# -ne 1 ]; then
10 echo "usage: $0 1.123" >&2
11 exit 1
12 fi
13
14 NAME=darkhttpd
15 VERSION="$1"
16
17 files="\
18 Makefile \
19 darkhttpd.c \
20 README \
21 "
22
23 say() {
24 echo ==\> "$@" >&2
25 }
26
27 run() {
28 say "$@"
29 "$@" || { say ERROR!; exit 1; }
30 }
31
32 PKG=$NAME-$VERSION
33 say releasing $PKG
34 devel/clang-warns
35 devel/warns
36 # TODO: checker, tests
37 if git status --porcelain | egrep -v '^\?\?' -q; then
38 say ERROR: uncommitted changes:
39 git status
40 exit 1
41 fi
42 run mkdir $PKG
43 run cp -r $files $PKG/.
44 sed -r -e \
45 '/pkgname\[\]\s+= "/s/"darkhttpd\/[^"]+"/"'$NAME'\/'$VERSION'"/' \
46 darkhttpd.c > $PKG/darkhttpd.c || { echo sed failed; exit 1; }
47 # package it up
48 run tar chof $PKG.tar $PKG
49 run bzip2 -9vv $PKG.tar
50 say output:
51 ls -l $PKG.tar.bz2
52 say FINISHED!