[gthumb: 39/57] use m4 macros to define the extension rules



commit 4db291529fa83af336c7d87729d7e9bd09649a26
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Jun 17 14:33:58 2010 +0200

    use m4 macros to define the extension rules
    
    Use m4 macros to define the rules to create the extension
    ini file.  This allows to change the rules in one place.
    Changed the rule to make the extension version to follow the gthumb version.

 Makefile.am                                        |   46 ++++++-----
 configure.ac                                       |    2 +
 extensions/bookmarks/Makefile.am                   |    7 +-
 extensions/bookmarks/bookmarks.extension.in.in     |    4 +-
 extensions/burn_disc/Makefile.am                   |    7 +-
 extensions/burn_disc/burn_disc.extension.in.in     |    2 +-
 extensions/catalogs/Makefile.am                    |    7 +-
 extensions/catalogs/catalogs.extension.in.in       |    2 +-
 extensions/change_date/Makefile.am                 |    7 +-
 extensions/change_date/change_date.extension.in.in |    2 +-
 extensions/comments/Makefile.am                    |    7 +-
 extensions/comments/comments.extension.in.in       |    2 +-
 extensions/convert_format/Makefile.am              |    7 +-
 .../convert_format/convert_format.extension.in.in  |    2 +-
 extensions/desktop_background/Makefile.am          |    7 +-
 .../desktop_background.extension.in.in             |    2 +-
 extensions/edit_metadata/Makefile.am               |    7 +-
 .../edit_metadata/edit_metadata.extension.in.in    |    2 +-
 extensions/example/configure.ac.example            |    1 +
 extensions/example/src/Makefile.am                 |    7 +-
 extensions/example/src/example.extension.in.in     |    2 +-
 extensions/exiv2_tools/Makefile.am                 |    7 +-
 extensions/exiv2_tools/exiv2_tools.extension.in.in |    2 +-
 extensions/facebook/Makefile.am                    |    7 +-
 extensions/facebook/facebook.extension.in.in       |    2 +-
 extensions/file_manager/Makefile.am                |    7 +-
 .../file_manager/file_manager.extension.in.in      |    2 +-
 extensions/file_tools/Makefile.am                  |    7 +-
 extensions/file_tools/file_tools.extension.in.in   |    2 +-
 extensions/file_viewer/Makefile.am                 |    7 +-
 extensions/flicker/Makefile.am                     |    7 +-
 extensions/flicker/flicker.extension.in.in         |    2 +-
 extensions/gstreamer_tools/Makefile.am             |    7 +-
 .../gstreamer_tools.extension.in.in                |    2 +-
 extensions/gstreamer_utils/Makefile.am             |    7 +-
 extensions/image_print/Makefile.am                 |    7 +-
 extensions/image_print/image_print.extension.in.in |    2 +-
 extensions/image_rotation/Makefile.am              |    7 +-
 .../image_rotation/image_rotation.extension.in.in  |    2 +-
 extensions/image_viewer/Makefile.am                |    7 +-
 .../image_viewer/image_viewer.extension.in.in      |    2 +-
 extensions/importer/Makefile.am                    |    7 +-
 extensions/jpeg_utils/Makefile.am                  |    7 +-
 extensions/list_tools/Makefile.am                  |    7 +-
 extensions/list_tools/list_tools.extension.in.in   |    2 +-
 extensions/oauth/Makefile.am                       |    7 +-
 extensions/photo_importer/Makefile.am              |    7 +-
 .../photo_importer/photo_importer.extension.in.in  |    2 +-
 extensions/photobucket/Makefile.am                 |    7 +-
 extensions/photobucket/photobucket.extension.in.in |    2 +-
 extensions/picasaweb/Makefile.am                   |    7 +-
 extensions/picasaweb/picasaweb.extension.in.in     |    2 +-
 extensions/pixbuf_savers/Makefile.am               |    7 +-
 .../pixbuf_savers/pixbuf_savers.extension.in.in    |    2 +-
 extensions/raw_files/Makefile.am                   |    7 +-
 extensions/raw_files/raw_files.extension.in.in     |    2 +-
 extensions/red_eye_removal/Makefile.am             |    7 +-
 .../red_eye_removal.extension.in.in                |    2 +-
 extensions/rename_series/Makefile.am               |    7 +-
 .../rename_series/rename_series.extension.in.in    |    2 +-
 extensions/resize_images/Makefile.am               |    7 +-
 .../resize_images/resize_images.extension.in.in    |    2 +-
 extensions/search/Makefile.am                      |    7 +-
 extensions/search/search.extension.in.in           |    2 +-
 extensions/slideshow/Makefile.am                   |    7 +-
 extensions/slideshow/slideshow.extension.in.in     |    2 +-
 m4/Makefile.am                                     |    1 +
 m4/gthumb.m4                                       |   84 ++++++++++++++++++++
 68 files changed, 212 insertions(+), 220 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index b8859dd..dba762e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = copy-n-paste data po gthumb extensions tests help
