From dc82c692d1ad294f91927af6181f3ede26db4b9e Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 2 May 2017 17:28:27 -0300 Subject: [PATCH] Incluindo geração automática da man page. --- Makefile.in | 7 +++++++ configure.ac | 1 + locale/pt_BR.po | 78 +++++++++++++++++++++++++++++++++++++++++++++--------------------------------- locale/pw3270.pot | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------- rpm/pw3270.spec | 3 ++- src/pw3270/main.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------- 6 files changed, 164 insertions(+), 107 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7a7b1c2..aa44b4e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -30,6 +30,7 @@ PACKAGE_NAME=@PACKAGE_NAME@ PACKAGE_VERSION=@PACKAGE_VERSION@ PACKAGE_LEVEL=@PACKAGE_LEVEL@ PACKAGE_TARNAME=@PACKAGE_TARNAME@ +PACKAGE_DESCRIPTION=@PACKAGE_DESCRIPTION@ PLUGINS=@PLUGINS@ #---[ Paths ]------------------------------------------------------------------ @@ -62,6 +63,7 @@ MKDIR=@MKDIR_P@ MSGCAT=@MSGCAT@ AMTAR=@AMTAR@ RPMBUILD=@RPMBUILD@ +HELP2MAN=@HELP2MAN@ #---[ Rules ]------------------------------------------------------------------ @@ -236,6 +238,11 @@ install-app: \ @$(MAKE) -C ui install @$(MAKE) -C locale install + @$(MKDIR) $(DESTDIR)/$(mandir)/man1 + @$(HELP2MAN) \ + --version-string="$(PACKAGE_TARNAME) - $(PACKAGE_DESCRIPTION) Vrs. $(PACKAGE_VERSION)" \ + $(DESTDIR)$(bindir)/$(PACKAGE_TARNAME)@EXEEXT@ | gzip --best --stdout - > $(DESTDIR)/$(mandir)/man1/$(PACKAGE_NAME).1.gz + $(BINRLS)/libpw3270cpp.a: \ src/libpw3270cpp/* diff --git a/configure.ac b/configure.ac index 867a4ca..1ec4b85 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,7 @@ AC_PROG_SED AC_PROG_LN_S AC_PATH_TOOL([AR], [ar], [ar]) AC_PATH_TOOL([GENMARSHAL], [glib-genmarshal], [glib-genmarshal]) +AC_PATH_TOOL([HELP2MAN], [help2man], [help2man]) AC_LANG([C]) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 708cea8..e045b42 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-21 15:58-0300\n" +"POT-Creation-Date: 2017-05-02 17:27-0300\n" "PO-Revision-Date: 2017-02-15 17:08-0200\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português \n" @@ -95,7 +95,7 @@ msgstr "%s: Tabulação vertical não é suportada" msgid "%s%s for %s" msgstr "%s%s para %s" -#: main.c:438 +#: main.c:400 msgid "- 3270 Emulator for Gtk" msgstr "- Emulador 3270 para GTK" @@ -183,7 +183,7 @@ msgstr "" msgid "SSL state is undefinedUnexpected SSL status %ld" msgstr "Estado do SSL é indefinidoEstado SSL inesperado %ld" -#: main.c:458 +#: main.c:420 msgid "" "Valid options:\n" "\n" @@ -276,7 +276,7 @@ msgstr "Um parametro de ENVIO/RECEBIMENTO inválido foi enviado para o host." msgid "Appends the source file to the destination file." msgstr "Adiciona conteúdo do arquivo origem ao final do arquivo destino." -#: main.c:413 main.c:415 +#: main.c:375 main.c:377 msgid "Application name" msgstr "Nome da aplicação" @@ -419,6 +419,11 @@ msgstr "Não foi possível conectar a %s" msgid "Can't connect to %s:%s" msgstr "Não foi possível conectar a %s:%s" +#: main.c:70 +#, fuzzy +msgid "Can't connect to DBUS server" +msgstr "Não foi possível conectar a %s" + #: selection.c:425 #, c-format msgid "Can't convert line %d from %s to %s" @@ -433,6 +438,10 @@ msgstr "Recortar não permitido em seleção retangular" msgid "Can't determine value for environment variable \"%s\" " msgstr "Não consigo determinar o valor da variável de ambiente \"%s\" " +#: main.c:115 +msgid "Can't get DBUS object name" +msgstr "" + #: ft.c:413 msgid "Can't get file size" msgstr "Não foi possível obter o tamanho do arquivo" @@ -654,6 +663,11 @@ msgstr "Configurar host" msgid "Connect on startup" msgstr "Conectar ao iniciar" +#: gobject.c:205 +#, fuzzy +msgid "Connecting to host" +msgstr "Não foi possível conectar ao servidor" + #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 #: connect.c:573 @@ -910,7 +924,7 @@ msgstr "Tela cheia" msgid "Function bar" msgstr "Barra de funções" -#: main.c:101 main.c:507 +#: main.c:101 main.c:510 msgid "GTK Version mismatch" msgstr "Divergência de versão GTK" @@ -946,11 +960,11 @@ msgstr "Servidor rejeitou o tipo de dispositivo ou requisição" msgid "Host rejected resource(s)" msgstr "Servidor rejeitou recurso(s)" -#: main.c:421 +#: main.c:383 msgid "Host system type" msgstr "Tipo do sistema no servidor" -#: main.c:419 +#: main.c:381 msgid "Host to connect" msgstr "Servidor a conectar" @@ -1091,11 +1105,11 @@ msgstr "Ler a fila de um arquivo" msgid "Local:" msgstr "Local:" -#: main.c:433 +#: main.c:395 msgid "Log to file" msgstr "Enviar log para arquivo" -#: main.c:426 +#: main.c:388 msgid "Minutes for auto-disconnect" msgstr "Minutos para desconexão automática" @@ -1332,7 +1346,7 @@ msgstr "PF8" msgid "PF9" msgstr "PF9" -#: main.c:456 +#: main.c:418 msgid "Parse error" msgstr "Erro de interpretação" @@ -1365,7 +1379,7 @@ msgstr "Colar com margem esquerda" msgid "Path and name of the local file" msgstr "Caminho e nome do arquivo local" -#: main.c:427 +#: main.c:389 msgid "Path for plugin files" msgstr "Caminho para os arquivos de plugin" @@ -1373,7 +1387,7 @@ msgstr "Caminho para os arquivos de plugin" msgid "Path length constraint exceeded" msgstr "Path length constraint exceeded" -#: main.c:416 +#: main.c:378 msgid "Path to application data files" msgstr "Caminho para os arquivos de dados da aplicação" @@ -1779,7 +1793,7 @@ msgstr "Certificado auto assinado na cadeia de certificados" msgid "Send file" msgstr "Enviar arquivo" -#: main.c:430 +#: main.c:392 msgid "Send messages to syslog" msgstr "Enviar mensagens para o log do sistema" @@ -1795,11 +1809,11 @@ msgstr "Enviar/Receber" msgid "Sending file" msgstr "Enviando arquivo" -#: main.c:418 +#: main.c:380 msgid "Session name" msgstr "Nome da sessão" -#: main.c:424 +#: main.c:386 msgid "Set host charset" msgstr "Define página de código do host" @@ -1807,19 +1821,19 @@ msgstr "Define página de código do host" msgid "Set insert mode" msgstr "Set insert mode" -#: main.c:420 +#: main.c:382 msgid "Set reported colors (8/16)" msgstr "Define número de cores informadas (8/16)" -#: main.c:423 +#: main.c:385 msgid "Set toggles OFF" msgstr "Desativa toggles" -#: main.c:422 +#: main.c:384 msgid "Set toggles ON" msgstr "Ativa toggles" -#: main.c:432 +#: main.c:394 msgid "Set trace filename" msgstr "Define o nome do arquivo de trace" @@ -1913,6 +1927,11 @@ msgstr "Iniciar transferência de arquivo" msgid "Starting" msgstr "Iniciando" +#: gobject.c:193 +#, c-format +msgid "State %04d can't accept requests" +msgstr "" + #: security.c:237 msgid "Subject issuer mismatch" msgstr "Divergência na identidade do emissor" @@ -2115,7 +2134,7 @@ msgstr "" msgid "The known types are %s" msgstr "Os tipos conhecidos são %s" -#: main.c:425 +#: main.c:387 msgid "The model of 3270 display to be emulated" msgstr "Modelo de tela 3270 a ser emulada" @@ -2204,7 +2223,7 @@ msgstr "" "programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple " "Place, Suite 330, Boston, MA, 02111-1307, USA" -#: main.c:503 +#: main.c:506 #, c-format msgid "This program requires GTK version %d.%d.%d" msgstr "Este programa precisa do GTK versão %d.%d.%d" @@ -2398,6 +2417,11 @@ msgstr "Valor de cor inválido ou inesperado: \"%s\"" msgid "Unexpected or unknown security status" msgstr "Estado de segurança inesperado ou desconhecido." +#: gobject.c:208 +#, fuzzy, c-format +msgid "Unexpected state %04d" +msgstr "Alvo inesperado \"%s\"" + #: actions.c:391 #, c-format msgid "Unexpected target \"%s\"" @@ -2802,10 +2826,6 @@ msgstr "translator-credits" #~ "32768. Valores maiores trazem maior performance, porem, nem todos os " #~ "hosts podem suportá-los." -#, fuzzy -#~ msgid "Can't connect to DBUS server" -#~ msgstr "Não foi possível conectar a %s" - #~ msgid "Can't start download." #~ msgstr "Não foi possível iniciar o download." @@ -2842,10 +2862,6 @@ msgstr "translator-credits" #~ msgid "Complete" #~ msgstr "Completo" -#, fuzzy -#~ msgid "Connecting to host" -#~ msgstr "Não foi possível conectar ao servidor" - #~ msgid "Copiar tudo" #~ msgstr "Copiar tudo" @@ -3208,10 +3224,6 @@ msgstr "translator-credits" #~ msgid "Unexpected element <%s>" #~ msgstr "Elemento <%s> inesperado" -#, fuzzy -#~ msgid "Unexpected state %04d" -#~ msgstr "Alvo inesperado \"%s\"" - #~ msgid "" #~ "Unknown host:\n" #~ "%s" diff --git a/locale/pw3270.pot b/locale/pw3270.pot index 0d6db8a..3c757d7 100644 --- a/locale/pw3270.pot +++ b/locale/pw3270.pot @@ -9,7 +9,7 @@ msgstr "" "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-04-12 14:32-0300\n" +"POT-Creation-Date: 2017-05-02 17:27-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,7 +20,7 @@ msgstr "" "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-04-12 14:32-0300\n" +"POT-Creation-Date: 2017-05-02 17:27-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,6 +39,17 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" +"#-#-#-#-# dbus3270.pot (PACKAGE VERSION) #-#-#-#-#\n" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-02 17:27-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" #: window.c:329 #, c-format @@ -116,7 +127,7 @@ msgstr "" msgid "%s%s for %s" msgstr "" -#: main.c:438 +#: main.c:400 msgid "- 3270 Emulator for Gtk" msgstr "" @@ -198,7 +209,7 @@ msgstr "" msgid "SSL state is undefinedUnexpected SSL status %ld" msgstr "" -#: main.c:458 +#: main.c:420 msgid "" "Valid options:\n" "\n" @@ -284,7 +295,7 @@ msgstr "" msgid "Appends the source file to the destination file." msgstr "" -#: main.c:413 main.c:415 +#: main.c:375 main.c:377 msgid "Application name" msgstr "" @@ -424,6 +435,10 @@ msgstr "" msgid "Can't connect to %s:%s" msgstr "" +#: main.c:70 +msgid "Can't connect to DBUS server" +msgstr "" + #: selection.c:425 #, c-format msgid "Can't convert line %d from %s to %s" @@ -438,6 +453,10 @@ msgstr "" msgid "Can't determine value for environment variable \"%s\" " msgstr "" +#: main.c:115 +msgid "Can't get DBUS object name" +msgstr "" + #: ft.c:413 msgid "Can't get file size" msgstr "" @@ -647,6 +666,10 @@ msgstr "" msgid "Connect on startup" msgstr "" +#: gobject.c:205 +msgid "Connecting to host" +msgstr "" + #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 #: connect.c:573 @@ -893,7 +916,7 @@ msgstr "" msgid "Function bar" msgstr "" -#: main.c:101 main.c:507 +#: main.c:101 main.c:510 msgid "GTK Version mismatch" msgstr "" @@ -929,11 +952,11 @@ msgstr "" msgid "Host rejected resource(s)" msgstr "" -#: main.c:421 +#: main.c:383 msgid "Host system type" msgstr "" -#: main.c:419 +#: main.c:381 msgid "Host to connect" msgstr "" @@ -1061,11 +1084,11 @@ msgstr "" msgid "Local:" msgstr "" -#: main.c:433 +#: main.c:395 msgid "Log to file" msgstr "" -#: main.c:426 +#: main.c:388 msgid "Minutes for auto-disconnect" msgstr "" @@ -1300,7 +1323,7 @@ msgstr "" msgid "PF9" msgstr "" -#: main.c:456 +#: main.c:418 msgid "Parse error" msgstr "" @@ -1333,7 +1356,7 @@ msgstr "" msgid "Path and name of the local file" msgstr "" -#: main.c:427 +#: main.c:389 msgid "Path for plugin files" msgstr "" @@ -1341,7 +1364,7 @@ msgstr "" msgid "Path length constraint exceeded" msgstr "" -#: main.c:416 +#: main.c:378 msgid "Path to application data files" msgstr "" @@ -1736,7 +1759,7 @@ msgstr "" msgid "Send file" msgstr "" -#: main.c:430 +#: main.c:392 msgid "Send messages to syslog" msgstr "" @@ -1752,11 +1775,11 @@ msgstr "" msgid "Sending file" msgstr "" -#: main.c:418 +#: main.c:380 msgid "Session name" msgstr "" -#: main.c:424 +#: main.c:386 msgid "Set host charset" msgstr "" @@ -1764,19 +1787,19 @@ msgstr "" msgid "Set insert mode" msgstr "" -#: main.c:420 +#: main.c:382 msgid "Set reported colors (8/16)" msgstr "" -#: main.c:423 +#: main.c:385 msgid "Set toggles OFF" msgstr "" -#: main.c:422 +#: main.c:384 msgid "Set toggles ON" msgstr "" -#: main.c:432 +#: main.c:394 msgid "Set trace filename" msgstr "" @@ -1861,6 +1884,11 @@ msgstr "" msgid "Starting" msgstr "" +#: gobject.c:193 +#, c-format +msgid "State %04d can't accept requests" +msgstr "" + #: security.c:237 msgid "Subject issuer mismatch" msgstr "" @@ -2030,7 +2058,7 @@ msgstr "" msgid "The known types are %s" msgstr "" -#: main.c:425 +#: main.c:387 msgid "The model of 3270 display to be emulated" msgstr "" @@ -2099,7 +2127,7 @@ msgid "" "Franklin St, Fifth Floor, Boston, MA 02111-1307 USA" msgstr "" -#: main.c:503 +#: main.c:506 #, c-format msgid "This program requires GTK version %d.%d.%d" msgstr "" @@ -2292,6 +2320,11 @@ msgstr "" msgid "Unexpected or unknown security status" msgstr "" +#: gobject.c:208 +#, c-format +msgid "Unexpected state %04d" +msgstr "" + #: actions.c:391 #, c-format msgid "Unexpected target \"%s\"" diff --git a/rpm/pw3270.spec b/rpm/pw3270.spec index 6af1c20..b6d8ed8 100644 --- a/rpm/pw3270.spec +++ b/rpm/pw3270.spec @@ -131,6 +131,7 @@ BuildRequires: pkgconfig BuildRequires: sed BuildRequires: optipng BuildRequires: fdupes +BuildRequires: help2man %description Open-source GTK-based IBM 3270 terminal emulator with many advanced features. It can be used to communicate with any IBM host that supports 3270-style connections over TELNET. @@ -248,7 +249,7 @@ rm -rf %{buildroot} %files -f langfiles %defattr(-,root,root) %doc AUTHORS LICENSE README.md -# %{_mandir}/*/* +%{_mandir}/*/* # Main application %dir %{_datadir}/pw3270 diff --git a/src/pw3270/main.c b/src/pw3270/main.c index b83e5f7..1fb2730 100644 --- a/src/pw3270/main.c +++ b/src/pw3270/main.c @@ -359,49 +359,11 @@ int main(int argc, char *argv[]) g_thread_init(NULL); #endif // !GLIB(2,32) - gtk_init(&argc, &argv); - // Setup locale #ifdef LC_ALL setlocale( LC_ALL, "" ); #endif -#if defined( WIN32 ) - { - gchar * appdir = g_win32_get_package_installation_directory_of_module(NULL); - gchar * locdir = g_build_filename(appdir,"locale",NULL); - - g_chdir(appdir); - bindtextdomain( PACKAGE_NAME, locdir ); - - g_free(locdir); - g_free(appdir); - - } -#elif defined(HAVE_GTKMAC) - { - GtkMacBundle * macbundle = gtk_mac_bundle_get_default(); - - g_chdir(gtk_mac_bundle_get_datadir(macbundle)); - bindtextdomain(PACKAGE_NAME,gtk_mac_bundle_get_localedir(macbundle)); - - osxapp = GTK_OSX_APPLICATION(g_object_new(GTK_TYPE_OSX_APPLICATION,NULL)); - - } -#elif defined( DATAROOTDIR ) - { - gchar * appdir = g_build_filename(DATAROOTDIR,PACKAGE_NAME,NULL); - gchar * locdir = g_build_filename(DATAROOTDIR,"locale",NULL); - - g_chdir(appdir); - bindtextdomain( PACKAGE_NAME, locdir); - - g_free(locdir); - g_free(appdir); - - } -#endif // DATAROOTDIR - bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); textdomain(PACKAGE_NAME); @@ -470,25 +432,66 @@ int main(int argc, char *argv[]) return -1; } + } + + // Init GTK + gtk_init(&argc, &argv); + + // Get DATADIR +#if defined( WIN32 ) + { + gchar * appdir = g_win32_get_package_installation_directory_of_module(NULL); + gchar * locdir = g_build_filename(appdir,"locale",NULL); + + g_chdir(appdir); + bindtextdomain( PACKAGE_NAME, locdir ); + + g_free(locdir); + g_free(appdir); + + } +#elif defined(HAVE_GTKMAC) + { + GtkMacBundle * macbundle = gtk_mac_bundle_get_default(); + + g_chdir(gtk_mac_bundle_get_datadir(macbundle)); + bindtextdomain(PACKAGE_NAME,gtk_mac_bundle_get_localedir(macbundle)); + + osxapp = GTK_OSX_APPLICATION(g_object_new(GTK_TYPE_OSX_APPLICATION,NULL)); + + } +#elif defined( DATAROOTDIR ) + { + gchar * appdir = g_build_filename(DATAROOTDIR,PACKAGE_NAME,NULL); + gchar * locdir = g_build_filename(DATAROOTDIR,"locale",NULL); + + g_chdir(appdir); + bindtextdomain( PACKAGE_NAME, locdir); + + g_free(locdir); + g_free(appdir); + + } +#endif // DATAROOTDIR + #if defined( HAVE_SYSLOG ) - if(log_to_syslog) - { - openlog(g_get_prgname(), LOG_NDELAY, LOG_USER); - g_log_set_default_handler(g_syslog,NULL); - } - else if(logfile) + if(log_to_syslog) + { + openlog(g_get_prgname(), LOG_NDELAY, LOG_USER); + g_log_set_default_handler(g_syslog,NULL); + } + else if(logfile) #else - if(logfile) + if(logfile) #endif // HAVE_SYSLOG - { - g_log_set_default_handler(g_logfile,NULL); - } - - lib3270_set_trace_handler(g_trace); - + { + g_log_set_default_handler(g_logfile,NULL); } + lib3270_set_trace_handler(g_trace); + + // Check GTK Version { const gchar *msg = gtk_check_version(GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); -- libgit2 0.21.2