Blob Blame History Raw
Patch by Robert Scheck <robert@fedoraproject.org> for fbpanel >= 4.12, to add some
changes to get the libraries into %{_libdir}/%{name} rather %{_datadir}/%{name}. It
doesn't change anything once --libdir parameter isn't used, so it has full legacy
compatibility and maybe gets applied by upstream as well.

Usage example of this patch for the use inside of a spec file e.g. for Fedora is:
  ./configure --prefix=%{_prefix} --libdir=%{_lib}
Don't use %{_libdir} for ./configure, just %{_lib} but everywhere else %{_libdir}
can be used. RPM macro %{_lib} normally expands to "lib" on 32 bit systems and to
"lib64" on 64 bit systems. The regular internal usage case is $(PREFIX)/$(LIBDIR)
which results in /usr/lib or /usr/lib64 depending on the CPU architecture.

--- fbpanel-4.12/configure			2007-04-24 14:40:45.000000000 +0200
+++ fbpanel-4.12/configure.libdir		2008-06-15 20:44:22.000000000 +0200
@@ -9,11 +9,13 @@
     echo "       <path>/bin - will hold all binaries"
     echo "       <path>/share/fbpanel - config files, pixmaps etc"
     echo "       default <path> is /usr"
+    echo "--libdir=[share|lib|lib64] - specify path for libraries"
     echo "--devel - enable devel mode: no optimization + debug symbols"
     echo "--cpu=[on|off] - enable linux cpu monitor plugin"
 }
 
 PREFIX="/usr"
+LIBDIR="share"
 PLUGIN_CPU="on"
 while [ $# -gt 0 ]; do
     case $1 in
@@ -24,6 +26,9 @@
         --prefix=*)
             PREFIX=`echo $1 | sed 's/--prefix=//'`
             ;;
+	--libdir=*)
+	    LIBDIR=`echo $1 | sed 's/--libdir=//'`
+	    ;;
 	--devel)
 	    DEVEL=1
 	    ;;
@@ -50,9 +55,11 @@
 echo "creating config.h"
 echo "//created by ./configure script" > config.h
 echo "#define PREFIX \"$PREFIX\"" >> config.h
+echo "#define LIBDIR \"$LIBDIR\"" >> config.h
 
 
 echo "creating Makefile.config"
 echo "PREFIX:=$PREFIX" > Makefile.config
+echo "LIBDIR:=$LIBDIR" >> Makefile.config
 echo "DEVEL:=$DEVEL" >> Makefile.config
 echo "PLUGIN_CPU:=$PLUGIN_CPU" >> Makefile.config
--- fbpanel-4.12/plugin.c			2007-04-21 13:28:25.000000000 +0200
+++ fbpanel-4.12/plugin.c.libdir		2008-06-15 20:46:51.000000000 +0200
@@ -137,7 +137,7 @@
         LOG(LOG_INFO, "   %s ... %s\n", str->str, m ? "ok" : "no");
         if (!m) {
             DBG("error is %s\n", g_module_error());
-            g_string_printf(str, "%s/share/fbpanel/plugins/%s.so", PREFIX, type);
+            g_string_printf(str, "%s/%s/fbpanel/plugins/%s.so", PREFIX, LIBDIR, type);
             m = g_module_open(str->str, G_MODULE_BIND_LAZY);
             LOG(LOG_INFO, "   %s ... %s\n", str->str, m ? "ok" : "no");
             if (!m) {
--- fbpanel-4.12/plugins/Makefile		2007-05-23 23:38:27.000000000 +0200
+++ fbpanel-4.12/plugins/Makefile.libdir	2008-06-15 20:45:01.000000000 +0200
@@ -47,9 +47,9 @@
 
 ifeq (0,$(STATIC_PLUGINS))
 install: 
-	install -d  $(PREFIX)/share/fbpanel/plugins
-	install -m 644 $(SOBJ) $(PREFIX)/share/fbpanel/plugins
+	install -d  $(PREFIX)/$(LIBDIR)/fbpanel/plugins
+	install -m 644 $(SOBJ) $(PREFIX)/$(LIBDIR)/fbpanel/plugins
 
 uninstall:
-	$(RM) -r $(PREFIX)/share/fbpanel/plugins/
+	$(RM) -r $(PREFIX)/$(LIBDIR)/fbpanel/plugins/
 endif
--- fbpanel-4.12/systray/Makefile		2007-04-21 13:28:25.000000000 +0200
+++ fbpanel-4.12/systray/Makefile.libdir	2008-06-15 20:47:16.000000000 +0200
@@ -41,10 +41,10 @@
 
 ifeq (0,$(STATIC_PLUGINS))
 install: 
-	install -d  $(PREFIX)/share/fbpanel/plugins
-	install -m 644 $(TARGET) $(PREFIX)/share/fbpanel/plugins
+	install -d  $(PREFIX)/$(LIBDIR)/fbpanel/plugins
+	install -m 644 $(TARGET) $(PREFIX)/$(LIBDIR)/fbpanel/plugins
 
 uninstall:
-	$(RM) $(PREFIX)/share/fbpanel/plugins/$(TARGET)
+	$(RM) $(PREFIX)/$(LIBDIR)/fbpanel/plugins/$(TARGET)
 
 endif