+SUBDIRS = m4 copy-n-paste data po gthumb extensions tests help
 ACLOCAL_AMFLAGS = -I m4
 
 EXTRA_DIST =                    \
@@ -19,25 +19,31 @@ DISTCLEANFILES =                        \
 	intltool-update                 \
 	gnome-doc-utils.make
 
-MAINTAINERCLEANFILES = \
-	$(srcdir)/INSTALL \
-	$(srcdir)/aclocal.m4 \
-	$(srcdir)/autoscan.log \
-	$(srcdir)/compile \
-	$(srcdir)/config.guess \
-	$(srcdir)/config.h.in \
-	$(srcdir)/config.sub \
-	$(srcdir)/configure.scan \
-	$(srcdir)/depcomp \
-	$(srcdir)/install-sh \
-	$(srcdir)/ltmain.sh \
-	$(srcdir)/m4 \
-	$(srcdir)/missing \
-	$(srcdir)/mkinstalldirs \
-	$(srcdir)/omf.make \
-	$(srcdir)/xmldocs.make \
-	$(srcdir)/gtk-doc.make \
-	$(srcdir)/ChangeLog \
+MAINTAINERCLEANFILES = 			\
+	$(srcdir)/INSTALL		\
+	$(srcdir)/aclocal.m4 		\
+	$(srcdir)/autoscan.log 		\
+	$(srcdir)/compile 		\
+	$(srcdir)/config.guess 		\
+	$(srcdir)/config.h.in 		\
+	$(srcdir)/config.sub 		\
+	$(srcdir)/configure.scan 	\
+	$(srcdir)/depcomp 		\
+	$(srcdir)/install-sh 		\
+	$(srcdir)/ltmain.sh 		\
+	$(srcdir)/m4/gnome-doc-utils.m4	\
+	$(srcdir)/m4/intltool.m4	\
+	$(srcdir)/m4/libtool.m4		\
+	$(srcdir)/m4/lt~obsolete.m4	\
+	$(srcdir)/m4/ltoptions.m4	\
+	$(srcdir)/m4/ltsugar.m4		\
+	$(srcdir)/m4/ltversion.m4	\
+	$(srcdir)/missing 		\
+	$(srcdir)/mkinstalldirs 	\
+	$(srcdir)/omf.make 		\
+	$(srcdir)/xmldocs.make 		\
+	$(srcdir)/gtk-doc.make 		\
+	$(srcdir)/ChangeLog 		\
 	`find "$(srcdir)" -type f -name Makefile.in -print`
 
 GITIGNOREFILES = build .cdt* .cproject .project .settings/
diff --git a/configure.ac b/configure.ac
index 1a3b304..41b9808 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,7 @@ GNOME_DOC_INIT
 GNOME_MAINTAINER_MODE_DEFINES
 GNOME_COMPILE_WARNINGS([maximum])
 GNOME_CXX_WARNINGS
+GTHUMB_EXTENSION_RULES
 
 GLIB_REQUIRED=2.16.0
 GTK_REQUIRED=2.18.0
@@ -441,6 +442,7 @@ data/icons/hicolor/scalable/actions/Makefile
 data/icons/hicolor/scalable/apps/Makefile
 data/ui/Makefile
 help/Makefile
+m4/Makefile
 extensions/Makefile
 extensions/bookmarks/Makefile
 extensions/bookmarks/data/Makefile
diff --git a/extensions/bookmarks/Makefile.am b/extensions/bookmarks/Makefile.am
index eff8e26..e5291f5 100644
--- a/extensions/bookmarks/Makefile.am
+++ b/extensions/bookmarks/Makefile.am
@@ -21,11 +21,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = bookmarks.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/bookmarks/bookmarks.extension.in.in b/extensions/bookmarks/bookmarks.extension.in.in
index f598676..25757f3 100644
--- a/extensions/bookmarks/bookmarks.extension.in.in
+++ b/extensions/bookmarks/bookmarks.extension.in.in
@@ -1,9 +1,9 @@
 [Extension]
 _Name=Bookmarks
 _Description=Add bookmarks support.
-_Authors=Paolo Bacchilega <paobac src gnome org>
+_Authors=gthumb development team
 Copyright=Copyright © 2008-2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 URL=http://live.gnome.org/gthumb
 Category=Browser
 
diff --git a/extensions/burn_disc/Makefile.am b/extensions/burn_disc/Makefile.am
index 4790ce2..a8adb25 100644
--- a/extensions/burn_disc/Makefile.am
+++ b/extensions/burn_disc/Makefile.am
@@ -27,11 +27,8 @@ endif
 
 extensionini_in_files = burn_disc.extension.in.in
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files)
 
