Rename 0.2.20 -> 0.4.0
[quvi.git] / autogen.sh
blob31a62feb4963d758cb2c6cc2abdb36e01353c8e9
1 #!/bin/sh
2 # autogen.sh for quvi.
4 source=.gitignore
5 cachedir=autom4te.cache
7 gen_cmdline()
9 echo "Generate cmdline..."
10 gengetopt < src/quvi/cmdline.ggo \
11 -C --unamed-opts=URL --output-dir src/quvi --no-version
14 gen_manual()
16 echo "Generate manual..."
17 M4=m4/version.m4 ; MAN=doc/man1/quvi.1 ; POD=$MAN.pod
18 VER=`perl -n -e'/(\d+)\.(\d+)\.(\d+)/ && print "$1.$2.$3"' < $M4` \
19 && pod2man -c "quvi manual" -n quvi -s 1 -r $VER $POD $MAN
20 return $?
23 cleanup()
25 echo "WARNING!
26 Removes _files_ listed in $source and $cachedir directory.
27 Last chance to bail out (^C) before we continue."
28 read n1
29 for file in `cat $source`; do # Remove files only.
30 [ -e "$file" ] && [ -f "$file" ] && rm -f "$file"
31 done
32 [ -e "$cachedir" ] && rm -rf "$cachedir"
33 exit 0
36 help()
38 echo "Usage: $0 [-c|-h]
39 -h Show this help and exit
40 -c Make the source tree 'maintainer clean'
41 Run without options to (re)generate the configuration files."
42 exit 0
45 while [ $# -gt 0 ]
47 case "$1" in
48 -c) cleanup;;
49 -h) help;;
50 *) break;;
51 esac
52 shift
53 done
55 echo "Generate configuration files..."
56 autoreconf -if \
57 && gen_cmdline \
58 && gen_manual \
59 && echo "You can now run 'configure'"