~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to scripts/mk-w32-dist

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Mueller
  • Date: 2005-03-29 10:30:32 UTC
  • Revision ID: james.westby@ubuntu.com-20050329103032-sj42n2ain3ipx310
Tags: upstream-1.9.15
ImportĀ upstreamĀ versionĀ 1.9.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
 
4
#
 
5
# This file is free software; as a special exception the author gives
 
6
# unlimited permission to copy and/or distribute it, with or without
 
7
# modifications, as long as this notice is preserved.
 
8
#
 
9
# This program is distributed in the hope that it will be useful, but
 
10
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 
11
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
12
 
 
13
 
 
14
set -e
 
15
 
 
16
cd dist-w32
 
17
 
 
18
bindir=..
 
19
 
 
20
if [ -f ../README ]; then
 
21
    srcdir=..
 
22
elif [ -f ../../README ]; then
 
23
    srcdir=../..
 
24
    bindir=..
 
25
elif [ -f ../../gnupg-stable/README ]; then
 
26
    srcdir=../../gnupg-stable
 
27
elif [ -f ../../../gnupg-stable/README ]; then
 
28
    srcdir=../../../gnupg-stable
 
29
else
 
30
    echo "cannot figure out the source dir" >&2
 
31
    exit 1
 
32
fi
 
33
 
 
34
if i586-mingw32msvc-strip --version >/dev/null 2>&1 ; then
 
35
   STRIP=i586-mingw32msvc-strip
 
36
else
 
37
   STRIP="mingw32 strip"
 
38
fi
 
39
 
 
40
 
 
41
version=$(sed -n 's/^#[ ]*define[ ][ ]*VERSION[ ][ ]*\"\([0-9.a-z-]*\)\"/\1/p' $bindir/config.h)
 
42
echo "building version $version"
 
43
 
 
44
rm * >/dev/null 2>/dev/null || true
 
45
 
 
46
cp ${bindir}/g10/gpg.exe gpg.exe
 
47
$STRIP gpg.exe
 
48
cp ${bindir}/g10/gpgv.exe gpgv.exe
 
49
$STRIP gpgv.exe
 
50
for name in hkp http ldap finger; do 
 
51
  cp ${bindir}/keyserver/gpgkeys_$name.exe gpgkeys_$name.exe
 
52
  $STRIP gpgkeys_$name.exe
 
53
done
 
54
cp ${bindir}/tools/gpgsplit.exe gpgsplit.exe
 
55
$STRIP gpgsplit.exe
 
56
 
 
57
for i in FAQ; do
 
58
  cp ${bindir}/doc/$i $i.txt
 
59
  todos $i.txt
 
60
done
 
61
man -Tlatin1 -l ${srcdir}/doc/gpg.1 | sed `printf "s/\b.//g"`  >gpg.man
 
62
todos gpg.man
 
63
man -Tlatin1 -l ${srcdir}/doc/gpgv.1 | sed `printf "s/\b.//g"`  >gpgv.man
 
64
todos gpgv.man
 
65
man -Tlatin1 -l ${srcdir}/doc/gnupg.7 | sed `printf "s/\b.//g"`  >gnupg.man
 
66
todos gnupg.man
 
67
for i in README COPYING NEWS; do
 
68
  cp ${srcdir}/$i $i.txt
 
69
  todos $i.txt
 
70
done
 
71
for i in README.W32 gnupg-w32.reg; do
 
72
  cp ${srcdir}/doc/$i .
 
73
  todos $i
 
74
done
 
75
 
 
76
# We must distribute the MO files in UTF-8, the conversion is done by
 
77
# gpg at runtime.
 
78
for i in ${srcdir}/po/*.po; do
 
79
   lang=$(basename $i .po)
 
80
   grep -s $lang ${srcdir}/po/LINGUAS >/dev/null || continue
 
81
 
 
82
   fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $i`
 
83
   case "$fromset" in 
 
84
     utf8|utf-8|UTF8|UTF-8) 
 
85
       echo "$lang: keeping $fromset" >&2 
 
86
       msgfmt --output-file=$lang.mo $i
 
87
       ;;
 
88
     *)
 
89
       echo "$lang: converting from $fromset to utf-8" >&2 
 
90
       iconv --silent --from-code=$fromset --to-code=utf-8 < $i | \
 
91
         sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/" | \
 
92
         msgfmt --output-file=$lang.mo -
 
93
       ;;
 
94
   esac
 
95
done
 
96
zip -9 "gnupg-w32cli-${version}.zip" *
 
97
if makensis -version >/dev/null 2>&1 ; then
 
98
  makensis -v2 -nocd -DVERSION="${version}" ${srcdir}/scripts/w32installer.nsi
 
99
fi