diff --git a/extensions/burn_disc/burn_disc.extension.in.in b/extensions/burn_disc/burn_disc.extension.in.in
index 69330a8..a42ca98 100644
--- a/extensions/burn_disc/burn_disc.extension.in.in
+++ b/extensions/burn_disc/burn_disc.extension.in.in
@@ -3,7 +3,7 @@ _Name=Burn CD/DVD
 _Description=Save files to an optical disc.
 _Authors=gthumb development team
 Copyright=Copyright © 2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=brasero
 Category=Exporter
 
diff --git a/extensions/catalogs/Makefile.am b/extensions/catalogs/Makefile.am
index def1776..cbbb1e5 100644
--- a/extensions/catalogs/Makefile.am
+++ b/extensions/catalogs/Makefile.am
@@ -31,11 +31,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = catalogs.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/catalogs/catalogs.extension.in.in b/extensions/catalogs/catalogs.extension.in.in
index 3049ed1..800f72f 100644
--- a/extensions/catalogs/catalogs.extension.in.in
+++ b/extensions/catalogs/catalogs.extension.in.in
@@ -3,7 +3,7 @@ _Name=Catalogs
 _Description=Create file collections.
 _Authors=gthumb development team
 Copyright=Copyright © 2008-2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 URL=http://live.gnome.org/gthumb
 Icon=file-catalog
 Category=Browser
diff --git a/extensions/change_date/Makefile.am b/extensions/change_date/Makefile.am
index 9fb44b4..5b9336b 100644
--- a/extensions/change_date/Makefile.am
+++ b/extensions/change_date/Makefile.am
@@ -23,11 +23,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = change_date.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/change_date/change_date.extension.in.in b/extensions/change_date/change_date.extension.in.in
index 8b0be3f..9fa7c35 100644
--- a/extensions/change_date/change_date.extension.in.in
+++ b/extensions/change_date/change_date.extension.in.in
@@ -3,7 +3,7 @@ _Name=Change date
 _Description=Change the files date
 _Authors=gthumb development team
 Copyright=Copyright © 2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=List-Tool
 
 [Loader]
diff --git a/extensions/comments/Makefile.am b/extensions/comments/Makefile.am
index e3aeb54..f1f4132 100644
--- a/extensions/comments/Makefile.am
+++ b/extensions/comments/Makefile.am
@@ -24,11 +24,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = comments.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/comments/comments.extension.in.in b/extensions/comments/comments.extension.in.in
index 0cfabc6..fe8f62b 100644
--- a/extensions/comments/comments.extension.in.in
+++ b/extensions/comments/comments.extension.in.in
@@ -3,7 +3,7 @@ _Name=Comments and tags
 _Description=Add comments and tags to any file type.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=Metadata
 
 [Loader]
diff --git a/extensions/convert_format/Makefile.am b/extensions/convert_format/Makefile.am
index 43a85f6..7844b2b 100644
--- a/extensions/convert_format/Makefile.am
+++ b/extensions/convert_format/Makefile.am
@@ -22,11 +22,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = convert_format.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/convert_format/convert_format.extension.in.in b/extensions/convert_format/convert_format.extension.in.in
index ae81738..17ae336 100644
--- a/extensions/convert_format/convert_format.extension.in.in
+++ b/extensions/convert_format/convert_format.extension.in.in
@@ -3,7 +3,7 @@ _Name=Convert format
 _Description=Save images in a different format
 _Authors=gthumb development team
 Copyright=Copyright © 2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=List-Tool
 
 [Loader]
diff --git a/extensions/desktop_background/Makefile.am b/extensions/desktop_background/Makefile.am
index defa57f..8c8e00b 100644
--- a/extensions/desktop_background/Makefile.am
+++ b/extensions/desktop_background/Makefile.am
@@ -18,11 +18,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = desktop_background.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/desktop_background/desktop_background.extension.in.in b/extensions/desktop_background/desktop_background.extension.in.in
index ee7734f..d520d4d 100644
--- a/extensions/desktop_background/desktop_background.extension.in.in
+++ b/extensions/desktop_background/desktop_background.extension.in.in
@@ -3,7 +3,7 @@ _Name=Desktop background
 _Description=Set the image as desktop background
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=desktop
 Category=List-Tool
 
