source: trunk/dports/fuse/fuse4x-kext/Portfile @ 114429

Last change on this file since 114429 was 114429, checked in by ryandesign@…, 7 years ago

fuse4x, fuse4x-framework, fuse4x-kext: fix homepage (#39456; maintainer timeout)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 114429 2013-12-08 09:16:35Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           xcode 1.0
6
7name                fuse4x-kext
8version             0.9.2
9set tag             [string map {. _ } $version]
10categories          fuse devel
11platforms           macosx
12maintainers         dports
13description         A kernel extension for Fuse4X
14
15long_description    Fuse4X implements a mechanism that makes it          \
16                    possible to implement a fully functional file        \
17                    system in a user-space program on Mac OS X. It       \
18                    aims to be API-compliant with the FUSE               \
19                    (File-system in USErspace) mechanism that            \
20                    originated on Linux.  Therefore, many existing       \
21                    FUSE file systems become readily usable on Mac OS    \
22                    X. This port provides the dynamically loadable       \
23                    kernel extension at the core of Fuse4X.
24
25homepage            http://fuse4x.github.io/
26license             BSD
27master_sites        https://github.com/fuse4x/kext/tarball/fuse4x_${tag}
28
29checksums           sha256  6755c61582667dfcb544ebe9b3b8292b18c235a9bdfa99e7d1081da9ed8c78d4 \
30                    rmd160  543a548e0a90f9bee3a77adcc7ca4eadebf6b596
31
32extract.mkdir       yes
33extract.post_args   "| tar --strip-components=1 -xf -"
34
35# This port installs a kernel module, so it must be built for the same
36# architecture as the kernel. We don't have a way to get that;
37# build_arch is the userland architecture, which may be different
38# (e.g. 64-bit userland with 32-bit kernel). So build a universal
39# binary by default on Intel platforms. On PPC, there's only one
40# kernel, so don't try to build it ppc64 or universal.
41supported_archs     i386 x86_64 ppc
42if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
43    default_variants    +universal
44}
45
46# kext destination: kext will be installed into ${kextdir}/fuse4x.kext.
47#
48# The kext is autoloaded by the library using load_fuse4x, so it
49# doesn't have to go into /System/Library/Extensions. It doesn't
50# matter where we put it, as long as it's kept in sync with the library.
51#
52# If updating the patchfile or ${kextdir}, must also update the
53# corresponding patch in the fuse4x port!
54patchfiles          patch-common_fuse_param.h.diff
55set kextdir        "${prefix}/Library/Extensions"
56post-patch {
57    reinplace "s|@@KEXTPATH@@|${kextdir}/fuse4x.kext|" ${worksrcpath}/common/fuse_param.h
58}
59
60xcode.configuration Release
61
62destroot.asroot     yes
63
64destroot {
65    xinstall -d ${destroot}${kextdir}
66    file copy ${worksrcpath}/build/${xcode.configuration}/fuse4x.kext ${destroot}${kextdir}
67    file attributes ${destroot}${kextdir}/fuse4x.kext -owner root -group wheel -permissions rwxr-xr-x
68
69    xinstall -d ${destroot}${kextdir}/fuse4x.kext/Support
70    xinstall -o root -m 4755 ${worksrcpath}/build/${xcode.configuration}/load_fuse4x ${destroot}${kextdir}/fuse4x.kext/Support
71}
72
73
74variant trace description {Enable debug logging: logs all filesystem operations} {
75    xcode.build.settings GCC_PREPROCESSOR_DEFINITIONS='FUSE4X_COUNT_MEMORY FUSE4X_DEBUG FUSE4X_TRACE_LK FUSE4X_TRACE_MSLEEP FUSE4X_TRACE_OP FUSE4X_TRACE_VNCACHE FUSE4X_SERIALIZE_LOGGING'
76}
77
78# We don't need to load the kext, because the fuse4x library will
79# autoload it when needed. However, if there's an existing version
80# loaded, we'd better unload it because it might be a different
81# version.
82#
83# Thus, check whether the kext is already loaded, and if so attempt to
84# unload it. If that fails, the user probably needs to unmount some
85# running filesystems; print a list.
86#
87# We do this both after deactivating an existing version (because the
88# user might be removing the port) and after activating a new version
89# (because the user might be upgrading from an installation that
90# didn't unload the kext).
91proc try_unload_kext {} {
92    set kextid "org.fuse4x.kext.fuse4x"
93    if {[string length [exec /usr/sbin/kextstat -lb $kextid]] > 0} {
94        ui_msg "The Fuse4X kernel extension is already loaded. Attempting to unload it."
95        if {![catch {exec /sbin/kextunload -b $kextid}]} {
96            ui_msg "Successfully unloaded the previous installation of Fuse4X"
97        } else {
98            set mounted [exec /sbin/mount -t fuse4x]
99            ui_warn "Unable to unload the existing Fuse4X kernel extension."
100            ui_warn "Please unmount the following filesystems, and then run "
101            ui_warn "`sudo kextunload -b $kextid`:"
102            foreach line [split $mounted "\n"] {
103                regexp {on (/.*) \(fuse4x} $line -> mountpoint
104                ui_warn "  * $mountpoint"
105            }
106        }
107    }
108}
109
110post-activate {
111    try_unload_kext
112}
113
114post-deactivate {
115    try_unload_kext
116}
117
118livecheck.type      regex
119livecheck.url       ${homepage}
120livecheck.regex     {Fuse4X-([0-9.]+).dmg}
Note: See TracBrowser for help on using the repository browser.