source: trunk/dports/fuse/macfuse/Portfile @ 90466

Last change on this file since 90466 was 89810, checked in by and.damore@…, 8 years ago

ports: replacing rpm-vercomp with vercmp in portfiles

  • 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 89810 2012-02-11 08:55:39Z and.damore@macports.org $
3
4PortSystem 1.0
5
6name                macfuse
7version             2.0.3
8revision            5
9categories          fuse devel
10# FUSE library is LGPL-2; kernel module and Obj-C SDK are BSD-licensed
11license             {BSD LGPL-2}
12platforms           macosx
13maintainers         dports
14description         A FUSE-Compliant File System Implementation Mechanism for \
15                    Mac OS X
16
17long_description    MacFUSE implements a mechanism that makes it possible to  \
18                    implement a fully functional file system in a user-space  \
19                    program on Mac OS X. It aims to be API-compliant with     \
20                    the FUSE (File-system in USErspace) mechanism that        \
21                    originated on Linux.  Therefore, many existing FUSE file  \
22                    systems become readily usable on Mac OS X. The core of    \
23                    MacFUSE is in a dynamically loadable kernel extension.
24
25homepage            http://code.google.com/p/macfuse/
26master_sites        macports
27use_bzip2           yes
28worksrcdir          core
29checksums           md5     97ab76bbade128828596aca878c6c475 \
30                    sha1    60ea1536091740e2faeb9ebf72d8696ccd11ce2f \
31                    rmd160  e9a79de37d84ee5e21f63f02b924d04a5df94636
32
33depends_build       port:pkgconfig port:autoconf port:automake port:libtool
34depends_lib         port:libiconv
35
36patchfiles          patch-10.5-to-10.6.diff \
37                    patch-10.5-to-10.7.diff \
38                    patch-macfuse_buildtool.sh.diff \
39                    patch-sdk-objc_GMUserFileSystem.m.diff \
40                    patch-sdk-objc_MacFUSE.xcodeproj-default-gcc.diff \
41                    patch-sdk-objc_MacFuse.xcodeproj.diff \
42                    patch-10.5_fusefs_fusefs.xcodeproj_project.pbxproj.diff \
43                    patch-10.5_universal_build.diff \
44                    patch-10.5_libfuse_fuse-2.7.3-macosx.patch.diff \
45                    patch-10.6_libfuse_fuse-2.7.3-macosx.patch.diff \
46                    patch-10.7_libfuse_fuse-2.7.3-macosx.patch.diff \
47                    patch-10.7-cr_posix.diff \
48                    patch-10.7_fusefs_mount_mount_fusefs.c.diff
49
50livecheck.type      googlecode
51livecheck.distname  MacFUSE-(.*)%2C.*.dmg
52
53use_configure       no
54
55variant universal {
56    # provide a dummy variant since the script will actually build universal
57    # and we don't want to error out if someone says +universal
58}
59
60# error out if running a 64-bit kernel; MacFUSE is 32-bit only
61pre-archivefetch {
62    set kernel_arch [exec /usr/bin/uname -m]
63    if {${kernel_arch} == "x86_64" || ${kernel_arch} == "ppc64"} {
64        return -code error "MacFUSE does not support 64-bit kernels; consider installing Fuse4X instead"
65    }
66}
67
68# ensure that user is running OS X 10.5 or higher: MacFUSE requires XCode 3
69pre-fetch {
70    if {${os.platform} != "darwin" || [vercmp ${os.version} 9.0.0] < 0} {
71        return -code error "MacFUSE requires at least Mac OS X 10.5 to build"
72    }
73}
74
75# copy 10.5 source directory to 10.6 to prepare for the 10.5-to-10.6 patch
76# (this patch really should be applied upstream)
77#
78# use cp -R instead of cp -r or copy to preserve symlinks
79pre-patch {
80    system "cp -R ${worksrcpath}/10.5 ${worksrcpath}/10.6"
81    system "cp -R ${worksrcpath}/10.5 ${worksrcpath}/10.7"
82}
83
84post-patch {
85    reinplace s,/usr/local,${prefix},g ${worksrcpath}/macfuse_buildtool.sh
86    reinplace s,/usr/local,${prefix},g ${worksrcpath}/sdk-objc/MacFUSE.xcodeproj/project.pbxproj
87    reinplace s,@@PREFIX@@,${prefix},g ${worksrcpath}/10.5/libfuse/fuse-2.7.3-macosx.patch
88    reinplace s,@@PREFIX@@,${prefix},g ${worksrcpath}/10.6/libfuse/fuse-2.7.3-macosx.patch
89    reinplace s,@@PREFIX@@,${prefix},g ${worksrcpath}/10.7/libfuse/fuse-2.7.3-macosx.patch
90    reinplace s,@@WORKPATH@@,${workpath},g ${worksrcpath}/macfuse_buildtool.sh
91    reinplace s,@@DESTPATH@@,${destpath},g ${worksrcpath}/macfuse_buildtool.sh
92}
93
94build.asroot    yes
95# macfuse_buildtool has been patched to install directly into ${destpath},
96# so destroot phase is unnecessary
97build {
98    system "cd ${worksrcpath} && ./macfuse_buildtool.sh -t smalldist"
99   
100    # Set file permissions on kernel module and binaries (see #25609)
101    system "chown -R root:wheel ${destpath}/Library/Filesystems/fusefs.fs"
102    file attributes ${destpath}/Library/Filesystems/fusefs.fs/Support/load_fusefs -permissions 04755
103}
104
105destroot.violate_mtree yes
106
107destroot {
108}
109
110post-activate {
111    if {[string length [exec kextstat -lb com.google.filesystems.fusefs]] > 0} {
112        ui_msg "********************************************************"
113        ui_msg "*  fusefs is already loaded. You may need to restart.  *"
114        ui_msg "*  Alternatively, if feeling adventurous, you can run  *"
115        ui_msg "*  `sudo kextunload -b com.google.filesystems.fusefs`  *"
116        ui_msg "********************************************************"
117    }
118}
Note: See TracBrowser for help on using the repository browser.