aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-01-08 14:28:54 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-01-08 14:28:54 +0000
commitb07d08d37a097fd10e89adbd60feaeb276aeb6d1 (patch)
tree3a1c8e6b8531a3d153cc7d722ce5663621b7bfb6
parentd38b9e71525c11046fc68f5d30dcc6d9e07dbf9c (diff)
downloadmailfromd-b07d08d37a097fd10e89adbd60feaeb276aeb6d1.tar.gz
mailfromd-b07d08d37a097fd10e89adbd60feaeb276aeb6d1.tar.bz2
* lib/libmf.h (mf_init_nls): New proto.
* lib/nls.c: New file. * lib/Makefile: Add nls.c. * bootstrap: Fix TP issues. * src/main.c, src/mtasim.c, smap/smap.c: Use mf_init_nls. * lib/version.c: Update year. git-svn-id: file:///svnroot/mailfromd/branches/gmach@1544 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--ChangeLog36
-rwxr-xr-xbootstrap68
-rw-r--r--lib/Makefile.am3
-rw-r--r--lib/libmf.h1
-rw-r--r--lib/nls.c32
-rw-r--r--lib/version.c2
-rw-r--r--smap/smap.c2
-rw-r--r--src/main.c7
-rw-r--r--src/mtasim.c9
9 files changed, 136 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 07f5519b..85ee12c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2008-01-08 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * lib/libmf.h (mf_init_nls): New proto.
+ * lib/nls.c: New file.
+ * lib/Makefile: Add nls.c.
+ * bootstrap: Fix TP issues.
+ * src/main.c, src/mtasim.c, smap/smap.c: Use mf_init_nls.
+ * lib/version.c: Update year.
+
+ * configure.ac (AC_INIT): Rename to gmach (working name).
+ (MF_VERSION_PATCH): Raise to 91
+ Require at least MU-1.2.90
+ (AC_CONFIG_FILES): Add gnu/Makefile and smap/Makefile.
+ * NEWS: Update.
+
+ * bootstrap: Place gnulib files in gnu/
+
+ * lib: New directory.
+ * lib/libmf.h: New file.
+ * src/daemon.c, src/syslog_async.c, src/syslog_async.h,
+ src/version.c: Moved to lib
+ * src/mailfromd.h: Incude sysexits.h unconditionally.
+ Include libmf.h
+ * src/bi_sa.m4: Rewrite using mu_socket_stream_t.
+ * src/main.c: Remove pre-mu-1.2.90 dependencies.
+
+ * Makefile.am (SUBDIRS): Add gnu and smap.
+ * src/Makefile.am, gacopyz/Makefile.am: Update.
+
+ * src/mtasim.c (main): Remove (now superfluous) invocation of
+ mu_error_set_print.
+
+ * smap/smap.c: Rewrite using MU-1.2.90
+
+ * po/POTFILES.in: Update.
+
2007-12-28 Sergey Poznyakoff <gray@gnu.org.ua>
* src/Makefile.am (libmf_a_DEPENDENCIES): Add BUILD_SYSLOG_ASYNC
diff --git a/bootstrap b/bootstrap
index 5da0d574..5e14a3d6 100755
--- a/bootstrap
+++ b/bootstrap
@@ -102,7 +102,17 @@ extract_package_name='
}
'
package=`sed -n "$extract_package_name" configure.ac` || exit
-
+extract_bug_address='
+ /^AC-INIT-BUG-ADDRESS/{
+ s/[][]//g
+ s/.*=//p
+ }
+'
+bug_address=`m4 -D'AC_INIT=AC-INIT-BUG-ADDRESS=$3' configure.ac | sed -n "$extract_bug_address"`
+if test -z "$bug_address"; then
+ bug_address="bug-${package}@gnu.org.ua"
+fi
+
# Whether to use copies instead of symlinks.
copy=false
@@ -190,7 +200,7 @@ sed '
/^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
- /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
+ /^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$bug_address"'/
/^XGETTEXT_OPTIONS *=/{
s/$/ \\/
a\
@@ -199,7 +209,6 @@ sed '
' po/Makevars.template >po/Makevars
# Get translations.
-
get_translations() {
subdir=$1
domain=$2
@@ -239,11 +248,42 @@ get_translations() {
' | WGET_COMMAND="$WGET_COMMAND" sh
;;
esac &&
- ls "$subdir"/*.po 2>/dev/null |
- sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
rm -f "$subdir/$domain.html"
}
+gmach_update_translations() {
+ echo "$0: Updating translations from mailfromd..."
+ (cd $1
+ find mailfromd -name '*.po' |
+ while read fname
+ do
+ lang=`expr "$fname" : '.*/\(.*\)\.po'`
+ if test -f $lang.po; then
+ oldfile=$lang.po
+ else
+ oldfile=/dev/null
+ fi
+ TMPFILE=$$-$lang.po
+ set -x
+ msgmerge --compendium mailfromd/$lang.po -o $TMPFILE $oldfile $2.pot &&
+ sed "/\"Project-Id-Version: mailfromd .*\"/s/mailfromd/$2/" $TMPFILE > $lang.po
+ rm $TMPFILE
+ set +x
+ done)
+}
+
+gmach_finish_translations() {
+ echo "$0: Creating $1/LINGUAS..."
+ ls "$1"/*.po 2>/dev/null |
+ sed 's|.*/||; s|\.po$||' >"$1/LINGUAS"
+}
+
+gmach_get_translations() {
+ get_translations $@
+ test -d $1/mailfromd || mkdir $1/mailfromd
+ get_translations $1/mailfromd "mailfromd" $3
+}
+
save_LC_ALL="$LC_ALL"
LC_ALL=C
case `wget --help` in
@@ -262,19 +302,18 @@ case $DOWNLOAD_PO in
'skip')
;;
'')
- get_translations po $package || exit
+ gmach_get_translations po $package || exit
;;
'only')
- get_translations po $package
+ gmach_get_translations po $package
exit
;;
*.po)
- get_translations po $package "$DOWNLOAD_PO"
+ gmach_get_translations po $package "$DOWNLOAD_PO"
exit
;;
*)
- get_translations po $package "${DOWNLOAD_PO}.po"
- exit
+ gmach_get_translations po $package "${DOWNLOAD_PO}.po"
esac
echo "$0: Importing gnulib files ..."
@@ -297,4 +336,13 @@ do
$command || exit
done
+if test "$DOWNLOAD_PO" != skip; then
+ echo "$0: Initial configure..."
+ ./configure
+ echo "$0: making po/$package.pot..."
+ make -C po $package.pot
+ gmach_update_translations po $package
+ gmach_finish_translations po $package
+fi
+
echo "$0: done. Now you can run './configure'."
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 96f461e5..2ffbd995 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -22,6 +22,7 @@ EXTRA_DIST = syslog_async.c
SYSLOG_ASYNC_O=syslog_async.o
libmf_a_SOURCES=\
+ nls.c\
version.c
libmf_a_LIBADD=$(LIBOBJS) $(BUILD_SYSLOG_ASYNC)
@@ -29,3 +30,5 @@ libmf_a_DEPENDENCIES=$(BUILD_SYSLOG_ASYNC)
INCLUDES = -I$(top_srcdir)/gnu -I../gnu
+AM_CPPFLAGS=-DLOCALEDIR=\"$(localedir)\"
+
diff --git a/lib/libmf.h b/lib/libmf.h
index 21baa0cf..bf4aab50 100644
--- a/lib/libmf.h
+++ b/lib/libmf.h
@@ -20,3 +20,4 @@
#define N_(String) String
void mailfromd_version(const char *progname, FILE *stream);
+void mf_init_nls (void);
diff --git a/lib/nls.c b/lib/nls.c
new file mode 100644
index 00000000..bc6018f2
--- /dev/null
+++ b/lib/nls.c
@@ -0,0 +1,32 @@
+/* This file is part of mailfromd.
+ Copyright (C) 2007 Sergey Poznyakoff
+
+ 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/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <gettext.h>
+#include <locale.h>
+
+void
+mf_init_nls ()
+{
+#ifdef ENABLE_NLS
+ mu_init_nls ();
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+#endif
+}
diff --git a/lib/version.c b/lib/version.c
index 1f822062..3ad33b7f 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -1,5 +1,5 @@
/* This file is part of mailfromd.
- Copyright (C) 2007 Sergey Poznyakoff
+ Copyright (C) 2007, 2008 Sergey Poznyakoff
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
diff --git a/smap/smap.c b/smap/smap.c
index 04027795..5c166a52 100644
--- a/smap/smap.c
+++ b/smap/smap.c
@@ -470,6 +470,8 @@ main (int argc, char **argv)
{
int status;
mu_m_server_t server;
+
+ mf_init_nls ();
syslog_tag = strrchr (argv[0], '/');
if (syslog_tag)
diff --git a/src/main.c b/src/main.c
index 89dfad9c..f1b462a8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2087,12 +2087,7 @@ main(int argc, char **argv)
int rc;
int index;
-#ifdef ENABLE_NLS
- mu_init_nls();
- setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-#endif
+ mf_init_nls ();
MU_AUTH_REGISTER_ALL_MODULES();
mu_register_all_formats();
diff --git a/src/mtasim.c b/src/mtasim.c
index b3229521..d48cd059 100644
--- a/src/mtasim.c
+++ b/src/mtasim.c
@@ -642,13 +642,8 @@ main (int argc, char **argv)
{
int status, index;
-#ifdef ENABLE_NLS
- mu_init_nls();
- setlocale (LC_ALL, "");
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
+ mf_init_nls ();
+
interactive = isatty(0);
if (!program_invocation_short_name)

Return to:

Send suggestions and report system problems to the System administrator.