summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Hruby <michal.mhr@gmail.com>2010-06-07 21:50:44 +0200
committerMichal Hruby <michal.mhr@gmail.com>2010-06-07 21:50:44 +0200
commitf26aeb626bf8a92dd70433837caab4b69797ffa1 (patch)
tree0180dcb4e2c7ecfff1958df994fabaf93c265f54
parent918c2532a5d462a37d9b041558246ff77130989b (diff)
Use autotools for most plugins (FF still missing)
-rw-r--r--Makefile.am1
-rw-r--r--bzr/Makefile18
-rw-r--r--bzr/Makefile.am13
-rw-r--r--chrome/Makefile.am37
-rw-r--r--configure.ac22
-rw-r--r--eog/Makefile23
-rw-r--r--eog/Makefile.am19
-rw-r--r--geany/Makefile27
-rw-r--r--geany/Makefile.am35
-rw-r--r--gedit/Makefile23
-rw-r--r--npapi-plugin/Makefile19
-rw-r--r--npapi-plugin/Makefile.am25
-rw-r--r--npapi-plugin/np-zeitgeist.cc (renamed from npapi-plugin/np-zeitgeist.c)0
-rw-r--r--rhythmbox/Makefile22
-rw-r--r--rhythmbox/Makefile.am19
-rw-r--r--totem-libzg/Makefile45
-rw-r--r--totem-libzg/Makefile.am43
17 files changed, 211 insertions, 180 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..14df874
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = $(PLUGINS)
diff --git a/bzr/Makefile b/bzr/Makefile
deleted file mode 100644
index afd47f6..0000000
--- a/bzr/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-BZR_PLUGIN_DIR = ~/.bazaar/plugins/zeitgeist
-
-all: clean build
-
-build: ;
-
-clean: ;
-
-install: ;
-
-uninstall: ;
-
-local-install:
- mkdir -p $(BZR_PLUGIN_DIR)
- cp __init__.py $(BZR_PLUGIN_DIR)
-
-local-uninstall:
- -rm -rf $(BZR_PLUGIN_DIR)
diff --git a/bzr/Makefile.am b/bzr/Makefile.am
new file mode 100644
index 0000000..945ec50
--- /dev/null
+++ b/bzr/Makefile.am
@@ -0,0 +1,13 @@
+bzrplugindir = $(datadir)/pyshared/bzrlib/plugins/zeitgeist
+bzrplugin_DATA = __init__.py
+
+# we want to allow also local install
+BZR_PLUGIN_HOME_DIR = ~/.bazaar/plugins/zeitgeist
+
+local-install:
+ mkdir -p $(BZR_PLUGIN_HOME_DIR)
+ cp __init__.py $(BZR_PLUGIN_HOME_DIR)
+
+local-uninstall:
+ -rm -rf $(BZR_PLUGIN_HOME_DIR)
+
diff --git a/chrome/Makefile.am b/chrome/Makefile.am
index 6feca09..f3340db 100644
--- a/chrome/Makefile.am
+++ b/chrome/Makefile.am
@@ -1 +1,36 @@
-SUBDIRS = plugin
+chromeresourcedir = $(DESTDIR)/opt/google/chrome/resources/zeitgeist-plugin
+chromeresource_DATA = \
+ background.html \
+ content_script.js \
+ manifest.json \
+ zeitgeist.js
+
+pluginbinarydir = $(chromeresourcedir)/plugin
+pluginbinary_LTLIBRARIES = libzeitgeist-npapi-plugin.la
+
+libzeitgeist_npapi_plugin_la_SOURCES = \
+ plugin/np-zeitgeist.cc \
+ $(NULL)
+
+libzeitgeist_npapi_plugin_la_CXXFLAGS = \
+ -pedantic -fPIC -Wall -std=c++0x -O2 \
+ $(ZEITGEIST_CFLAGS) \
+ -I./plugin \
+ -I./plugin/third_party \
+ -I./plugin/third_party/npapi \
+ $(NULL)
+
+libzeitgeist_npapi_plugin_la_LIBADD = \
+ $(ZEITGEIST_LIBS) \
+ $(NULL)
+
+libzeitgeist_npapi_plugin_la_LDFLAGS = \
+ -Wl,--no-undefined \
+ -module -avoid-version \
+ $(NULL)
+
+# we want to allow also local install
+local-install: all
+ ln -s $(abs_srcdir)/.libs/libzeitgeist-npapi-plugin.so plugin/libzeitgeist-npapi-plugin.so
+
+local-uninstall: all
diff --git a/configure.ac b/configure.ac
index 3ec282c..5610c27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,6 +4,9 @@ AC_INIT([zeitgeist-dataproviders],
AM_INIT_AUTOMAKE([1.9 foreign])
+# Enable silent build when available (Automake 1.11)
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+
dnl pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
@@ -13,6 +16,7 @@ fi
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CXX
+AC_PROG_LIBTOOL
AC_STDC_HEADERS
dnl ==============================================
@@ -33,6 +37,7 @@ dnl Check commonly used packages
dnl ==============================================
PKG_CHECK_MODULES(ZEITGEIST, zeitgeist-1.0, [HAVE_LIBZG=yes], [HAVE_LIBZG=no])
+PKG_CHECK_MODULES(GTK, gtk+-2.0, [HAVE_GTK=yes], [HAVE_GTK=no])
dnl ==============================================
dnl Enable building only supported plugins
@@ -44,8 +49,11 @@ AC_ARG_ENABLE([all-plugins],
AC_MSG_RESULT($all_plugins)
# The full list of plugins
-allowed_plugins="bzr chrome eog firefox-libzg geany gedit npapi-plugin rhythmbox totem-libzg"
-# currently disabled = "epiphany tomboy"
+allowed_plugins="bzr chrome eog geany gedit rhythmbox totem-libzg"
+# currently disabled = "epiphany firefox-libzg tomboy"
+
+# npapi-plugin has a template Makefile.am, but don't use it directly
+# - see chrome's Makefile.am for how to compile it
plugin_error_or_ignore()
{
@@ -124,6 +132,10 @@ for plugin in ${used_plugins}; do
plugin_error_or_ignore "libzeitgeist not found"
continue
fi
+ if test "${HAVE_GTK}" != "yes" ; then
+ plugin_error_or_ignore "gtk+-2.0 not found"
+ continue
+ fi
PKG_CHECK_MODULES(TOTEM_PLPARSER, totem-plparser,
[HAVE_TOTEM_PLPARSER=yes], [HAVE_TOTEM_PLPARSER=no])
if test "${HAVE_TOTEM_PLPARSER}" != "yes" ; then
@@ -156,7 +168,13 @@ AC_SUBST([AM_LDFLAGS])
AC_OUTPUT([
Makefile
+bzr/Makefile
chrome/Makefile
+eog/Makefile
+geany/Makefile
+gedit/Makefile
+rhythmbox/Makefile
+totem-libzg/Makefile
])
AC_MSG_NOTICE([Zeitgeist-dataproviders was configured with the following options:])
diff --git a/eog/Makefile b/eog/Makefile
deleted file mode 100644
index 2461cc3..0000000
--- a/eog/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-EOG_PLUGIN_DIR = ~/.gnome2/eog/plugins
-PLUGIN_FILES = zeitgeist.eog-plugin zeitgeist_plugin.py
-
-all: clean build
-
-build: ;
-
-clean: ;
-
-install: ;
-
-uninstall: ;
-
-local-install:
- mkdir -p $(EOG_PLUGIN_DIR)
- cp $(PLUGIN_FILES) $(EOG_PLUGIN_DIR)
-
-local-uninstall:
- for f in $(PLUGIN_FILES); \
- do \
- echo remove $$f; \
- rm -f $(EOG_PLUGIN_DIR)/$$f; \
- done
diff --git a/eog/Makefile.am b/eog/Makefile.am
new file mode 100644
index 0000000..823a030
--- /dev/null
+++ b/eog/Makefile.am
@@ -0,0 +1,19 @@
+PLUGIN_FILES = zeitgeist.eog-plugin zeitgeist_plugin.py
+
+eogplugindir = $(libdir)/eog/plugins
+eogplugin_DATA = $(PLUGIN_FILES)
+
+# we want to allow also local install
+EOG_PLUGIN_HOME_DIR = ~/.gnome2/eog/plugins
+
+local-install:
+ mkdir -p $(EOG_PLUGIN_HOME_DIR)
+ cp $(PLUGIN_FILES) $(EOG_PLUGIN_HOME_DIR)
+
+local-uninstall:
+ for f in $(PLUGIN_FILES); \
+ do \
+ echo remove $$f; \
+ rm -f $(EOG_PLUGIN_HOME_DIR)/$$f; \
+ done
+
diff --git a/geany/Makefile b/geany/Makefile
deleted file mode 100644
index 9ae04e0..0000000
--- a/geany/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-GEANY_PLUGIN_DIR = ~/.config/geany/plugins
-PLUGIN_FILE = zeitgeist_dataprovider.so
-
-all: clean build
-
-zeitgeist_dataprovider.o:
- gcc -c zeitgeist_dataprovider.c -fPIC `pkg-config --cflags geany zeitgeist-1.0`
-
-zeitgeist_dataprovider.so:
- gcc zeitgeist_dataprovider.o -o zeitgeist_dataprovider.so -shared `pkg-config --libs geany zeitgeist-1.0`
-
-build: zeitgeist_dataprovider.o zeitgeist_dataprovider.so
-
-clean:
- -rm -f *.o
- -rm -f *.so
-
-install: ;
-
-uninstall: ;
-
-local-install:
- mkdir -p $(GEANY_PLUGIN_DIR)
- cp $(PLUGIN_FILE) $(GEANY_PLUGIN_DIR)
-
-local-uninstall:
- -rm -f $(GEANY_PLUGIN_DIR)/$(PLUGIN_FILE)
diff --git a/geany/Makefile.am b/geany/Makefile.am
new file mode 100644
index 0000000..6edcb45
--- /dev/null
+++ b/geany/Makefile.am
@@ -0,0 +1,35 @@
+geanyplugindir = $(libdir)/geany/plugins
+geanyplugin_LTLIBRARIES = zeitgeist_dataprovider.la
+
+zeitgeist_dataprovider_la_SOURCES = \
+ zeitgeist_dataprovider.c
+zeitgeist_dataprovider_la_CFLAGS = \
+ -fPIC -Wall -std=c99 \
+ $(ZEITGEIST_CFLAGS) \
+ $(GEANY_CFLAGS) \
+ $(NULL)
+
+zeitgeist_dataprovider_la_LIBADD = \
+ $(ZEITGEIST_LIBS) \
+ $(GEANY_LIBS) \
+ $(NULL)
+zeitgeist_dataprovider_la_LDFLAGS = \
+ -module -avoid-version \
+ $(NULL)
+
+# we want to allow also local install
+GEANY_PLUGIN_HOME_DIR = ~/.config/geany/plugins
+
+PLUGIN_FILES = zeitgeist_dataprovider.so
+
+local-install:
+ mkdir -p $(GEANY_PLUGIN_HOME_DIR)
+ cp $(PLUGIN_FILES) $(GEANY_PLUGIN_HOME_DIR)
+
+local-uninstall:
+ for f in $(PLUGIN_FILES); \
+ do \
+ echo remove $$f; \
+ rm -f $(GEANY_PLUGIN_HOME_DIR)/$$f; \
+ done
+
diff --git a/gedit/Makefile b/gedit/Makefile
deleted file mode 100644
index 07e14c0..0000000
--- a/gedit/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-GEDIT_PLUGIN_DIR = ~/.gnome2/gedit/plugins
-PLUGIN_FILES = zeitgeist.gedit-plugin zeitgeist_plugin.py
-
-all: clean build
-
-build: ;
-
-clean: ;
-
-install: ;
-
-uninstall: ;
-
-local-install:
- mkdir -p $(GEDIT_PLUGIN_DIR)
- cp $(PLUGIN_FILES) $(GEDIT_PLUGIN_DIR)
-
-local-uninstall:
- for f in $(PLUGIN_FILES); \
- do \
- echo remove $$f; \
- rm -f $(GEDIT_PLUGIN_DIR)/$$f; \
- done
diff --git a/npapi-plugin/Makefile b/npapi-plugin/Makefile
deleted file mode 100644
index d5b46a4..0000000
--- a/npapi-plugin/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# compiler and linker
-CC = g++
-
-# Customize below to fit your system
-
-INCS = `pkg-config --libs --cflags zeitgeist-1.0` -I./third_party -I./third_party/npapi -I./
-#INCS = `pkg-config --libs --cflags libxul nspr zeitgeist-1.0`
-CPPFLAGS = -DXULRUNNER_SDK
-CFLAGS = -g -pedantic -fPIC -Wall -std=c++0x -O2 ${INCS}
-
-OUTPUT = libzeitgeist-npapi-plugin.so
-
-all: $(OUTPUT)
-
-$(OUTPUT): np-zeitgeist.c
- $(CC) -Wl,--no-undefined -shared -o $@ $(CFLAGS) $<
-
-clean:
- rm -f $(OUTPUT)
diff --git a/npapi-plugin/Makefile.am b/npapi-plugin/Makefile.am
new file mode 100644
index 0000000..0fb6e3a
--- /dev/null
+++ b/npapi-plugin/Makefile.am
@@ -0,0 +1,25 @@
+noinst_LTLIBRARIES = libzeitgeist-npapi-plugin.la
+
+libzeitgeist_npapi_plugin_la_SOURCES = \
+ np-zeitgeist.cc \
+ $(NULL)
+
+libzeitgeist_npapi_plugin_la_CXXFLAGS = \
+ -pedantic -fPIC -Wall -std=c++0x -O2 \
+ $(ZEITGEIST_CFLAGS) \
+ -I./third_party -I./third_party/npapi -I./
+ $(NULL)
+
+libzeitgeist_npapi_plugin_la_LIBADD = \
+ $(ZEITGEIST_LIBS) \
+ $(NULL)
+libzeitgeist_npapi_plugin_la_LDFLAGS = \
+ -Wl,--no-undefined \
+ -module -avoid-version \
+ $(NULL)
+
+
+local-install: all
+
+local-uninstall: all
+
diff --git a/npapi-plugin/np-zeitgeist.c b/npapi-plugin/np-zeitgeist.cc
index de63dd7..de63dd7 100644
--- a/npapi-plugin/np-zeitgeist.c
+++ b/npapi-plugin/np-zeitgeist.cc
diff --git a/rhythmbox/Makefile b/rhythmbox/Makefile
deleted file mode 100644
index f7bd85e..0000000
--- a/rhythmbox/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-RB_PLUGIN_DIR = ~/.local/share/rhythmbox/plugins
-ZG_PLUGIN_DIR = $(RB_PLUGIN_DIR)/zeitgeist_plugin
-PLUGIN_FILE = zeitgeist.rb-plugin
-
-all: clean build
-
-build: ;
-
-clean: ;
-
-install: ;
-
-uninstall: ;
-
-local-install:
- mkdir -p $(ZG_PLUGIN_DIR)
- cp $(PLUGIN_FILE) $(RB_PLUGIN_DIR)
- cp __init__.py $(ZG_PLUGIN_DIR)
-
-local-uninstall:
- -rm -rf $(ZG_PLUGIN_DIR)
- -rm -rf $(RB_PLUGIN_DIR)/$(PLUGIN_FILE)
diff --git a/rhythmbox/Makefile.am b/rhythmbox/Makefile.am
new file mode 100644
index 0000000..af678dd
--- /dev/null
+++ b/rhythmbox/Makefile.am
@@ -0,0 +1,19 @@
+PLUGIN_FILES = zeitgeist.rb-plugin __init__.py
+
+rhythmboxplugindir = $(libdir)/rhythmbox/plugins/zeitgeist-plugin
+rhythmboxplugin_DATA = $(PLUGIN_FILES)
+
+# we want to allow also local install
+RHYTHMBOX_PLUGIN_HOME_DIR = ~/.local/share/rhythmbox/plugins/zeitgeist-plugin
+
+local-install:
+ mkdir -p $(RHYTHMBOX_PLUGIN_HOME_DIR)
+ cp $(PLUGIN_FILES) $(RHYTHMBOX_PLUGIN_HOME_DIR)
+
+local-uninstall:
+ for f in $(PLUGIN_FILES); \
+ do \
+ echo remove $$f; \
+ rm -f $(RHYTHMBOX_PLUGIN_HOME_DIR)/$$f; \
+ done
+
diff --git a/totem-libzg/Makefile b/totem-libzg/Makefile
deleted file mode 100644
index 917b1b3..0000000
--- a/totem-libzg/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-# compiler and linker
-CC = gcc
-VALAC = valac
-
-INCS = `pkg-config --libs --cflags zeitgeist-1.0 gtk+-2.0 totem-plparser`
-CFLAGS = -g -pedantic -fPIC -Wall -std=c99 -O2 $(INCS) -I./headers
-
-VALASOURCES = totem-zeitgeist-plugin.vala
-VALAFLAGS = --pkg zeitgeist-1.0 --vapidir=./vapi --pkg bacon-video --pkg totem
-
-OUTPUT = libtotem-zeitgeist-plugin.so
-
-TOTEM_PLUGIN_DIR = ~/.local/share/totem/plugins
-PLUGIN_FILES = zeitgeist.totem-plugin $(OUTPUT)
-
-.SUFFIXES: .c .vala
-
-.vala.c:
- $(VALAC) $(VALAFLAGS) -C $<
-
-# Yes, if we pass -Wl,--no-undefined the build will fail with undefined
-# totem_* functions, apparently these will be present when the extension
-# is run within totem.
-$(OUTPUT): $(VALASOURCES:.vala=.c)
- $(CC) -shared -o $@ $(CFLAGS) $<
-
-all: clean build
-
-build: $(OUTPUT)
- @true
-
-clean:
- rm -f $(OUTPUT) $(VALASOURCES:.vala=.c)
-
-local-install: $(PLUGIN_FILES)
- mkdir -p $(TOTEM_PLUGIN_DIR)
- cp $(PLUGIN_FILES) $(TOTEM_PLUGIN_DIR)
-
-local-uninstall:
- for f in $(PLUGIN_FILES); \
- do \
- echo remove $$f; \
- rm -f $(TOTEM_PLUGIN_DIR)/$$f; \
- done
-
diff --git a/totem-libzg/Makefile.am b/totem-libzg/Makefile.am
new file mode 100644
index 0000000..2f843c8
--- /dev/null
+++ b/totem-libzg/Makefile.am
@@ -0,0 +1,43 @@
+totemplugindir = $(libdir)/totem/plugins/zeitgeist
+totemplugin_DATA = zeitgeist.totem-plugin
+totemplugin_LTLIBRARIES = libtotem-zeitgeist-plugin.la
+
+AM_VALAFLAGS = \
+ --pkg zeitgeist-1.0 \
+ --vapidir=./vapi \
+ --pkg bacon-video \
+ --pkg totem \
+ $(NULL)
+
+libtotem_zeitgeist_plugin_la_SOURCES = \
+ totem-zeitgeist-plugin.vala
+libtotem_zeitgeist_plugin_la_CFLAGS = \
+ -fPIC -Wall -std=c99 \
+ $(ZEITGEIST_CFLAGS) \
+ $(GTK_CFLAGS) \
+ $(TOTEM_PLPARSER_CFLAGS) \
+ -I./headers \
+ $(NULL)
+
+libtotem_zeitgeist_plugin_la_LIBADD = \
+ $(ZEITGEIST_LIBS) \
+ $(GTK_LIBS) \
+ $(NULL)
+libtotem_zeitgeist_plugin_la_LDFLAGS = \
+ -module -avoid-version \
+ $(NULL)
+
+
+# we want to allow also local install
+PLUGIN_FILES = zeitgeist.totem-plugin ./.libs/libtotem-zeitgeist-plugin.so
+
+TOTEM_PLUGIN_HOME_DIR = ~/.local/share/totem/plugins/zeitgeist
+
+local-install:
+ mkdir -p $(TOTEM_PLUGIN_HOME_DIR)
+ cp $(PLUGIN_FILES) $(TOTEM_PLUGIN_HOME_DIR)
+
+local-uninstall:
+ echo Removing $(TOTEM_PLUGIN_HOME_DIR)
+ rm -rf $(TOTEM_PLUGIN_HOME_DIR)
+