Update Finnish translation
[nomnom.git] / autogen.sh
bloba5d9e046039a76c917d643906510b90f3df1ab3d
1 #!/bin/sh
2 # autogen.sh for nomnom.
4 source=.gitignore
5 cachedir=autom4te.cache
7 gen_manual()
9 echo "Generate manual..."
10 M4=m4/version.m4 ; MAN=doc/man1/nomnom.1 ; POD=$MAN.pod
11 VER=`perl -n -e'/(\d+)\.(\d+)\.(\d+)/ && print "$1.$2.$3"' < $M4` \
12 && pod2man -c "nomnom manual" -n nomnom -s 1 -r $VER $POD $MAN
13 return $?
16 cleanup()
18 echo "WARNING!
19 Removes _files_ listed in $source and $cachedir directory.
20 Last chance to bail out (^C) before we continue."
21 read n1
22 for file in `cat $source`; do # Remove files only.
23 [ -e "$file" ] && [ -f "$file" ] && rm -f "$file"
24 done
25 [ -e "$cachedir" ] && rm -rf "$cachedir"
26 rmdir -p config.aux 2>/dev/null
27 exit 0
30 help()
32 echo "Usage: $0 [-c|-h]
33 -h Show this help and exit
34 -c Make the source tree 'maintainer clean'
35 Run without options to (re)generate the configuration files."
36 exit 0
39 clean_flag=off
40 while [ $# -gt 0 ]
42 case "$1" in
43 -c) cleanup;;
44 -h) help;;
45 *) break;;
46 esac
47 shift
48 done
50 echo "Generate configuration files..." &&
51 autoreconf -if &&
52 gen_manual &&
53 echo "You can now run 'configure'"