# $Id: Portfile 36749 2008-05-14 04:56:13Z eridius@macports.org $ PortSystem 1.0 name macfuse version 1.5 categories fuse devel platforms darwin maintainers eridius@macports.org description A FUSE-Compliant File System Implementation Mechanism for Mac OS X long_description MacFUSE implements a mechanism that makes it possible to implement \ a fully functional file system in a user-space program on Mac OS X \ (10.4 and above). It aims to be API-compliant with the FUSE \ (File-system in USErspace) mechanism that originated on Linux. \ Therefore, many existing FUSE file systems become readily usable on \ Mac OS X. The core of MacFUSE is in a dynamically loadable kernel extension. homepage http://code.google.com/p/macfuse/ master_sites macports distname macfuse-${version} worksrcdir macfuse-core checksums md5 ad13b08cfeb573e130a47aba070885ae \ sha1 6012a79a73c90285ed5dd6282f6ec74fb23a8dd0 patchfiles patch-10.4-project.pbxproj patch-10.5-project.pbxproj livecheck.distname MacFUSE-Core-(.*).dmg livecheck.version 10.5-${version}.1 use_bzip2 yes use_configure no destroot.violate_mtree yes # patchfiles patch-project.pbxproj platform darwin 8 { # dummy for pre-fetch } platform darwin 9 { # dummy for pre-fetch } variant universal { # provide a dummy variant since the script will actually build universal # and we don't want to error out if someone says +universal } # ensure that user is running OS X 10.4 or higher pre-fetch { if {![variant_isset darwin_8] && ![variant_isset darwin_9]} { return -code error "MacFUSE requires at least Mac OS X 10.4 to run" } } build { system "cd ${worksrcpath} && ./build_macfuse.sh | sed -ne '/^created: /h;p;$\{g;s/^created: // w ../dmgname \}'; exit $\{PIPESTATUS\[0\]\}" } destroot { set dmgname [exec cat ${workpath}/dmgname] # we know the build script generates a .tar.bz2 right next to the dmg set tarname [string tolower [string replace $dmgname end-2 end "tar.bz2"]] system "tar -xjf $tarname -C ${destpath}" delete ${destpath}/opt file rename ${destpath}/usr ${destpath}/opt foreach f [list "pkgconfig/fuse.pc" "libfuse.la" "libulockmgr.la"] { set path "${destpath}/opt/local/lib/${f}" reinplace s,/usr/local,/opt/local, $path } foreach lib [list "libulockmgr.0" "libfuse.0"] { set libpath "/opt/local/lib/${lib}.dylib" system "install_name_tool -id ${libpath} ${destpath}${libpath}" } system "install_name_tool -change /usr/local/lib/libfuse.0.dylib /opt/local/lib/libfuse.0.dylib ${destpath}/Library/Frameworks/MacFUSE.framework/Versions/A/MacFUSE" # delete the whole directory the build script creates # when updating this Portfile DOUBLE CHECK THIS LINE delete [file dirname $dmgname] } post-activate { if {[string length [exec kextstat -lb com.google.filesystems.fusefs]] > 0} { ui_msg "********************************************************" ui_msg "* fusefs is already loaded. You may need to restart. *" ui_msg "* Alternatively, if feeling adventurous, you can run *" ui_msg "* `sudo kextunload -b com.google.filesystems.fusefs` *" ui_msg "********************************************************" } }