[pybliographer] Drop intltool
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pybliographer] Drop intltool
- Date: Thu, 29 Mar 2018 03:40:10 +0000 (UTC)
commit f34952d64eb7cb9f2e7d9e522a7dd5fae0cf19b9
Author: Germán Poo-Caamaño <gpoo gnome org>
Date: Wed Mar 28 11:09:17 2018 -0300
Drop intltool
* Use gettext directly instead
* Require a newer gettext.
* Enable run pybliographic either from source or installation
* Fix make distcheck
* Move modules dependency checks (setup-check.py) to configure.ac
* Use available macro to check for Python
* Remove duplicated images from project directory
Makefile.am | 87 ++++++++++----------
Pyblio/Autoload.py | 2 +
Pyblio/Config.py | 1 +
Pyblio/Fields.py | 2 +
Pyblio/Format/BibTeX.py | 2 +
Pyblio/GnomeUI/Common.py | 1 +
Pyblio/GnomeUI/Config.py | 2 +
Pyblio/GnomeUI/Document.py | 9 ++-
Pyblio/GnomeUI/Editor.py | 2 +
Pyblio/GnomeUI/Entry.py | 1 +
Pyblio/GnomeUI/Fields.py | 1 +
Pyblio/GnomeUI/FileSelector.py | 1 +
Pyblio/GnomeUI/Index.py | 2 +-
Pyblio/GnomeUI/OpenURL.py | 1 +
Pyblio/GnomeUI/Search.py | 1 +
Pyblio/GnomeUI/Sort.py | 1 +
Pyblio/GnomeUI/Utils.py | 2 +
Pyblio/GnomeUI/__init__.py | 1 +
Pyblio/GnomeUI/glade/Makefile.am | 10 +--
Pyblio/GnomeUI/glade/{pyblio.ui.in => pyblio.ui} | 1 -
Pyblio/LyX.py | 2 +
Pyblio/Makefile.am | 25 ++++--
Pyblio/Open.py | 1 +
Pyblio/Resource.py | 2 +
Pyblio/Style/Parser.py | 1 +
Pyblio/version.py.in | 21 ++++-
autogen.sh | 35 ++-------
configure.ac | 68 ++++++----------
etc/installer.in | 49 -----------
po/Makefile.am | 55 ------------
po/POTFILES.in | 19 ++--
pybliographer.py => pybliographer.in | 0
pybliographic-logo.png | Bin 36003 -> 0 bytes
pybliographic-viewer.png | Bin 491 -> 0 bytes
...hic.appdata.xml => pybliographic.appdata.xml.in | 0
pybliographic.desktop.in | 6 +-
pybliographic.png | Bin 2592 -> 0 bytes
scripts/Makefile.am | 18 ++++-
scripts/pybliocompact.py | 2 +
scripts/pyblioconvert.py | 2 +
scripts/pyblioformat.py | 1 +
scripts/pybliotex.py | 1 +
scripts/pybliotext.py | 1 +
43 files changed, 180 insertions(+), 259 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a28fa2d..1f90bd6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,72 +1,73 @@
# This file is part of pybliographer
-#
-# Copyright (C) 1998-2004 Frederic GOBRY
-# Email : gobry pybliographer org
+#
+# Copyright (C) Germán Poo-Caamaño <gpoo gnome org>
+# Copyright (C) 1998-2004 Frederic GOBRY <gobry pybliographer org>
#
# 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 2
+# as published by the Free Software Foundation; either version 2
# of the License, 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-
-DISTCHECK_CONFIGURE_FLAGS = --disable-update-desktop-database
+#
pybdir = $(datadir)/$(PACKAGE)
-appdir = $(datadir)/applications
-SUBDIRS = Pyblio \
- . \
+SUBDIRS = . Pyblio \
scripts \
tests \
Styles \
+ data \
po \
- help \
- data
-
-
-app_DATA = pybliographic.desktop
-
-appdatadir = $(datadir)/appdata
-appdata_DATA = pybliographic.appdata.xml
-
+ help
bin_SCRIPTS = pybliographer
pyb_DATA = pybrc.py
-EXTRA_DIST = setup-check.py \
- pybliographer.py \
- etc/installer.in \
- pybliographic.appdata.xml \
- pybliographic.desktop.in
+desktopdir = $(datadir)/applications
+desktop_in_files = pybliographic.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+%.desktop: %.desktop.in Makefile
+ $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
+
+appdatadir = $(datadir)/appdata
+appdata_in_files = pybliographic.appdata.xml.in
+appdata_DATA = $(appdata_in_files:.xml.in=.xml)
+%.xml: %.xml.in Makefile
+ $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
-dist-hook:
- intltool-merge -d po pybliographic.desktop.in $(distdir)/pybliographic.desktop
+EXTRA_DIST = m4/ChangeLog \
+ pybliographer.in \
+ $(appdata_in_files) \
+ $(desktop_in_files) \
+ $(pyb_DATA)
-pybliographic.desktop: pybliographic.desktop.in po/*.po
- intltool-merge -d po pybliographic.desktop.in pybliographic.desktop \
- || echo "**** Warning: cannot update desktop file"
+CLEANFILES = \
+ pybliographer \
+ $(desktop_DATA) \
+ $(appdata_DATA)
-pybliographer: $(top_srcdir)/pybliographer.py etc/installer
- $(SHELL) etc/installer < $(top_srcdir)/pybliographer.py > pybliographer
- chmod 755 pybliographer
+DISTCLEANFILES =
-update_desktop_database = update-desktop-database $(DESTDIR)$(appdir) \
- || echo "**** Warning: cannot update mime cache (recommended for Gnome >= 2.8)"
+pybliographer: pybliographer.in Makefile
+ $(AM_V_GEN)sed \
+ -e s!\@bin_dir\@!$(bindir)! \
+ -e s!\@libpyb\@!$(libdir)/$(PACKAGE)! \
+ -e s!\@datapyb\@!$(datadir)/$(PACKAGE)! \
+ -e s!\@package\@!$(PACKAGE)! \
+ -e s!\@version\@!$(VERSION)! \
+ -e s!\@locale_dir\@!$(localedir)! \
+ -e s!\@p_datadir\@!$(datadir)/$(PACKAGE)! \
+ -e s!\@python_path\@!$(PYTHON)! \
+ < $< > $@
+ chmod +x $@
-install-data-hook: update-desktop-database
-uninstall-hook: update-desktop-database
-update-desktop-database:
-if ENABLE_UPDATE_DESKTOP_DATABASE
- $(update_desktop_database)
-endif
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
diff --git a/Pyblio/Autoload.py b/Pyblio/Autoload.py
index 74a4766..ff37057 100644
--- a/Pyblio/Autoload.py
+++ b/Pyblio/Autoload.py
@@ -40,6 +40,8 @@ point it provides.
import string
import re
+from gettext import gettext as _
+
class Loader:
''' An object containing the description of a loadable object '''
diff --git a/Pyblio/Config.py b/Pyblio/Config.py
index e891e09..8ababca 100644
--- a/Pyblio/Config.py
+++ b/Pyblio/Config.py
@@ -28,6 +28,7 @@ import string
import sys
import types
+from gettext import gettext as _
pickle = cPickle
del cPickle
diff --git a/Pyblio/Fields.py b/Pyblio/Fields.py
index c79e74e..85aa0c2 100644
--- a/Pyblio/Fields.py
+++ b/Pyblio/Fields.py
@@ -26,6 +26,8 @@ import string
import types
import urlparse
+from gettext import gettext as _
+
from Pyblio import Exceptions, Key
year_match = re.compile ('(\d\d\d\d)')
diff --git a/Pyblio/Format/BibTeX.py b/Pyblio/Format/BibTeX.py
index 505240d..348d5ea 100644
--- a/Pyblio/Format/BibTeX.py
+++ b/Pyblio/Format/BibTeX.py
@@ -27,6 +27,8 @@ import re
import string
import copy
+from gettext import gettext as _
+
from Pyblio.Fields import Author, AuthorGroup, Date, LongText
from Pyblio.Fields import Reference, Text, URL
from Pyblio import Base, Config, Autoload, Types
diff --git a/Pyblio/GnomeUI/Common.py b/Pyblio/GnomeUI/Common.py
index b792f55..b21f34a 100644
--- a/Pyblio/GnomeUI/Common.py
+++ b/Pyblio/GnomeUI/Common.py
@@ -38,6 +38,7 @@ import gtk
import gtk.gdk
import pango
+from gettext import gettext as _
from Pyblio import Fields, Resource
diff --git a/Pyblio/GnomeUI/Config.py b/Pyblio/GnomeUI/Config.py
index 1a039c9..f4813ab 100644
--- a/Pyblio/GnomeUI/Config.py
+++ b/Pyblio/GnomeUI/Config.py
@@ -29,6 +29,8 @@ import string
import gobject
import gtk
+from gettext import gettext as _
+
from Pyblio.GnomeUI import Utils
from Pyblio import Config
diff --git a/Pyblio/GnomeUI/Document.py b/Pyblio/GnomeUI/Document.py
index 6d93dc0..bbcabab 100644
--- a/Pyblio/GnomeUI/Document.py
+++ b/Pyblio/GnomeUI/Document.py
@@ -33,6 +33,8 @@ import cPickle as pickle
import gobject
import gtk
+from gettext import gettext as _
+
from Pyblio.GnomeUI import Editor, Entry, FileSelector, Format
from Pyblio.GnomeUI import Index, OpenURL, Search, Utils
from Pyblio.GnomeUI.Sort import SortDialog
@@ -196,13 +198,15 @@ class Document (Connector.Publisher):
self.uim.ensure_update ()
gp = os.path.join(Utils.glade_root, 'pyblio.ui')
-
+ icon_file = os.path.join (version.pixmapsdir, 'pybliographic.png')
+
self.xml = gtk.Builder()
self.xml.set_translation_domain('pybliographer')
self.xml.add_from_file(gp)
self.xml.connect_signals(self)
self.w = self.xml.get_object('main')
+ self.w.set_icon_from_file(icon_file)
self.paned = self.xml.get_object('main_pane')
box = self.xml.get_object('table')
@@ -1218,8 +1222,7 @@ class Document (Connector.Publisher):
gtk.show_uri(None, url, gtk.gdk.CURRENT_TIME)
pybliologo = gtk.gdk.pixbuf_new_from_file(
- os.path.join (version.pybdir,
- 'pixmaps',
+ os.path.join (version.pixmapsdir,
'pybliographic-logo.png'))
authors = ['Hervé Dréau',
'Frédéric Gobry',
diff --git a/Pyblio/GnomeUI/Editor.py b/Pyblio/GnomeUI/Editor.py
index 5603044..504b643 100644
--- a/Pyblio/GnomeUI/Editor.py
+++ b/Pyblio/GnomeUI/Editor.py
@@ -30,6 +30,8 @@ import string
import gobject
import gtk
+from gettext import gettext as _
+
from Pyblio import Config, Connector, Exceptions, Fields, Key, Types
from Pyblio.GnomeUI import FieldsInfo, FileSelector, Mime, Utils
diff --git a/Pyblio/GnomeUI/Entry.py b/Pyblio/GnomeUI/Entry.py
index 63198b8..a7c9428 100644
--- a/Pyblio/GnomeUI/Entry.py
+++ b/Pyblio/GnomeUI/Entry.py
@@ -26,6 +26,7 @@ import gobject
import gtk
import pango
+from gettext import gettext as _
from Pyblio import Fields
diff --git a/Pyblio/GnomeUI/Fields.py b/Pyblio/GnomeUI/Fields.py
index d71fc75..ccb46ed 100644
--- a/Pyblio/GnomeUI/Fields.py
+++ b/Pyblio/GnomeUI/Fields.py
@@ -31,6 +31,7 @@ import copy
import string
import gtk
+from gettext import gettext as _
from Pyblio import Config, Fields, Types
from Pyblio.GnomeUI import Utils
diff --git a/Pyblio/GnomeUI/FileSelector.py b/Pyblio/GnomeUI/FileSelector.py
index a366510..bfc49e9 100644
--- a/Pyblio/GnomeUI/FileSelector.py
+++ b/Pyblio/GnomeUI/FileSelector.py
@@ -23,6 +23,7 @@
import os
import gtk
+from gettext import gettext as _
from Pyblio import Autoload
diff --git a/Pyblio/GnomeUI/Index.py b/Pyblio/GnomeUI/Index.py
index c31a4a7..ede107a 100644
--- a/Pyblio/GnomeUI/Index.py
+++ b/Pyblio/GnomeUI/Index.py
@@ -77,7 +77,7 @@ class Index (Connector.Publisher):
i = 0
self.gvpixbuf = gtk.gdk.pixbuf_new_from_file(
- os.path.join (version.pybdir, 'pixmaps', 'pybliographic-viewer.png'))
+ os.path.join (version.pixmapsdir, 'pybliographic-viewer.png'))
if True:
rend = gtk.CellRendererPixbuf ()
col = gtk.TreeViewColumn ('P', rend, pixbuf = len(fields))
diff --git a/Pyblio/GnomeUI/OpenURL.py b/Pyblio/GnomeUI/OpenURL.py
index 958776b..f84b39c 100644
--- a/Pyblio/GnomeUI/OpenURL.py
+++ b/Pyblio/GnomeUI/OpenURL.py
@@ -25,6 +25,7 @@
import gobject
import gtk
+from gettext import gettext as _
from Pyblio import Connector, Autoload
from Pyblio.GnomeUI import Utils
diff --git a/Pyblio/GnomeUI/Search.py b/Pyblio/GnomeUI/Search.py
index ef2cb43..13166ea 100644
--- a/Pyblio/GnomeUI/Search.py
+++ b/Pyblio/GnomeUI/Search.py
@@ -29,6 +29,7 @@ import sys
import traceback
import gtk
+from gettext import gettext as _
from Pyblio import Types, Search, Config, Connector, TextUI
from Pyblio.GnomeUI import Utils
diff --git a/Pyblio/GnomeUI/Sort.py b/Pyblio/GnomeUI/Sort.py
index 42504d8..0ff7ea9 100644
--- a/Pyblio/GnomeUI/Sort.py
+++ b/Pyblio/GnomeUI/Sort.py
@@ -27,6 +27,7 @@ import cPickle
import gtk
import gobject
+from gettext import gettext as _
from Pyblio import Connector, Sort, Config
from Pyblio.GnomeUI import Utils
diff --git a/Pyblio/GnomeUI/Utils.py b/Pyblio/GnomeUI/Utils.py
index d85bd2b..7f1abcc 100644
--- a/Pyblio/GnomeUI/Utils.py
+++ b/Pyblio/GnomeUI/Utils.py
@@ -26,6 +26,8 @@ import os
import gtk, pango
import gconf
+from gettext import gettext as _
+
class Callback:
diff --git a/Pyblio/GnomeUI/__init__.py b/Pyblio/GnomeUI/__init__.py
index 31c7d7b..c686935 100644
--- a/Pyblio/GnomeUI/__init__.py
+++ b/Pyblio/GnomeUI/__init__.py
@@ -27,6 +27,7 @@
import sys
import string
+from gettext import gettext as _
# correctly identify the program
import pygtk
diff --git a/Pyblio/GnomeUI/glade/Makefile.am b/Pyblio/GnomeUI/glade/Makefile.am
index 891d6c2..33909c5 100644
--- a/Pyblio/GnomeUI/glade/Makefile.am
+++ b/Pyblio/GnomeUI/glade/Makefile.am
@@ -1,5 +1,4 @@
gladedir = $(datadir)/$(PACKAGE)/Pyblio/GnomeUI/glade
-appicondir = $(datadir)/$(PACKAGE)/pixmaps
glade_DATA = \
fields.ui \
@@ -11,11 +10,4 @@ glade_DATA = \
config.ui \
openurl.ui
-EXTRA_DIST = $(glade_DATA) pyblio.ui.in
-
-pyblio.ui: pyblio.ui.in Makefile
- sed -e 's^\@icondir\@^$(appicondir)^g' \
- < $(srcdir)/pyblio.ui.in > pyblio.ui.tmp \
- && mv pyblio.ui.tmp pyblio.ui
-
-DISTCLEANFILES = pyblio.ui
+EXTRA_DIST = $(glade_DATA)
diff --git a/Pyblio/GnomeUI/glade/pyblio.ui.in b/Pyblio/GnomeUI/glade/pyblio.ui
similarity index 96%
rename from Pyblio/GnomeUI/glade/pyblio.ui.in
rename to Pyblio/GnomeUI/glade/pyblio.ui
index 5f9bcc4..724993c 100644
--- a/Pyblio/GnomeUI/glade/pyblio.ui.in
+++ b/Pyblio/GnomeUI/glade/pyblio.ui
@@ -5,7 +5,6 @@
<object class="GtkWindow" id="main">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Pybliographer</property>
- <property name="icon">@icondir@/pybliographic.png</property>
<signal name="key-press-event" handler="key_pressed" swapped="no"/>
<signal name="delete-event" handler="close_or_exit" swapped="no"/>
<child>
diff --git a/Pyblio/LyX.py b/Pyblio/LyX.py
index 2a1971d..65ed911 100644
--- a/Pyblio/LyX.py
+++ b/Pyblio/LyX.py
@@ -23,6 +23,8 @@ import os
import string
import signal
+from gettext import gettext as _
+
from Pyblio import Config
diff --git a/Pyblio/Makefile.am b/Pyblio/Makefile.am
index f2faddc..a7c8137 100644
--- a/Pyblio/Makefile.am
+++ b/Pyblio/Makefile.am
@@ -20,10 +20,11 @@
#
pybdir = $(datadir)/$(PACKAGE)/Pyblio
+pixmapsdir = $(datadir)/pixmaps
EXTRA_DIST = \
version.py.in \
- $(PYTHON)
+ $(pyb_DATA)
PYTHON = \
Autoload.py \
@@ -52,10 +53,22 @@ PYTHON = \
userexit.py \
userformat.py
-SUBDIRS = GnomeUI Output Format ConfDir Style
-
pyb_DATA = $(PYTHON) version.py
-version.py: $(srcdir)/version.py.in ../etc/installer
- $(SHELL) ../etc/installer < $(srcdir)/version.py.in > version.py
- @if test $(srcdir) != '.' ; then cp -f version.py $(srcdir) ; fi
+version.py: version.py.in
+ sed \
+ -e s!\@bin_dir\@!$(bindir)! \
+ -e s!\@libpyb\@!$(libdir)/$(PACKAGE)! \
+ -e s!\@datapyb\@!$(datadir)/$(PACKAGE)! \
+ -e s!\@package\@!$(PACKAGE)! \
+ -e s!\@version\@!$(VERSION)! \
+ -e s!\@locale_dir\@!$(localedir)! \
+ -e s!\@p_datadir\@!$(datadir)! \
+ -e s!\@pixmapsdir\@!$(pixmapsdir)! \
+ < $< > $@
+
+version.py: Makefile
+
+CLEANFILES = version.py
+
+SUBDIRS = GnomeUI Output Format ConfDir Style
diff --git a/Pyblio/Open.py b/Pyblio/Open.py
index 446112b..1f6b985 100644
--- a/Pyblio/Open.py
+++ b/Pyblio/Open.py
@@ -24,6 +24,7 @@ import sys
import urllib
import urlparse
+from gettext import gettext as _
from Pyblio import Autoload, Config, Exceptions, Fields, Help
diff --git a/Pyblio/Resource.py b/Pyblio/Resource.py
index 276094e..bd6d27e 100644
--- a/Pyblio/Resource.py
+++ b/Pyblio/Resource.py
@@ -32,6 +32,8 @@ import sys
import urllib
import gio
+from gettext import gettext as _
+
from Pyblio import Config, Fields, userexit
config_fields = 'resource/viewable-fields'
diff --git a/Pyblio/Style/Parser.py b/Pyblio/Style/Parser.py
index 5284b1d..e2ba1e1 100644
--- a/Pyblio/Style/Parser.py
+++ b/Pyblio/Style/Parser.py
@@ -24,6 +24,7 @@
import string
import re
+from gettext import gettext as _
from xml import sax
from Pyblio import Open, Autoload
diff --git a/Pyblio/version.py.in b/Pyblio/version.py.in
index 96f5e99..df1d3f9 100644
--- a/Pyblio/version.py.in
+++ b/Pyblio/version.py.in
@@ -1,7 +1,20 @@
# -*- python -*-
-datadir = "@p_datadir@"
-pybdir = "@datapyb@"
-localedir = "@locale_dir@"
-version = "@version@"
+import os.path
+_curdir = os.path.dirname(os.path.realpath(__file__))
+_topdir = os.path.dirname(os.path.join(_curdir, '..', '..'))
+_installed = not os.path.exists(os.path.join(_topdir, 'pybliographer.doap'))
+
+if _installed:
+ datadir = '@p_datadir@'
+ pybdir = '@datapyb@'
+ localedir = '@locale_dir@'
+ version = '@version@'
+ pixmapsdir = '@pixmapsdir@'
+else:
+ datadir = os.path.join(_topdir, 'data')
+ pybdir = _topdir
+ localedir = None
+ version = '@version@'
+ pixmapsdir = os.path.join(datadir, 'pixmaps')
diff --git a/autogen.sh b/autogen.sh
index 1dde36a..cd1ca85 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,28 +1,6 @@
#!/bin/sh
-aclocal_extra=""
-
-if [ -f .autogen.conf ] ; then
- echo "autogen.sh:sourcing .autogen.conf"
- . .autogen.conf
-fi
-
-verbose=1
-
-error ()
-{
- echo "autogen.sh: error: $*"
- exit 1
-}
-
-run ()
-{
- if [ $verbose = 1 ] ; then
- echo "autogen.sh: running: $*"
- fi
-
- $* || error "while running $*"
-}
+aclocal_extra="-I m4"
GNOMEDOC=`which yelp-build`
if test -z $GNOMEDOC; then
@@ -31,13 +9,12 @@ GNOMEDOC=`which yelp-build`
exit 1
fi
-run aclocal ${aclocal_extra}
-run autoconf
-run automake -a
+aclocal ${aclocal_extra}
+autoreconf --verbose --force --install || exit 1
if [ -x ./config.status ] ; then
- run ./config.status --recheck
- run ./config.status
+ ./config.status --recheck
+ ./config.status
else
- run ./configure $*
+ ./configure "$@" || exit 1
fi
diff --git a/configure.ac b/configure.ac
index 786b726..897e4ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,18 +27,19 @@ AC_INIT([pybliographer], [1.2.18])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-AC_CONFIG_SRCDIR(pybliographer.py)
+AC_CONFIG_SRCDIR(pybliographer.in)
AC_PROG_LN_S
-AC_PATH_PROG(Python, python, no)
+GETTEXT_PACKAGE=AC_PACKAGE_TARNAME
+AC_SUBST([GETTEXT_PACKAGE])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Gettext package])
-if test "${Python}" = "no" ; then
- AC_MSG_ERROR([please install python first])
-fi
+AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_GNU_GETTEXT
-dnl Python version
-MINIMUM_VERSION="2.2"
+AM_PATH_PYTHON(2.7)
+PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 2.24.0)
# PACKAGERS
AC_ARG_ENABLE([depchecks],
@@ -47,52 +48,31 @@ AC_ARG_ENABLE([depchecks],
[],
[enable_depchecks=yes])
-AC_MSG_CHECKING([python requirements])
-
-if test ${enable_depchecks} = "yes" ; then
-
-${Python} ${srcdir}/setup-check.py ${MINIMUM_VERSION} 2>&5 1>&2
-
-result=$?
-
-if test -f conftest.out ; then
- . ./conftest.out
- rm -f conftest.out
+AC_MSG_CHECKING([for module requirements])
+if test x${enable_depchecks} = "xyes" ; then
+ # Check that recode and bibtex work as expected
+ ${PYTHON} -c "import _recode as r, sys
+sys.exit(not r.recode(r.request('latin1..latex'), 'abcd') == 'abcd')" 2>/dev/null
+ if test $? -ne 0; then
+ AC_MSG_ERROR([Broken recode version])
+ fi
+
+ ${PYTHON} -c "import _bibtex;_bibtex.next_unfiltered" 2>/dev/null
+ if test $? -ne 0; then
+ AC_MSG_ERROR([python-bibtex module required with function 'next_unfiltered'])
+ fi
else
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([unable to run the test program])
+ AC_MSG_RESULT([disabled by user])
fi
-if test $result = 0 ; then
- if test -z "${Status}" ; then
- AC_MSG_RESULT([yes (python ${Python_Version}, python-gtk ${PyGtk_Version})])
- else
- AC_MSG_RESULT([assuming yes (${Status})])
- fi
-else
- AC_MSG_RESULT([no])
- AC_MSG_ERROR([${Status}])
-fi
-else
- AC_MSG_RESULT([disabled by user])
-fi
-dnl NLS is now hand-managed for python.
# Documentation
YELP_HELP_INIT
-AC_ARG_ENABLE(update-desktop-database,
-AC_HELP_STRING([--disable-update-desktop-database],
- [do not update desktop database after installation]),,
- enable_update_desktop_database=yes)
-
-AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
-
-AC_CONFIG_FILES(
+AC_CONFIG_FILES(
Makefile
- po/Makefile
- etc/installer
+ po/Makefile.in
scripts/Makefile
tests/Makefile
Pyblio/Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a3b3aac..ef1fd21 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -40,14 +40,14 @@ Pyblio/GnomeUI/Search.py
Pyblio/GnomeUI/Sort.py
Pyblio/GnomeUI/Utils.py
Pyblio/GnomeUI/__init__.py
-[type: gettext/glade]Pyblio/GnomeUI/glade/config.ui
-[type: gettext/glade]Pyblio/GnomeUI/glade/fields.ui
-[type: gettext/glade]Pyblio/GnomeUI/glade/format.ui
-[type: gettext/glade]Pyblio/GnomeUI/glade/medline.ui
-[type: gettext/glade]Pyblio/GnomeUI/glade/openurl.ui
-[type: gettext/glade]Pyblio/GnomeUI/glade/pyblio.ui.in
-[type: gettext/glade]Pyblio/GnomeUI/glade/search.ui
-[type: gettext/glade]Pyblio/GnomeUI/glade/sort.ui
+Pyblio/GnomeUI/glade/config.ui
+Pyblio/GnomeUI/glade/fields.ui
+Pyblio/GnomeUI/glade/format.ui
+Pyblio/GnomeUI/glade/medline.ui
+Pyblio/GnomeUI/glade/openurl.ui
+Pyblio/GnomeUI/glade/pyblio.ui.in
+Pyblio/GnomeUI/glade/search.ui
+Pyblio/GnomeUI/glade/sort.ui
Pyblio/Help.py
Pyblio/Iterator.py
Pyblio/Key.py
@@ -76,7 +76,8 @@ Pyblio/__init__.py
Pyblio/recode.py
Pyblio/userexit.py
Pyblio/version.py.in
-pybliographer.py
+pybliographer.in
+pybliographic.appdata.xml.in
pybliographic.desktop.in
scripts/pybliocheck.py
scripts/pybliocompact.py
diff --git a/pybliographer.py b/pybliographer.in
similarity index 100%
rename from pybliographer.py
rename to pybliographer.in
diff --git a/pybliographic.appdata.xml b/pybliographic.appdata.xml.in
similarity index 100%
rename from pybliographic.appdata.xml
rename to pybliographic.appdata.xml.in
diff --git a/pybliographic.desktop.in b/pybliographic.desktop.in
index 51f0fdd..0e6ffbc 100644
--- a/pybliographic.desktop.in
+++ b/pybliographic.desktop.in
@@ -1,7 +1,7 @@
[Desktop Entry]
-_Name=Pybliographer
-_GenericName=Bibliography Manager
-_Comment=Manage bibliographic databases
+Name=Pybliographer
+GenericName=Bibliography Manager
+Comment=Manage bibliographic databases
Icon=pybliographic
Exec=pybliographic
Terminal=false
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index a7095a3..9553181 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -52,6 +52,18 @@ EXTRA_DIST = pybscript.in \
$(bin_SCRIPTS):
$(LN_S) pybscript $@
-pybscript: $(srcdir)/pybscript.in ../etc/installer
- $(SHELL) ../etc/installer < $(srcdir)/pybscript.in > pybscript
- chmod 755 pybscript
+pybscript: pybscript.in Makefile
+ sed \
+ -e s!\@bin_dir\@!$(bindir)! \
+ -e s!\@libpyb\@!$(libdir)/$(PACKAGE)! \
+ -e s!\@datapyb\@!$(datadir)/$(PACKAGE)! \
+ -e s!\@package\@!$(PACKAGE)! \
+ -e s!\@version\@!$(VERSION)! \
+ -e s!\@locale_dir\@!$(localedir)! \
+ -e s!\@p_datadir\@!$(datadir)/$(PACKAGE)! \
+ < $< > $@
+ chmod 755 $@
+
+DISTCLEANFILES = pybscript
+
+CLEANFILES = $(bin_SCRIPTS)
diff --git a/scripts/pybliocompact.py b/scripts/pybliocompact.py
index 19980e6..011e3cd 100644
--- a/scripts/pybliocompact.py
+++ b/scripts/pybliocompact.py
@@ -27,6 +27,8 @@ import re
import copy
import sys
+from gettext import gettext as _
+
from Pyblio import Base, Config, Fields, Key
from Pyblio.Open import bibopen, bibwrite
diff --git a/scripts/pyblioconvert.py b/scripts/pyblioconvert.py
index a968d55..668211f 100644
--- a/scripts/pyblioconvert.py
+++ b/scripts/pyblioconvert.py
@@ -23,6 +23,8 @@
import sys
import string
+from gettext import gettext as _
+
import locale
charset = locale.getlocale () [1] or 'ascii'
diff --git a/scripts/pyblioformat.py b/scripts/pyblioformat.py
index 87ff569..c884578 100644
--- a/scripts/pyblioformat.py
+++ b/scripts/pyblioformat.py
@@ -26,6 +26,7 @@ import sys
import os
import getopt
+from gettext import gettext as _
from Pyblio import Autoload, Fields
from Pyblio.Style import Utils
diff --git a/scripts/pybliotex.py b/scripts/pybliotex.py
index 52ac223..e4f45c5 100644
--- a/scripts/pybliotex.py
+++ b/scripts/pybliotex.py
@@ -25,6 +25,7 @@ import string
import sys
import os
+from gettext import gettext as _
from Pyblio import Autoload, Fields
from Pyblio.Output import latexutils
diff --git a/scripts/pybliotext.py b/scripts/pybliotext.py
index 255aff7..0e8bc00 100644
--- a/scripts/pybliotext.py
+++ b/scripts/pybliotext.py
@@ -33,6 +33,7 @@ import copy
import sys
import getopt
+from gettext import gettext as _
from shutil import copyfile
from Pyblio import Base, Key, Autoload, Fields
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]