[pybliographer/gtk3] build: fix make distcheck



commit 467a6fb442dbdb6fd9f8e26dea535f1758da6855
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Fri Mar 21 00:28:35 2014 -0700

    build: fix make distcheck
    
    * Remove helper scripts install-check
    * Use intltool macros instead of manual handling for translation files
    * Add missing definitions to clean up
    * Add missing files to translate

 Makefile.am                          |   64 ++++++++++++++++++++++------------
 Pyblio/GnomeUI/glade/Makefile.am     |    2 +
 Pyblio/Makefile.am                   |   24 +++++++++---
 configure.ac                         |   16 +++++---
 etc/installer.in                     |   49 --------------------------
 po/Makefile.am                       |   55 -----------------------------
 po/POTFILES.in                       |   19 +++++-----
 pybliographer.py => pybliographer.in |    2 +-
 scripts/Makefile.am                  |   21 +++++++++--
 9 files changed, 101 insertions(+), 151 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 6523efc..c6b5792 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,7 +25,6 @@ pybdir  = $(datadir)/$(PACKAGE)
 appdir  = $(datadir)/applications
 
 SUBDIRS =      Pyblio          \
-               .               \
                scripts         \
                tests           \
                Styles          \
@@ -49,33 +48,54 @@ bin_SCRIPTS = pybliographer
 
 pyb_DATA = pybrc.py
 
+desktopdir = $(datadir)/applications
+desktop_in_files = pybliographic.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+
+ INTLTOOL_DESKTOP_RULE@
+
+INTLTOOL =                     \
+       intltool-extract.in     \
+       intltool-merge.in       \
+       intltool-update.in
+
 EXTRA_DIST =   setup-check.py                  \
-               pybliographer.py                \
-               etc/installer.in                \
+               pybliographer.in                \
                pybliographic.keys.in           \
                pybliographic.mime              \
-               pybliographic.desktop.in        \
                pybliographic.png               \
                pybliographic-logo.png          \
                pybliographic-viewer.png        \
