1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00
gnupg/scripts/mk-w32-dist

162 lines
4.6 KiB
Plaintext
Raw Normal View History

2002-06-29 13:46:34 +00:00
#!/bin/sh
#
# Copyright (C) 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
2002-06-29 13:46:34 +00: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
tmp="`echo $0 | sed 's,.*gnupg-\([^/]*\)/.*,\1,'`"
topdir=
bindir=..
if [ -f "../gnupg-$tmp/README" ]; then
srcdir="../gnupg-$tmp"
bindir="../gnupg-$tmp"
topdir=".."
elif [ -f ../README ]; then
2002-06-29 13:46:34 +00:00
srcdir=..
elif [ -f ../../README ]; then
srcdir=../..
bindir=..
2002-06-29 13:46:34 +00: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
if i586-mingw32msvc-strip --version >/dev/null 2>&1 ; then
STRIP=i586-mingw32msvc-strip
else
STRIP="mingw32 strip"
fi
# If we don't have an installer we don't need to prepare for it.
if ! makensis -version >/dev/null 2>&1 ; then
topdir=
fi
# Figure out the version
version=$(sed -n 's/^#[ ]*define[ ][ ]*VERSION[ ][ ]*\"\([0-9.a-z-]*\)\"/\1/p' $bindir/config.h)
2005-01-17 10:19:57 +00:00
prod_version=$(echo "$version"|awk -F'[^0-9]' '{print $1 "." $2 "." $3 ".1"}')
echo "building version $version ($prod_version)"
rm * >/dev/null 2>/dev/null || true
cp ${bindir}/g10/gpg.exe gpg.exe
$STRIP gpg.exe
cp ${bindir}/g10/gpgv.exe gpgv.exe
$STRIP gpgv.exe
2004-10-28 09:06:50 +00:00
for name in hkp http ldap finger; do
cp ${bindir}/keyserver/gpgkeys_$name.exe gpgkeys_$name.exe
$STRIP gpgkeys_$name.exe
done
cp ${bindir}/tools/gpgsplit.exe gpgsplit.exe
$STRIP gpgsplit.exe
for i in FAQ; do
cp ${bindir}/doc/$i $i.txt
todos $i.txt
done
man -Tlatin1 -l ${srcdir}/doc/gpg.1 | sed `printf "s/\b.//g"` >gpg.man
2002-06-29 13:46:34 +00:00
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 NEWS; do
cp ${srcdir}/$i $i.txt
todos $i.txt
done
2005-02-03 11:16:27 +00:00
for i in README.W32 ; do
cp ${srcdir}/doc/$i $i.txt
todos $i.txt
done
for i in gnupg-w32.reg; do
cp ${srcdir}/doc/$i .
todos $i
done
# We must distribute the MO files in UTF-8, the conversion is done by
# gpg at runtime.
for i in ${srcdir}/po/*.po; do
lang=$(basename $i .po)
grep -s $lang ${srcdir}/po/LINGUAS >/dev/null || continue
[ -f$lang.mo -a $lang.mo -nt $i ] && continue
fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $i`
case "$fromset" in
utf8|utf-8|UTF8|UTF-8)
echo "$lang: keeping $fromset" >&2
msgfmt --output-file=$lang.mo $i
;;
*)
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
done
2005-01-17 10:19:57 +00:00
# If we have a topdir, assume the full build environment and
# prepare the installer
if [ -n "$topdir" ]; then
winpt_defs=
src_defs=
buildinfo="`date -u '+%Y-%m-%d %H:%M UTC'`"
# iconv.dll is a hard requirement
if [ ! -f "$topdir/iconv/iconv.dll" ]; then
echo "iconv.dll not availavle" >&2
exit 1
fi
ln "$topdir/iconv/iconv.dll" iconv.dll
for i in COPYING.LIB README.iconv; do
cp ${topdir}/iconv/$i $i.txt
todos $i.txt
done
# WinPT is optional
if [ -f "$topdir/winpt/WinPT.exe" ]; then
ln "$topdir/winpt/WinPT.exe" WinPT.exe
ln "$topdir/winpt/PTD.dll" PTD.dll
cp "$topdir/winpt/README-0.9.txt" README.winpt.txt
cp "$topdir/winpt/NEWS-0.9.txt" NEWS.winpt.txt
cp "$topdir/winpt/keyserver.conf" keyserver.conf
winpt_defs="-DWITH_WINPT"
fi
# See whether we should include the source.
if [ ! -d "$topdir/tarballs" ]; then
# FIXME
:
fi
# Now run the installer
echo "invoking installer as:"
echo makensis -v2 -nocd -DVERSION="${version}" \
-DPROD_VERSION="${prod_version}" \
-DGNUPG_SRCDIR="${srcdir}" ${winpt_defs} ${src_defs} \
${srcdir}/scripts/w32installer.nsi
BUILDINFO=$buildinfo makensis -v2 -nocd -DVERSION="${version}" \
-DPROD_VERSION="${prod_version}" \
-DGNUPG_SRCDIR="${srcdir}" ${winpt_defs} ${src_defs} \
${srcdir}/scripts/w32installer.nsi
2005-01-17 10:19:57 +00:00
echo "Installer created" >&2
else
zip -9 "gnupg-w32cli-${version}.zip" *
echo "ZIP archive created" >&2
fi