diff --git a/extensions/edit_metadata/Makefile.am b/extensions/edit_metadata/Makefile.am
index e1683fc..a77c10c 100644
--- a/extensions/edit_metadata/Makefile.am
+++ b/extensions/edit_metadata/Makefile.am
@@ -25,11 +25,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = edit_metadata.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@  )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/edit_metadata/edit_metadata.extension.in.in b/extensions/edit_metadata/edit_metadata.extension.in.in
index da42d99..a133e9c 100644
--- a/extensions/edit_metadata/edit_metadata.extension.in.in
+++ b/extensions/edit_metadata/edit_metadata.extension.in.in
@@ -3,7 +3,7 @@ _Name=Edit metadata
 _Description=Allow to edit files metadata.
 _Authors=gthumb development team
 Copyright=Copyright © 2009-2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 URL=http://live.gnome.org/gthumb
 Category=Metadata
 
diff --git a/extensions/example/configure.ac.example b/extensions/example/configure.ac.example
index 1cd20cd..65766cd 100644
--- a/extensions/example/configure.ac.example
+++ b/extensions/example/configure.ac.example
@@ -27,6 +27,7 @@ GNOME_COMMON_INIT
 GNOME_DOC_INIT
 GNOME_MAINTAINER_MODE_DEFINES
 GNOME_COMPILE_WARNINGS([maximum])
+GTHUMB_EXTENSION_INIT(2.12)
 
 GLIB_REQUIRED=2.16.0
 GTK_REQUIRED=2.16.0
diff --git a/extensions/example/src/Makefile.am b/extensions/example/src/Makefile.am
index f87f71a..dcf2bcc 100644
--- a/extensions/example/src/Makefile.am
+++ b/extensions/example/src/Makefile.am
@@ -12,11 +12,8 @@ extensioninidir = $(EXTENSION_DIR)
 extensionini_in_files = example.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/example/src/example.extension.in.in b/extensions/example/src/example.extension.in.in
index 4379e11..d8e20e3 100644
--- a/extensions/example/src/example.extension.in.in
+++ b/extensions/example/src/example.extension.in.in
@@ -3,7 +3,7 @@ _Name=Example
 _Description=Extension example.
 Authors=gthumb development team
 Copyright=Copyright © 2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 
 [Loader]
 Type=module
diff --git a/extensions/exiv2_tools/Makefile.am b/extensions/exiv2_tools/Makefile.am
index 7f21b5b..7bf5ae6 100644
--- a/extensions/exiv2_tools/Makefile.am
+++ b/extensions/exiv2_tools/Makefile.am
@@ -27,11 +27,8 @@ endif
 
 extensionini_in_files = exiv2_tools.extension.in.in
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files)
 
diff --git a/extensions/exiv2_tools/exiv2_tools.extension.in.in b/extensions/exiv2_tools/exiv2_tools.extension.in.in
index 90b9da8..8234157 100644
--- a/extensions/exiv2_tools/exiv2_tools.extension.in.in
+++ b/extensions/exiv2_tools/exiv2_tools.extension.in.in
@@ -3,7 +3,7 @@ _Name=EXIF, IPTC, XMP support
 _Description=Read and write exif, iptc and xmp metadata.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=Metadata
 
 [Loader]
diff --git a/extensions/facebook/Makefile.am b/extensions/facebook/Makefile.am
index 7306437..7185940 100644
--- a/extensions/facebook/Makefile.am
+++ b/extensions/facebook/Makefile.am
@@ -48,11 +48,8 @@ endif
 
 extensionini_in_files = facebook.extension.in.in
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files)
 
diff --git a/extensions/facebook/facebook.extension.in.in b/extensions/facebook/facebook.extension.in.in
index ad73f88..8b63715 100644
--- a/extensions/facebook/facebook.extension.in.in
+++ b/extensions/facebook/facebook.extension.in.in
@@ -3,7 +3,7 @@ _Name=Facebook
 _Description=Upload images to Facebook
 Authors=gthumb development team
 Copyright=Copyright © 2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=facebook
 Category=Exporter
 
diff --git a/extensions/file_manager/Makefile.am b/extensions/file_manager/Makefile.am
index a9c9876..c3d8ee6 100644
--- a/extensions/file_manager/Makefile.am
+++ b/extensions/file_manager/Makefile.am
@@ -25,11 +25,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = file_manager.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/file_manager/file_manager.extension.in.in b/extensions/file_manager/file_manager.extension.in.in
index 66a24f5..a6759e2 100644
--- a/extensions/file_manager/file_manager.extension.in.in
+++ b/extensions/file_manager/file_manager.extension.in.in
@@ -3,7 +3,7 @@ _Name=File manager
 _Description=File manager operations.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=system-file-manager
 Category=Browser
 
