summaryrefslogtreecommitdiffstats
path: root/scripts/mk-w32-dist
blob: 4f27a99b2a30c9dd9432dac435fa006aec880d89 (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
86
87
88
#!/bin/sh
#
# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


set -e

cd dist-w32

bindir=..

if [ -f ../README ]; then
    srcdir=..
elif [ -f ../../README ]; then
    srcdir=../..
    bindir=..
elif [ -f ../../gnupg-stable/README ]; then
    srcdir=../../gnupg-stable
elif [ -f ../../../gnupg-stable/README ]; then
    srcdir=../../../gnupg-stable
else
    echo "cannot figure out the source dir" >&2
    exit 1
fi

version=$(sed -n 's/^#[ ]*define[ ][ ]*VERSION[ ][ ]*\"\([0-9.]*\)\"/\1/p' $bindir/config.h)
echo "building version $version"

rm * || true

cp ${bindir}/g10/gpg.exe gpg.exe
mingw32 strip gpg.exe
cp ${bindir}/g10/gpgv.exe gpgv.exe
mingw32 strip gpgv.exe
cp ${bindir}/tools/gpgsplit.exe gpgsplit.exe
mingw32 strip gpgsplit.exe

for i in FAQ; do
  cp ${bindir}/doc/$i .
  todos $i
done
man -Tlatin1 -l ${srcdir}/doc/gpg.1 | sed `printf "s/\b.//g"`  >gpg.man
todos gpg.man
man -Tlatin1 -l ${srcdir}/doc/gpgv.1 | sed `printf "s/\b.//g"`  >gpgv.man
todos gpgv.man
man -Tlatin1 -l ${srcdir}/doc/gnupg.7 | sed `printf "s/\b.//g"`  >gnupg.man
todos gnupg.man
for i in README COPYING; do
  cp ${srcdir}/$i .
  todos $i
done
for i in README.W32 gnupg-w32.reg; do
  cp ${srcdir}/doc/$i .
  todos $i
done


for i in ${srcdir}/po/*.po; do
   lang=$(basename $i .po)
   fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $i`
   case $lang in 
     cs|pl) toset="CP1250" ;;
     el|eo|et|ja|tr) toset="" ;;
      *) toset="CP850" ;;
   esac
   if [ -n "$toset" ]; then
       echo "$lang: converting from $fromset to $toset" >&2 
       iconv --silent --from-code=$fromset --to-code=$toset < $i | \
         sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=$toset/" | \
         msgfmt --output-file=$lang.mo -
   else
       echo "$lang: keeping $fromset" >&2 
       msgfmt --output-file=$lang.mo $i
   fi
done
zip -9 "gnupg-w32cli-${version}.zip" *