From 9f8ee8d8bb0fde950650560d77f79aec1e81512a Mon Sep 17 00:00:00 2001 From: Mathias Hasselmann Date: Sun, 10 Jan 2010 00:43:02 +0100 Subject: Add browser extension for accessing Facebook Add a browser extension which provides a D-Bus interface for accessing Faceboook without violating their terms of service. --- m4/facebook.m4 | 58 ++++++++++++++++++++++++++++++++-------------------------- m4/mozilla.m4 | 28 ++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 m4/mozilla.m4 (limited to 'm4') diff --git a/m4/facebook.m4 b/m4/facebook.m4 index 4a2fca1..150793b 100644 --- a/m4/facebook.m4 +++ b/m4/facebook.m4 @@ -1,32 +1,38 @@ -AC_DEFUN([FACEBOOK_APPKEY],[ +AC_DEFUN([GRUSCHLER_CHECK_FACEBOOK], +[ + AC_REQUIRE([AC_PROG_SED]) -AC_MSG_CHECKING([Facebook keys]) - -if ! test -r "facebook.conf"; then - AC_MSG_ERROR([facebook.conf not found]) -fi - -facebook_apikey=`sed -ne 's/^apikey=//p' facebook.conf` -facebook_secret=`sed -ne 's/^secret=//p' facebook.conf` -facebook_email=`sed -ne 's/^email=//p' facebook.conf` -facebook_password=`sed -ne 's/^password=//p' facebook.conf` + AC_MSG_CHECKING([for Facebook settings]) -if ! test -n "$facebook_apikey"; then - AC_MSG_ERROR([API key not found]) -fi + if ! test -f "facebook.conf"; then + AC_MSG_ERROR([facebook.conf not found]) + fi -if ! test -n "$facebook_secret"; then - AC_MSG_ERROR([secret key not found]) -fi + gruschler_facebook_apikey=`$SED -ne s/^apikey=//p facebook.conf` + gruschler_facebook_secret=`$SED -ne "s/^secret=//p" facebook.conf` + gruschler_facebook_email=`$SED -ne "s/^email=//p" facebook.conf` + gruschler_facebook_password=`$SED -ne "s/^password=//p" facebook.conf` -AC_DEFINE_UNQUOTED([$1_FACEBOOK_APIKEY], ["$facebook_apikey"], - [The API key for accessing Facebook]) -AC_DEFINE_UNQUOTED([$1_FACEBOOK_SECRET], ["$facebook_secret"], - [The secret key for accessing Facebook]) -AC_DEFINE_UNQUOTED([$1_FACEBOOK_DEFAULT_EMAIL], ["$facebook_email"], - [Default email address for accessing Facebook]) -AC_DEFINE_UNQUOTED([$1_FACEBOOK_DEFAULT_PASSWORD], ["$facebook_password"], - [Default password for accessing Facebook]) + if ! test -n "$gruschler_facebook_apikey"; then + AC_MSG_ERROR(['apikey' setting not found]) + fi -AC_MSG_RESULT([$facebook_apikey]) + if ! test -n "$gruschler_facebook_secret"; then + AC_MSG_ERROR(['secret' setting not found]) + fi + + AC_MSG_RESULT([yes]) + + AC_DEFINE_UNQUOTED([GRUSCHLER_FACEBOOK_APIKEY], + ["$gruschler_facebook_apikey"], + [The API key for accessing Facebook]) + AC_DEFINE_UNQUOTED([GRUSCHLER_FACEBOOK_SECRET], + ["$gruschler_facebook_secret"], + [The secret key for accessing Facebook]) + AC_DEFINE_UNQUOTED([GRUSCHLER_FACEBOOK_DEFAULT_EMAIL], + ["$gruschler_facebook_email"], + [Default email address for accessing Facebook]) + AC_DEFINE_UNQUOTED([GRUSCHLER_FACEBOOK_DEFAULT_PASSWORD], + ["$gruschler_facebook_password"], + [Default password for accessing Facebook]) ]) diff --git a/m4/mozilla.m4 b/m4/mozilla.m4 new file mode 100644 index 0000000..7b1f4ff --- /dev/null +++ b/m4/mozilla.m4 @@ -0,0 +1,28 @@ +AC_DEFUN([GRUSCHLER_CHECK_MOZILLA], +[ + PKG_CHECK_MODULES([MOZILLA],[libxul >= 3.6]) + + mozilla_idldir=$($PKG_CONFIG --variable=idldir libxul) + mozilla_libdir=$($PKG_CONFIG --variable=libdir libxul) + mozilla_prefix=$($PKG_CONFIG --variable=prefix libxul) + + if test -z "$mozilla_libdir" + then + mozilla_libdir="$mozilla_prefix/lib/$(basename $mozilla_idldir)" + fi + + mozilla_comdir="$mozilla_libdir/components" + MOZILLA_XPIDL="$mozilla_libdir/xpidl" + + AC_CHECK_FILE([$mozilla_idldir/nsISupports.idl]) + AC_CHECK_FILE([$mozilla_libdir/libxpcom.so]) + AC_CHECK_FILE([$mozilla_comdir]) + AC_CHECK_FILE([$MOZILLA_XPIDL]) + + AC_SUBST([mozilla_idldir]) + AC_SUBST([mozilla_libdir]) + AC_SUBST([mozilla_comdir]) + AC_SUBST([MOZILLA_XPIDL]) + + AC_DEFINE([MOZILLA_STRICT_API],[1],[Only use strict Mozilla API]) +]) -- cgit v1.2.3