diff --git a/extensions/file_tools/Makefile.am b/extensions/file_tools/Makefile.am
index b08b910..4bfe8b6 100644
--- a/extensions/file_tools/Makefile.am
+++ b/extensions/file_tools/Makefile.am
@@ -45,11 +45,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = file_tools.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/file_tools/file_tools.extension.in.in b/extensions/file_tools/file_tools.extension.in.in
index a81ac6f..4c7bc3f 100644
--- a/extensions/file_tools/file_tools.extension.in.in
+++ b/extensions/file_tools/file_tools.extension.in.in
@@ -3,7 +3,7 @@ _Name=Image tools
 _Description=Basic tools to modify images.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=palette
 Category=File-Tool
 
diff --git a/extensions/file_viewer/Makefile.am b/extensions/file_viewer/Makefile.am
index dc4ef6b..aa1e6a1 100644
--- a/extensions/file_viewer/Makefile.am
+++ b/extensions/file_viewer/Makefile.am
@@ -15,11 +15,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = file_viewer.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/flicker/Makefile.am b/extensions/flicker/Makefile.am
index 5184e4d..fc123fc 100644
--- a/extensions/flicker/Makefile.am
+++ b/extensions/flicker/Makefile.am
@@ -48,11 +48,8 @@ endif
 
 extensionini_in_files = flicker.extension.in.in
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files)
 
diff --git a/extensions/flicker/flicker.extension.in.in b/extensions/flicker/flicker.extension.in.in
index 9030291..17f0dea 100644
--- a/extensions/flicker/flicker.extension.in.in
+++ b/extensions/flicker/flicker.extension.in.in
@@ -3,7 +3,7 @@ _Name=Flicker
 _Description=Upload images to Flickr
 Authors=gthumb development team
 Copyright=Copyright © 2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=flickr
 Category=Exporter
 
diff --git a/extensions/gstreamer_tools/Makefile.am b/extensions/gstreamer_tools/Makefile.am
index 7ef8299..944fa2c 100644
--- a/extensions/gstreamer_tools/Makefile.am
+++ b/extensions/gstreamer_tools/Makefile.am
@@ -28,11 +28,8 @@ endif
 
 extensionini_in_files = gstreamer_tools.extension.in.in
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files)
 
diff --git a/extensions/gstreamer_tools/gstreamer_tools.extension.in.in b/extensions/gstreamer_tools/gstreamer_tools.extension.in.in
index 33b3d02..5fa73a0 100644
--- a/extensions/gstreamer_tools/gstreamer_tools.extension.in.in
+++ b/extensions/gstreamer_tools/gstreamer_tools.extension.in.in
@@ -3,7 +3,7 @@ _Name=Audio/Video support
 _Description=Play audio and video files.
 _Authors=gthumb development team
 Copyright=Copyright © 2009-2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=video-x-generic
 Category=Viewer
 
diff --git a/extensions/gstreamer_utils/Makefile.am b/extensions/gstreamer_utils/Makefile.am
index b0f4a4b..0005acb 100644
--- a/extensions/gstreamer_utils/Makefile.am
+++ b/extensions/gstreamer_utils/Makefile.am
@@ -23,11 +23,8 @@ endif
 
 extensionini_in_files = gstreamer_utils.extension.in.in
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files)
 
diff --git a/extensions/image_print/Makefile.am b/extensions/image_print/Makefile.am
index f479f84..52b9c7d 100644
--- a/extensions/image_print/Makefile.am
+++ b/extensions/image_print/Makefile.am
@@ -26,11 +26,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = image_print.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/image_print/image_print.extension.in.in b/extensions/image_print/image_print.extension.in.in
index 64e9f5e..19fdaad 100644
--- a/extensions/image_print/image_print.extension.in.in
+++ b/extensions/image_print/image_print.extension.in.in
@@ -3,7 +3,7 @@ _Name=Image print
 _Description=Allow to print images choosing the page layout.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=document-print
 Category=List-Tool
 
diff --git a/extensions/image_rotation/Makefile.am b/extensions/image_rotation/Makefile.am
index ce6171d..2f2e839 100644
--- a/extensions/image_rotation/Makefile.am
+++ b/extensions/image_rotation/Makefile.am
@@ -22,11 +22,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = image_rotation.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/image_rotation/image_rotation.extension.in.in b/extensions/image_rotation/image_rotation.extension.in.in
index 98d83ee..85dd674 100644
--- a/extensions/image_rotation/image_rotation.extension.in.in
+++ b/extensions/image_rotation/image_rotation.extension.in.in
@@ -3,7 +3,7 @@ _Name=Image rotation
 _Description=Rotate images without data loss.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=List-Tool
 
 [Loader]
diff --git a/extensions/image_viewer/Makefile.am b/extensions/image_viewer/Makefile.am
index 5f8db35..55b8b8a 100644
--- a/extensions/image_viewer/Makefile.am
+++ b/extensions/image_viewer/Makefile.am
@@ -21,11 +21,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = image_viewer.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/image_viewer/image_viewer.extension.in.in b/extensions/image_viewer/image_viewer.extension.in.in
index 75cb00f..2eaadb3 100644
--- a/extensions/image_viewer/image_viewer.extension.in.in
+++ b/extensions/image_viewer/image_viewer.extension.in.in
@@ -3,7 +3,7 @@ _Name=Image viewer
 _Description=Basic image viewing.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=image-x-generic
 Category=Viewer
 
diff --git a/extensions/importer/Makefile.am b/extensions/importer/Makefile.am
index afe7674..bc600da 100644
--- a/extensions/importer/Makefile.am
+++ b/extensions/importer/Makefile.am
@@ -52,11 +52,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = importer.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 BUILT_SOURCES = $(ENUM_TYPES)
diff --git a/extensions/jpeg_utils/Makefile.am b/extensions/jpeg_utils/Makefile.am
index e91fbf0..a8088de 100644
--- a/extensions/jpeg_utils/Makefile.am
+++ b/extensions/jpeg_utils/Makefile.am
@@ -36,11 +36,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = jpeg_utils.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) README.6b README.8a
 
diff --git a/extensions/list_tools/Makefile.am b/extensions/list_tools/Makefile.am
index 09949b4..5abffa2 100644
--- a/extensions/list_tools/Makefile.am
+++ b/extensions/list_tools/Makefile.am
@@ -29,11 +29,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = list_tools.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/list_tools/list_tools.extension.in.in b/extensions/list_tools/list_tools.extension.in.in
index d26d1c7..0b16814 100644
--- a/extensions/list_tools/list_tools.extension.in.in
+++ b/extensions/list_tools/list_tools.extension.in.in
@@ -3,7 +3,7 @@ _Name=File list tools
 _Description=Scripting and batch manipulation of files.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=applications-engineering
 Category=List-Tool
 
diff --git a/extensions/oauth/Makefile.am b/extensions/oauth/Makefile.am
index deb10ad..836a891 100644
--- a/extensions/oauth/Makefile.am
+++ b/extensions/oauth/Makefile.am
@@ -27,11 +27,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = oauth.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/photo_importer/Makefile.am b/extensions/photo_importer/Makefile.am
index 9cac725..81c04e9 100644
--- a/extensions/photo_importer/Makefile.am
+++ b/extensions/photo_importer/Makefile.am
@@ -22,11 +22,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = photo_importer.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 DISTCLEANFILES = $(extensionini_DATA) 
diff --git a/extensions/photo_importer/photo_importer.extension.in.in b/extensions/photo_importer/photo_importer.extension.in.in
index 1d95d70..5b2fc43 100644
--- a/extensions/photo_importer/photo_importer.extension.in.in
+++ b/extensions/photo_importer/photo_importer.extension.in.in
@@ -3,7 +3,7 @@ _Name=Import photos
 _Description=Import photos from removable devices.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=camera-photo
 Category=Importer
 
diff --git a/extensions/photobucket/Makefile.am b/extensions/photobucket/Makefile.am
index 638896f..56da058 100644
--- a/extensions/photobucket/Makefile.am
+++ b/extensions/photobucket/Makefile.am
@@ -35,11 +35,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = photobucket.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/photobucket/photobucket.extension.in.in b/extensions/photobucket/photobucket.extension.in.in
index 9d3ae74..c3201e6 100644
--- a/extensions/photobucket/photobucket.extension.in.in
+++ b/extensions/photobucket/photobucket.extension.in.in
@@ -3,7 +3,7 @@ _Name=PhotoBucket
 _Description=Upload images to PhotoBucket
 Authors=gthumb development team
 Copyright=Copyright © 2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=photobucket
 Category=Exporter
 
diff --git a/extensions/picasaweb/Makefile.am b/extensions/picasaweb/Makefile.am
index 9bf10d8..a4fa961 100644
--- a/extensions/picasaweb/Makefile.am
+++ b/extensions/picasaweb/Makefile.am
@@ -49,11 +49,8 @@ endif
 
 extensionini_in_files = picasaweb.extension.in.in
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files)
 
diff --git a/extensions/picasaweb/picasaweb.extension.in.in b/extensions/picasaweb/picasaweb.extension.in.in
index 1c85e97..8f5dc2d 100644
--- a/extensions/picasaweb/picasaweb.extension.in.in
+++ b/extensions/picasaweb/picasaweb.extension.in.in
@@ -3,7 +3,7 @@ _Name=Picasa Web Albums
 _Description=Upload images to Picasa Web Albums
 Authors=gthumb development team
 Copyright=Copyright © 2010 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=picasaweb
 Category=Exporter
 
