summaryrefslogtreecommitdiff
path: root/bootstrap
blob: 6939cdc2671c4db64e1ab70543dbdc52167502e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#! /bin/sh

# Bootstrap this package from git.
#
# Copyright 1997, 1998, 2005, 2006, 2007, 2008, 2009 Free Software
# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

package=grep

# Translation Project rsync URL
TP_URL=translationproject.org::tp/latest

# Ensure file names are sorted consistently across platforms.
# Also, ensure diagnostics are in English, e.g., "wget --help" below.
LC_ALL=C
export LC_ALL

# Parse options.

for option
do
  case $option in
  --help)
    echo "$0: usage: $0 [--skip-po]"
    exit;;
  --skip-po)
    SKIP_PO=t;;
  *)
    echo >&2 "$0: $option: unknown option"
    exit 1;;
  esac
done


# Get translations.

get_translations() {
  echo "$0: getting translations into $1 for $2..."
  rsync -Lrtvz "$TP_URL/$2/" "$1"
}

docmd () {
  echo "$0: $* ..."
  "$@" && return
  exit_status=$?
  echo
  echo "An error occurred."
  exit $exit_status
}

case $SKIP_PO in
'') get_translations po $package || exit
esac


# Generate autoconf and automake snippets.

docmd autopoint --force

# Undo modifications to macros by autopoint.

(cd m4 && git diff . | patch -R -p2)

# Make sure aclocal.m4 is not older than input files.
sleep 1

docmd aclocal --force -I m4
docmd autoconf --force
docmd autoheader --force
docmd automake --add-missing --copy --force-missing

echo "Next, run ./configure && make && make check"