Update of /cvsroot/fink/experimental/bcully
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv30416
Added Files:
fuse.info sshfs.info sshfs.patch
Log Message:
Experimental MacFUSE port. Installs extension into /sw/Library/Extensions,
fs into /System/Library/Filesystems, both of which are naughty. Otherwise,
seems very nice.
--- NEW FILE: sshfs.info ---
Package: sshfs
Version: 1.7
Revision: 1
Source: mirror:sourceforge:fuse/%n-fuse-%v.tar.gz
Source-MD5: e91a2fed1da952a375798408dc6e41a0
PatchFile: %n.patch
PatchFile-MD5: ded7579df87a384d2b74cf6413ba923f
BuildDepends: fuse-dev, glib2-dev, pkgconfig, libgettext3-dev, fink (>= 0.24.12)
Depends: fuse, glib2, libgettext3-shlibs
CompileScript: <<
CFLAGS="-D__FreeBSD__=10 -O -g" ./configure --prefix=%p
--disable-dependency-tracking
<<
DocFiles: README COPYING NEWS FAQ.txt
Description: FUSE ssh filesystem
DescDetail: <<
This is a userlevel filesystem via SSH.
<<
License: GPL
Maintainer: Brendan Cully <[EMAIL PROTECTED]>
--- NEW FILE: fuse.info ---
Package: fuse
Version: 0.1.0b006
Revision: 1
Source: http://dev.kublai.com/macfuse-%v.tar.gz
Source-MD5: 3e481d7f966c53508930cf8a7def9c17
Source2: mirror:sourceforge:%n/%n-2.6.1.tar.gz
Source2-MD5: 13e1873086a1d7a95f470bbc7428c528
Shlibs: <<
%p/lib/libfuse.0.dylib 1.0.0 %n (>= 0.1.0b006-1)
%p/lib/libulockmgr.1.dylib 2.0.0 %n (>= 0.1.0b006-1)
<<
PatchScript: <<
sed -i.bak -e 's,/System/,%p/,' fusefs/load/load_fusefs.c
sed -i.bak -e 's,/System/,%p/,' libfuse/fuse-2.6.1-macosx.patch
cd ../fuse-2.6.1 && patch -p1 < ../macfuse-%v/libfuse/fuse-2.6.1-macosx.patch
<<
CompileScript: <<
#!/bin/sh -ev
cd fusefs
xcodebuild -target fusefs -configuration Release
xcodebuild -target load_fusefs -configuration Release
xcodebuild -target mount_fusefs -configuration Release
cd ../../fuse-2.6.1
CFLAGS="-D__FreeBSD__=10 -O -g" ./configure --prefix=%p
--disable-dependency-tracking
make
<<
InstallScript: <<
mkdir -p %i/Library/Extensions
cp -R fusefs/build/Release/fusefs.kext %i/Library/Extensions/
cp fusefs/build/Release/load_fusefs
%i/Library/Extensions/fusefs.kext/Contents/Resources/
# TODO: figure out where else we can put this
cp fusefs/build/Release/mount_fusefs fusefs/fusefs.fs/
mkdir -p %i/sbin
ln -s /System/Library/Filesystems/fusefs.fs/mount_fusefs %i/sbin
mkdir -p %d/System/Library/Filesystems
cp -R fusefs/fusefs.fs %d/System/Library/Filesystems/
cd ../fuse-2.6.1 && make install DESTDIR=%d
<<
PostInstScript: <<
chown -R root:wheel %p/Library/Extensions/fusefs.kext
chown -R root:wheel /System/Library/Filesystems/fusefs.fs
chmod u+s %p/Library/Extensions/fusefs.kext/Contents/Resources/load_fusefs
<<
DocFiles: COPYING HOWTO
SplitOff: <<
Package: fuse-dev
Depends: fuse (= %v-%r), pkgconfig
BuildDependsOnly: True
DocFiles: COPYING
Files: <<
include
lib/libfuse.dylib lib/libfuse.a
lib/libulockmgr.dylib lib/libulockmgr.a
lib/pkgconfig
<<
<<
Description: File systems in userspace
DescDetail: <<
This is MacFUSE, a port of FUSE (file systems in user space) for OS X.
<<
DescPort: <<
Use "sude daemonic enable fuse" to load the FUSE kernel module automatically.
<<
License: BSD
Maintainer: Brendan Cully <[EMAIL PROTECTED]>
--- NEW FILE: sshfs.patch ---
diff -Naur old/Makefile.in new/Makefile.in
--- old/Makefile.in 2006-08-17 03:07:05.000000000 -0700
+++ new/Makefile.in 2007-01-05 23:13:17.000000000 -0800
@@ -588,6 +588,9 @@
uninstall-local
+ifeq "$(shell uname)" "Darwin"
+all-local:
+else
all-local: sshnodelay.so
install-exec-local: sshnodelay.so
@@ -599,6 +602,7 @@
sshnodelay.so:
$(CC) -Wall -W -s --shared -fPIC $(sshnodelay_libs) sshnodelay.c -o
sshnodelay.so
+endif
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff -Naur old/sshfs.c new/sshfs.c
--- old/sshfs.c 2006-08-18 03:34:08.000000000 -0700
+++ new/sshfs.c 2007-01-05 21:07:40.000000000 -0800
@@ -18,7 +18,9 @@
#include <string.h>
#include <stdint.h>
#include <errno.h>
+#if !(__FreeBSD__ >= 10)
#include <semaphore.h>
+#endif
#include <pthread.h>
#include <netdb.h>
#include <signal.h>
@@ -100,6 +102,31 @@
#define SSHNODELAY_SO "sshnodelay.so"
+#if (__FreeBSD__ >= 10)
+
+#undef sem_t
+
+#undef sem_init
+#undef sem_destroy
+#undef sem_post
+#undef sem_wait
+
+#include <mach/mach.h>
+
+typedef semaphore_t sem_t;
+
+#define sem_init(s, a, b) \
+ semaphore_create(mach_task_self(), (s), SYNC_POLICY_FIFO, 0)
+#define sem_destroy(s) semaphore_destroy(mach_task_self(), (semaphore_t)*(s))
+#define sem_post(s) semaphore_signal((semaphore_t)*(s))
+#define sem_wait(s) semaphore_wait((semaphore_t)*(s))
+
+#ifndef LIBDIR
+#define LIBDIR "/usr/local/lib"
+#endif
+
+#endif
+
struct buffer {
uint8_t *p;
size_t len;
@@ -147,6 +174,9 @@
int is_seq;
int connver;
int modifver;
+#if (__FreeBSD__ >= 10)
+ int refs;
+#endif
};
struct sshfs {
@@ -687,8 +717,10 @@
} else if (pid == 0) {
int devnull;
+#if !(__FreeBSD__ >= 10)
if (sshfs.nodelay_workaround && do_ssh_nodelay_workaround() == -1)
fprintf(stderr, "warning: ssh nodelay workaround disabled\n");
+#endif
devnull = open("/dev/null", O_WRONLY);
@@ -1768,6 +1800,9 @@
pthread_cond_init(&sf->write_finished, NULL);
/* Assume random read after open */
sf->is_seq = 0;
+#if (__FreeBSD__ >= 10)
+ sf->refs = 1;
+#endif
sf->next_pos = 0;
sf->modifver= sshfs.modifver;
sf->connver = sshfs.connver;
@@ -1851,6 +1886,23 @@
return sshfs_flush(path, fi);
}
+#if (__FreeBSD__ >= 10)
+
+static void sshfs_file_put(struct sshfs_file *sf)
+{
+ sf->refs--;
+ if (!sf->refs)
+ g_free(sf);
+}
+
+static struct sshfs_file *sshfs_file_get(struct sshfs_file *sf)
+{
+ sf->refs++;
+ return sf;
+}
+
+#endif
+
static int sshfs_release(const char *path, struct fuse_file_info *fi)
{
struct sshfs_file *sf = get_sshfs_file(fi);
@@ -2109,8 +2161,13 @@
iov[1].iov_base = (void *) wbuf;
iov[1].iov_len = size;
if (!sshfs.sync_write && !sf->write_error)
+#if (__FreeBSD__ >= 10)
+ err = sftp_request_send(SSH_FXP_WRITE, iov, 2, sshfs_write_begin,
+ sshfs_write_end, 0, sshfs_file_get(sf), NULL);
+#else
err = sftp_request_send(SSH_FXP_WRITE, iov, 2, sshfs_write_begin,
sshfs_write_end, 0, sf, NULL);
+#endif
else
err = sftp_request_iov(SSH_FXP_WRITE, iov, 2, SSH_FXP_STATUS, NULL);
buf_free(&buf);
@@ -2149,6 +2206,11 @@
static int sshfs_create(const char *path, mode_t mode,
struct fuse_file_info *fi)
{
+#if (__FreeBSD__ >= 10)
+ if (fi) {
+ fi->flags |= O_CREAT;
+ }
+#endif
return sshfs_open_common(path, mode, fi);
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits