--- f-spot-0.1.11/configure.in	2006/07/27 11:39:54	1.1
+++ f-spot-0.1.11/configure.in	2006/07/27 13:28:17
@@ -201,13 +201,26 @@ else
 	gnome_screensaver_prefix=$prefix		   
 fi
 
-if test -d $gnome_screensaver_prefix/lib/gnome-screensaver; then
+PKG_CHECK_EXISTS(gnome-screensaver, have_gs_pkgconfig=yes, have_gs_pkgconfig=no)
+if test "$have_gs_pkgconfig" = "yes"; then
+	gs_pc_prefix=`$PKG_CONFIG --variable=prefix gnome-screensaver`
+	gs_pc_saverdir=`$PKG_CONFIG --variable=privlibexecdir gnome-screensaver`
+	gs_pc_themesdir=`$PKG_CONFIG --variable=themesdir gnome-screensaver`
+fi
+
+if test "$have_gs_pkgconfig" = "yes" && test "x$gs_pc_prefix" = "x$gnome_screensaver_prefix"; then
+	GNOME_SCREENSAVER_SAVERDIR=$gs_pc_saverdir
+elif test -d $gnome_screensaver_prefix/lib/gnome-screensaver; then
 	GNOME_SCREENSAVER_SAVERDIR=$gnome_screensaver_prefix/lib/gnome-screensaver/gnome-screensaver
 else 
 	GNOME_SCREENSAVER_SAVERDIR=$gnome_screensaver_prefix/libexec/gnome-screensaver
 fi
 
-GNOME_SCREENSAVER_THEMESDIR=$gnome_screensaver_prefix/share/applications/screensavers
+if test "$have_gs_pkgconfig" = "yes" && test "x$gs_pc_prefix" = "x$gnome_screensaver_prefix"; then
+	GNOME_SCREENSAVER_THEMESDIR=$gs_pc_themesdir
+else
+	GNOME_SCREENSAVER_THEMESDIR=$gnome_screensaver_prefix/share/applications/screensavers
+fi
 
 AC_SUBST(GNOME_SCREENSAVER_SAVERDIR)
 AC_SUBST(GNOME_SCREENSAVER_THEMESDIR)
