File zfs-fuse-0.6.9-fix-buildsystem.patch of Package zfs-fuse

diff -ur zfs-fuse-0.6.9.orig/src/lib/libumem/SConscript zfs-fuse-0.6.9/src/lib/libumem/SConscript
--- zfs-fuse-0.6.9.orig/src/lib/libumem/SConscript	2010-06-04 21:03:04.000000000 +0200
+++ zfs-fuse-0.6.9/src/lib/libumem/SConscript	2010-11-17 15:38:58.000000000 +0100
@@ -1,5 +1,5 @@
 Import('env')
 
-Command("Makefile", [], ["cd lib/libumem && ./configure"])
+Command("Makefile", [], [env.subst("cd lib/libumem && CFLAGS=\"$CCFLAGS\" CPPFLAGS=\"$CPPFLAGS\" LDFLAGS=\"$LINKFLAGS\" ./configure").replace("-std=c99", "-std=gnu99")])
 Command("libumem.a", [Glob('*.c'),'Makefile',Glob('*.h')], ["cd lib/libumem && make && rm -f libumem.a && ln -s .libs/libumem.a"])
 
diff -ur zfs-fuse-0.6.9.orig/src/lib/libzpool/vdev.c zfs-fuse-0.6.9/src/lib/libzpool/vdev.c
--- zfs-fuse-0.6.9.orig/src/lib/libzpool/vdev.c	2010-06-04 21:03:04.000000000 +0200
+++ zfs-fuse-0.6.9/src/lib/libzpool/vdev.c	2010-11-17 15:21:45.000000000 +0100
@@ -43,6 +43,10 @@
 #include <syslog.h>
 #include <libintl.h>
 
+#ifndef LIBEXECDIR
+#define LIBEXECDIR "/usr/lib"
+#endif
+
 /*
  * Virtual device management.
  */
@@ -3056,7 +3060,7 @@
 		    return; // nothing of interest here
 	    }
 	    if (strcasecmp(top->spa_name,"$import")) {
-		snprintf(cmd,2048,"/etc/zfs/zfs_pool_alert %s &",top->spa_name);
+		snprintf(cmd,2048,LIBEXECDIR "/zfs_pool_alert %s &",top->spa_name);
 		syslog(LOG_WARNING,"running zfs_pool_alert for pool %s, status %s prev status %s",top->spa_name,zpool_state_to_name(state,save_state),
 			zpool_state_to_name(save_state,state));
 		int ret = system(cmd);
diff -ur zfs-fuse-0.6.9.orig/src/SConstruct zfs-fuse-0.6.9/src/SConstruct
--- zfs-fuse-0.6.9.orig/src/SConstruct	2010-06-04 21:03:04.000000000 +0200
+++ zfs-fuse-0.6.9/src/SConstruct	2010-11-17 15:24:44.000000000 +0100
@@ -8,6 +8,7 @@
 install_dir = ARGUMENTS.get('install_dir', '/usr/local/sbin')
 man_dir = ARGUMENTS.get('man_dir', '/usr/local/share/man/man8/')
 cfg_dir = ARGUMENTS.get('cfg_dir', '/etc/zfs')
+libexec_dir = ARGUMENTS.get('libexec_dir', '/usr/local/lib/zfs-fuse')
 
 env = Environment()
 
@@ -16,28 +17,22 @@
 f.close()
 
 env.CacheDir('/tmp/.zfs-fuse.scons')
-env['CC'] = 'gcc'
+if 'CC' in os.environ:
+  env['CC'] = os.environ['CC']
+else:
+  env['CC'] = 'gcc'
 env['LINKFLAGS'] = Split('-pipe -Wall')
+if 'LDFLAGS' in os.environ:
+  env.Append(LINKFLAGS = " "+os.environ['LDFLAGS'])
 env['CCFLAGS'] = Split('-pipe -Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" ')
 
 if osname == "Linux":
   env.Append(CPPFLAGS = " -DLINUX_AIO")
 
-debug = int(ARGUMENTS.get('debug', '0'))
-
-if not debug:
-	env.Append(LINKFLAGS = ['-s'])
-	env.Append(CCFLAGS = Split('-s -O2 -DNDEBUG'))
-else:
-	env.Append(LINKFLAGS = ['-ggdb'])
-	env.Append(CCFLAGS = ['-ggdb'])
-# Be careful here, one of DEBUG or NDEBUG must be defined, if you undef both, you'll get unexpected results
-	if debug == 1:
-		env.Append(CCFLAGS = Split('-O2 -DDEBUG'))
-	elif debug == 2:
-		env.Append(CCFLAGS = ['-DDEBUG'])
-	elif debug == 3:
-		env.Append(CCFLAGS = Split('-finstrument-functions -DDEBUG'))
+if 'CPPFLAGS' in os.environ:
+  env.Append(CPPFLAGS = " "+os.environ['CPPFLAGS'])
+if 'CCFLAGS' in os.environ:
+  env.Append(CPPFLAGS = " "+os.environ['CCFLAGS'])
 
 env['CPPPATH'] = []
 
@@ -99,7 +94,7 @@
 env.Install(install_dir, 'cmd/zfs/zfs')
 env.Install(install_dir, 'zfs-fuse/zfs-fuse')
 env.Install(install_dir, 'cmd/zstreamdump/zstreamdump')
-env.Install(cfg_dir, '../contrib/zfs_pool_alert')
+env.Install(libexec_dir, '../contrib/zfs_pool_alert')
 
 env.Install(man_dir, '../doc/zdb.8.gz')
 env.Install(man_dir, '../doc/zfs.8.gz')
@@ -110,4 +105,4 @@
     print "updating tags..."
     os.system("ctags --extra=+f `find -name '*.c'` `find -name '*.h'`")
 
-env.Alias('install', [install_dir, man_dir, cfg_dir])
+env.Alias('install', [install_dir, man_dir, cfg_dir, libexec_dir])
openSUSE Build Service is sponsored by