2002-06-29 15:46:34 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-10-27 18:32:51 +02:00
|
|
|
# Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
|
2002-06-29 15:46:34 +02:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
2002-06-30 09:39:53 +02:00
|
|
|
bindir=..
|
|
|
|
|
2002-06-29 15:46:34 +02:00
|
|
|
if [ -f ../README ]; then
|
|
|
|
srcdir=..
|
2002-06-30 09:39:53 +02:00
|
|
|
elif [ -f ../../README ]; then
|
|
|
|
srcdir=../..
|
|
|
|
bindir=..
|
2002-06-29 15:46:34 +02:00
|
|
|
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
|
|
|
|
|
2004-10-27 18:32:51 +02:00
|
|
|
if i586-mingw32msvc-strip --version >/dev/null 2>&1 ; then
|
|
|
|
STRIP=i586-mingw32msvc-strip
|
|
|
|
else
|
|
|
|
STRIP="mingw32 strip"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
version=$(sed -n 's/^#[ ]*define[ ][ ]*VERSION[ ][ ]*\"\([0-9.a-z-]*\)\"/\1/p' $bindir/config.h)
|
2005-01-17 11:19:57 +01:00
|
|
|
prod_version=$(echo "$version"|awk -F'[^0-9]' '{print $1 "." $2 "." $3 ".1"}')
|
|
|
|
echo "building version $version ($prod_version)"
|
2002-06-30 09:39:53 +02:00
|
|
|
|
2005-01-11 13:03:22 +01:00
|
|
|
rm * >/dev/null 2>/dev/null || true
|
2002-09-02 15:44:29 +02:00
|
|
|
|
|
|
|
cp ${bindir}/g10/gpg.exe gpg.exe
|
2004-10-27 18:32:51 +02:00
|
|
|
$STRIP gpg.exe
|
2002-09-02 15:44:29 +02:00
|
|
|
cp ${bindir}/g10/gpgv.exe gpgv.exe
|
2004-10-27 18:32:51 +02:00
|
|
|
$STRIP gpgv.exe
|
2004-10-28 11:06:50 +02:00
|
|
|
for name in hkp http ldap finger; do
|
2004-10-27 18:32:51 +02:00
|
|
|
cp ${bindir}/keyserver/gpgkeys_$name.exe gpgkeys_$name.exe
|
|
|
|
$STRIP gpgkeys_$name.exe
|
|
|
|
done
|
2002-09-02 15:44:29 +02:00
|
|
|
cp ${bindir}/tools/gpgsplit.exe gpgsplit.exe
|
2004-10-27 18:32:51 +02:00
|
|
|
$STRIP gpgsplit.exe
|
2002-09-02 15:44:29 +02:00
|
|
|
|
|
|
|
for i in FAQ; do
|
2005-01-11 13:03:22 +01:00
|
|
|
cp ${bindir}/doc/$i $i.txt
|
|
|
|
todos $i.txt
|
2002-09-02 15:44:29 +02:00
|
|
|
done
|
|
|
|
man -Tlatin1 -l ${srcdir}/doc/gpg.1 | sed `printf "s/\b.//g"` >gpg.man
|
2002-06-29 15:46:34 +02:00
|
|
|
todos gpg.man
|
2002-09-02 15:44:29 +02:00
|
|
|
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
|
2005-01-11 13:03:22 +01:00
|
|
|
for i in README COPYING NEWS; do
|
|
|
|
cp ${srcdir}/$i $i.txt
|
|
|
|
todos $i.txt
|
2002-09-02 15:44:29 +02:00
|
|
|
done
|
|
|
|
for i in README.W32 gnupg-w32.reg; do
|
|
|
|
cp ${srcdir}/doc/$i .
|
|
|
|
todos $i
|
|
|
|
done
|
|
|
|
|
2005-01-11 13:03:22 +01:00
|
|
|
# We must distribute the MO files in UTF-8, the conversion is done by
|
2004-10-27 18:32:51 +02:00
|
|
|
# gpg at runtime.
|
2002-09-11 14:56:56 +02:00
|
|
|
for i in ${srcdir}/po/*.po; do
|
|
|
|
lang=$(basename $i .po)
|
2004-10-27 18:32:51 +02:00
|
|
|
grep -s $lang ${srcdir}/po/LINGUAS >/dev/null || continue
|
|
|
|
|
2002-09-11 14:56:56 +02:00
|
|
|
fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $i`
|
2004-10-27 18:32:51 +02:00
|
|
|
case "$fromset" in
|
|
|
|
utf8|utf-8|UTF8|UTF-8)
|
2002-09-11 14:56:56 +02:00
|
|
|
echo "$lang: keeping $fromset" >&2
|
|
|
|
msgfmt --output-file=$lang.mo $i
|
2004-10-27 18:32:51 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "$lang: converting from $fromset to utf-8" >&2
|
|
|
|
iconv --silent --from-code=$fromset --to-code=utf-8 < $i | \
|
|
|
|
sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/" | \
|
|
|
|
msgfmt --output-file=$lang.mo -
|
|
|
|
;;
|
|
|
|
esac
|
2002-09-11 14:56:56 +02:00
|
|
|
done
|
2005-01-17 11:19:57 +01:00
|
|
|
|
2005-01-11 13:03:22 +01:00
|
|
|
if makensis -version >/dev/null 2>&1 ; then
|
2005-01-17 11:19:57 +01:00
|
|
|
makensis -v3 -nocd -DVERSION="${version}" \
|
|
|
|
-DPROD_VERSION="${prod_version}" ${srcdir}/scripts/w32installer.nsi
|
|
|
|
echo "Installer created" >&2
|
|
|
|
else
|
|
|
|
zip -9 "gnupg-w32cli-${version}.zip" *
|
|
|
|
echo "ZIP archive created" >&2
|
2005-01-11 13:03:22 +01:00
|
|
|
fi
|