-               gnome-doc-utils.make
-
-
-dist-hook:
-       intltool-merge -d po pybliographic.desktop.in $(distdir)/pybliographic.desktop
-
-pybliographic.desktop: pybliographic.desktop.in po/*.po
-       intltool-merge -d po pybliographic.desktop.in pybliographic.desktop \
-               || echo "**** Warning: cannot update desktop file"
-
-pybliographer: $(top_srcdir)/pybliographer.py etc/installer
-       $(SHELL) etc/installer < $(top_srcdir)/pybliographer.py > pybliographer
-       chmod 755 pybliographer
-
-pybliographic.keys: pybliographic.keys.in Makefile
-       sed -e 's^\ icondir\@^$(appicondir)^g' \
-       < $(srcdir)/pybliographic.keys.in > pybliographic.keys.tmp \
-       && mv pybliographic.keys.tmp pybliographic.keys
+               gnome-doc-utils.make \
+               $(desktop_in_files) $(INTLTOOL) $(pyb_DATA)
+
+CLEANFILES = pybliographer $(desktop_DATA)
+
+DISTCLEANFILES =               \
+       intltool-extract        \
+       intltool-merge          \
+       intltool-update         \
+       pybliographic.keys
+
+pybliographer: pybliographer.in
+       sed \
+               -e s!\ bin_dir\@!$(bindir)!               \
+               -e s!\ libpyb\@!$(libdir)/$(PACKAGE)!     \
+               -e s!\ datapyb\@!$(datadir)/$(PACKAGE)!   \
+               -e s!\ python_path\@!\ Python\@!          \
+               -e s!\ package\@!$(PACKAGE)!              \
+               -e s!\ version\@!$(VERSION)!              \
+               -e s!\ locale_dir\@!$(localedir)!         \
+               -e s!\ p_datadir\@!$(datadir)/$(PACKAGE)! \
+               < $< > $@
+       chmod 755 $@
+
+pybliographer: Makefile
+
+pybliographic.keys: pybliographic.keys.in
+       sed -e 's!\ icondir\@!$(appicondir)!g' < $< > $@
+
+pybliographic.keys: Makefile
 
 update_desktop_database = update-desktop-database $(DESTDIR)$(appdir) \
        || echo "**** Warning: cannot update mime cache (recommended for Gnome >= 2.8)"
diff --git a/Pyblio/GnomeUI/glade/Makefile.am b/Pyblio/GnomeUI/glade/Makefile.am
index 6f94ba7..dc38e46 100644
--- a/Pyblio/GnomeUI/glade/Makefile.am
+++ b/Pyblio/GnomeUI/glade/Makefile.am
@@ -17,3 +17,5 @@ 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
diff --git a/Pyblio/Makefile.am b/Pyblio/Makefile.am
index f2faddc..1d36b42 100644
--- a/Pyblio/Makefile.am
+++ b/Pyblio/Makefile.am
@@ -23,7 +23,7 @@ pybdir = $(datadir)/$(PACKAGE)/Pyblio
 
 EXTRA_DIST = \
        version.py.in   \
-       $(PYTHON)
+       $(pyb_DATA)
 
 PYTHON = \
        Autoload.py     \
@@ -52,10 +52,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!\ python_path\@!\ Python\@!          \
+               -e s!\ package\@!$(PACKAGE)!              \
+               -e s!\ version\@!$(VERSION)!              \
+               -e s!\ locale_dir\@!$(localedir)!         \
+               -e s!\ p_datadir\@!$(datadir)! \
+               < $< > $@
+
+version.py: Makefile
+
+CLEANFILES = version.py
+
+SUBDIRS = GnomeUI Output Format ConfDir Style
diff --git a/configure.ac b/configure.ac
index 1581933..552c43b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,7 @@ AC_INIT([pybliographer], [1.2.15])
 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
 
@@ -77,7 +77,12 @@ else
   AC_MSG_RESULT([disabled by user])
 fi
 
-dnl NLS is now hand-managed for python.
+# i18n
+IT_PROG_INTLTOOL([0.40.0])
+
+GETTEXT_PACKAGE=AC_PACKAGE_TARNAME
+AC_SUBST([GETTEXT_PACKAGE])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Gettext package])
 
 # Documentation
 GNOME_DOC_INIT
@@ -89,10 +94,9 @@ AC_HELP_STRING([--disable-update-desktop-database],
 
 AM_CONDITIONAL(ENABLE_UPDATE_DESKTOP_DATABASE, test x$enable_update_desktop_database = xyes)
 
-AC_CONFIG_FILES(       
-       Makefile 
-       po/Makefile
-       etc/installer
+AC_CONFIG_FILES(
+       Makefile
+       po/Makefile.in
        scripts/Makefile
        tests/Makefile
        Pyblio/Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8f0c1eb..1f9717a 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -23,6 +23,7 @@ Pyblio/Format/Refer.py
 Pyblio/Format/__init__.py
 Pyblio/Format/isifile.py
 Pyblio/Formatter.py
+Pyblio/GnomeUI/Compat.py
 Pyblio/GnomeUI/Config.py
 Pyblio/GnomeUI/Document.py
 Pyblio/GnomeUI/Editor.py
@@ -40,14 +41,14 @@ Pyblio/GnomeUI/Search.py
 Pyblio/GnomeUI/Sort.py
 Pyblio/GnomeUI/Utils.py
 Pyblio/GnomeUI/__init__.py
-Pyblio/GnomeUI/glade/config1.glade
-Pyblio/GnomeUI/glade/fields1.glade
-Pyblio/GnomeUI/glade/format.glade
-Pyblio/GnomeUI/glade/medline.glade
-Pyblio/GnomeUI/glade/openurl.glade
-Pyblio/GnomeUI/glade/pyblio.glade.in
-Pyblio/GnomeUI/glade/search.glade
-Pyblio/GnomeUI/glade/sort.glade
+Pyblio/GnomeUI/glade/config1.ui
+Pyblio/GnomeUI/glade/fields1.ui
+Pyblio/GnomeUI/glade/format.ui
+Pyblio/GnomeUI/glade/medline.ui
+Pyblio/GnomeUI/glade/openurl.ui
+Pyblio/GnomeUI/glade/pyblio.ui
+Pyblio/GnomeUI/glade/search.ui
+Pyblio/GnomeUI/glade/sort.ui
 Pyblio/Help.py
 Pyblio/Iterator.py
 Pyblio/Key.py
@@ -76,7 +77,7 @@ Pyblio/__init__.py
 Pyblio/recode.py
 Pyblio/userexit.py
 Pyblio/version.py.in
-pybliographer.py
+pybliographer.in
 pybliographic.desktop.in
 scripts/pybliocheck.py
 scripts/pybliocompact.py
diff --git a/pybliographer.py b/pybliographer.in
similarity index 99%
rename from pybliographer.py
rename to pybliographer.in
index 08b46dd..f773fdc 100644
--- a/pybliographer.py
+++ b/pybliographer.in
@@ -1,4 +1,4 @@
-#! @python_path@
+#!/usr/bin/env python
 # This file is part of pybliographer
 # 
 # Copyright (C) 1998-2004 Frederic GOBRY
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index a7095a3..56b9411 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -52,6 +52,21 @@ 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
+       sed \
+               -e s!\ bin_dir\@!$(bindir)!               \
+               -e s!\ libpyb\@!$(libdir)/$(PACKAGE)!     \
+               -e s!\ datapyb\@!$(datadir)/$(PACKAGE)!   \
+               -e s!\ python_path\@!\ Python\@!          \
+               -e s!\ package\@!$(PACKAGE)!              \
+               -e s!\ version\@!$(VERSION)!              \
+               -e s!\ locale_dir\@!$(localedir)!         \
+               -e s!\ p_datadir\@!$(datadir)/$(PACKAGE)! \
+               < $< > $@
+       chmod 755 $@
+
+pybscript: Makefile
+
+DISTCLEANFILES = pybscript
+
+CLEANFILES = $(bin_SCRIPTS)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]