diff --git a/extensions/pixbuf_savers/Makefile.am b/extensions/pixbuf_savers/Makefile.am
index 918021e..5b8ca14 100644
--- a/extensions/pixbuf_savers/Makefile.am
+++ b/extensions/pixbuf_savers/Makefile.am
@@ -54,11 +54,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = pixbuf_savers.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 DISTCLEANFILES = $(extensionini_DATA)
diff --git a/extensions/pixbuf_savers/pixbuf_savers.extension.in.in b/extensions/pixbuf_savers/pixbuf_savers.extension.in.in
index 19097a7..e8012b7 100644
--- a/extensions/pixbuf_savers/pixbuf_savers.extension.in.in
+++ b/extensions/pixbuf_savers/pixbuf_savers.extension.in.in
@@ -3,7 +3,7 @@ _Name=Save images
 _Description=Save images in common file formats such as JPEG, PNG and TIFF
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=Browser
 
 [Loader]
diff --git a/extensions/raw_files/Makefile.am b/extensions/raw_files/Makefile.am
index 99442a5..8bcba5f 100644
--- a/extensions/raw_files/Makefile.am
+++ b/extensions/raw_files/Makefile.am
@@ -13,11 +13,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = raw_files.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/raw_files/raw_files.extension.in.in b/extensions/raw_files/raw_files.extension.in.in
index 416756d..e628324 100644
--- a/extensions/raw_files/raw_files.extension.in.in
+++ b/extensions/raw_files/raw_files.extension.in.in
@@ -3,7 +3,7 @@ _Name=Raw format support
 _Description=Allow to load raw format images.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=Viewer
 
 [Loader]
diff --git a/extensions/red_eye_removal/Makefile.am b/extensions/red_eye_removal/Makefile.am
index 8c145f2..ea3e33a 100644
--- a/extensions/red_eye_removal/Makefile.am
+++ b/extensions/red_eye_removal/Makefile.am
@@ -17,11 +17,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = red_eye_removal.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/red_eye_removal/red_eye_removal.extension.in.in b/extensions/red_eye_removal/red_eye_removal.extension.in.in
index 981214f..994d662 100644
--- a/extensions/red_eye_removal/red_eye_removal.extension.in.in
+++ b/extensions/red_eye_removal/red_eye_removal.extension.in.in
@@ -3,7 +3,7 @@ _Name=Red-eye removal
 _Description=Tool to remove the red-eye effect from a photo.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=File-Tool
 
 [Loader]
diff --git a/extensions/rename_series/Makefile.am b/extensions/rename_series/Makefile.am
index ddddbb4..21db13e 100644
--- a/extensions/rename_series/Makefile.am
+++ b/extensions/rename_series/Makefile.am
@@ -24,11 +24,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = rename_series.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/rename_series/rename_series.extension.in.in b/extensions/rename_series/rename_series.extension.in.in
index 1b38258..536145a 100644
--- a/extensions/rename_series/rename_series.extension.in.in
+++ b/extensions/rename_series/rename_series.extension.in.in
@@ -3,7 +3,7 @@ _Name=Rename files
 _Description=Rename series of files.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=List-Tool
 
 [Loader]
diff --git a/extensions/resize_images/Makefile.am b/extensions/resize_images/Makefile.am
index fce4a68..29f7b2f 100644
--- a/extensions/resize_images/Makefile.am
+++ b/extensions/resize_images/Makefile.am
@@ -22,11 +22,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = resize_images.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/resize_images/resize_images.extension.in.in b/extensions/resize_images/resize_images.extension.in.in
index bc92b66..4ccb05c 100644
--- a/extensions/resize_images/resize_images.extension.in.in
+++ b/extensions/resize_images/resize_images.extension.in.in
@@ -3,7 +3,7 @@ _Name=Resize images
 _Description=Resize series of images.
 _Authors=gthumb development team
 Copyright=Copyright © 2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Category=List-Tool
 
 [Loader]
diff --git a/extensions/search/Makefile.am b/extensions/search/Makefile.am
index 1b17d05..c7d1f9c 100644
--- a/extensions/search/Makefile.am
+++ b/extensions/search/Makefile.am
@@ -27,11 +27,8 @@ extensioninidir = $(extensiondir)
 extensionini_in_files = search.extension.in.in
 extensionini_DATA = $(extensionini_in_files:.extension.in.in=.extension)
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files) 
 
diff --git a/extensions/search/search.extension.in.in b/extensions/search/search.extension.in.in
index d77d80b..a98706c 100644
--- a/extensions/search/search.extension.in.in
+++ b/extensions/search/search.extension.in.in
@@ -3,7 +3,7 @@ _Name=Search
 _Description=File search tool.
 _Authors=gthumb development team
 Copyright=Copyright © 2008-2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=edit-find
 Category=Browser
 
