public
Description: Git mirror of the MacPorts svn repo
Homepage: http://www.macports.org
Clone URL: git://github.com/kballard/macports.git
commit  dbfa175b11a8e9874f545a9aa0e226de7c38ae6e
tree    535cfd8193ef8997bd21f90527a32daea2fb73d4
parent  e403352e82f8dd5dd9f6887f5d3b0a3e5c9b11f9
macports / dports / fuse / macfuse / Portfile
100644 91 lines (76 sloc) 3.407 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# $Id$
 
PortSystem 1.0
 
name macfuse
version 1.3
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 fd80b07221174f1636502c0062c43690 \
                    sha1 d840ba3dbd56850b6b9d10a3937fb2cbdacbffbc
 
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 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 "********************************************************"
    }
}