diff --git a/extensions/slideshow/Makefile.am b/extensions/slideshow/Makefile.am
index e40a44c..72e431b 100644
--- a/extensions/slideshow/Makefile.am
+++ b/extensions/slideshow/Makefile.am
@@ -32,11 +32,8 @@ DISTCLEANFILES = $(extensionini_DATA)
 
 extensionini_in_files = slideshow.extension.in.in
 
-%.extension.in: %.extension.in.in $(extension_LTLIBRARIES)
-	$(AM_V_GEN)( sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
-	$< > $@ )
-
-%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+ GTHUMB_EXTENSION_IN_RULE@
+ GTHUMB_EXTENSION_RULE@
 
 EXTRA_DIST = $(extensionini_in_files)
 
diff --git a/extensions/slideshow/slideshow.extension.in.in b/extensions/slideshow/slideshow.extension.in.in
index d12ecb6..22c5212 100644
--- a/extensions/slideshow/slideshow.extension.in.in
+++ b/extensions/slideshow/slideshow.extension.in.in
@@ -3,7 +3,7 @@ _Name=Slideshow
 _Description=View images as a slideshow.
 _Authors=gthumb development team
 Copyright=Copyright © 2008-2009 The Free Software Foundation, Inc.
-Version=1.0
+Version=%VERSION%
 Icon=x-office-presentation
 Category=Browser
 
diff --git a/m4/Makefile.am b/m4/Makefile.am
new file mode 100644
index 0000000..ae44c94
--- /dev/null
+++ b/m4/Makefile.am
@@ -0,0 +1 @@
+-include $(top_srcdir)/git.mk
diff --git a/m4/gthumb.m4 b/m4/gthumb.m4
new file mode 100644
index 0000000..0b62eda
--- /dev/null
+++ b/m4/gthumb.m4
@@ -0,0 +1,84 @@
+## gthumb.m4 - Help macros for gthumb extensions. -*-Shell-script-*-
+## Copyright © Paolo Bacchilega <paobac src gnome org>
+##
+## Started from epiphany.m4, which contains the following copyright note:
+## Copyright © Crispin Flowerday <crispin gnome 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# Usage:
+#   GTHUMB_EXTENSION_INIT(gthumb-api-version, [gthumb-minimum-version])
+#
+AC_DEFUN([GTHUMB_EXTENSION_INIT],
+[
+dnl Check we have an api-version
+ifelse([$1], [], [AC_MSG_ERROR([Required gthumb API version not supplied])], [])
+
+_gthumb_api_version=$1
+
+AC_MSG_CHECKING([whether gthumb-$_gthumb_api_version is available])
+PKG_CHECK_EXISTS([gthumb-$_gthumb_api_version], [result=yes],[result=no]) 
+AC_MSG_RESULT([$result])
+
+if test $result = "no" ; then
+    AC_MSG_ERROR([gthumb API version $_gthumb_api_version is required
+
+This API version is used in the $_gthumb_api_version stable series, and
+the preceeding development series. Please ensure you have the appropriate
+gthumb version installed.])
+fi
+
+dnl Check the minimum version
+ifelse([$2], [], [],
+[
+  AC_MSG_CHECKING([whether minimum gthumb version $2 is available])
+  PKG_CHECK_EXISTS([gthumb-$_gthumb_api_version >= $2], [result=yes], [result=no])
+  AC_MSG_RESULT([$result])
+
+  if test $result = "no" ; then
+      AC_MSG_ERROR([The minimum gthumb version supported by this application is $2.
+
+Please upgrade to at least $2. If you have compiled a later version it is
+possible pkg-config isn't finding it, in which case set the PKG_CONFIG_PATH
+environment variable.])
+  fi
+])
+
+dnl set the GTHUMB_EXTENSIONS_DIR variable
+GTHUMB_EXTENSIONS_DIR="`$PKG_CONFIG --variable=extensionsdir gthumb-$_gthumb_api_version`"
+AC_SUBST([GTHUMB_EXTENSIONS_DIR])
+
+GTHUMB_EXTENSION_RULES
+
+])
+
+
+AC_DEFUN([GTHUMB_EXTENSION_RULES],
+[
+
+dnl Add a rule that auto-translates the .extension files
+dnl like the INTLTOOL_XML_RULE does for xml files
+GTHUMB_EXTENSION_RULE='%.extension: %.extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
+AC_SUBST(GTHUMB_EXTENSION_RULE)
+
+GTHUMB_EXTENSION_IN_RULE='%.extension.in: %.extension.in.in $(extension_LTLIBRARIES) ; sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" -e "s|%VERSION%|$(VERSION)|" $< > [$]@'
+AC_SUBST(GTHUMB_EXTENSION_IN_RULE)
+
+])
\ No newline at end of file



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