2010-06-18 03:49:12 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Encfs < Formula
|
2010-06-18 03:49:12 +00:00
|
|
|
homepage 'http://www.arg0.net/encfs'
|
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-06-18 03:49:12 +00:00
|
|
|
depends_on 'gettext'
|
|
|
|
depends_on 'boost'
|
|
|
|
depends_on 'rlog'
|
2013-11-12 05:22:57 +00:00
|
|
|
depends_on 'osxfuse'
|
|
|
|
|
2014-05-01 10:27:18 +00:00
|
|
|
stable do
|
|
|
|
url 'https://encfs.googlecode.com/files/encfs-1.7.4.tgz'
|
|
|
|
sha1 '3d824ba188dbaabdc9e36621afb72c651e6e2945'
|
|
|
|
|
|
|
|
# Following patch and changes in install section,
|
|
|
|
# required for better compatibility with OSX, especially OSX 10.9.
|
|
|
|
# Changes are already in usptream and planned to be included in next stable release 1.75.
|
|
|
|
# For more details refer to:
|
|
|
|
# https://code.google.com/p/encfs/issues/detail?id=185#c10
|
|
|
|
# Fixes link times and xattr on links for OSX
|
|
|
|
patch :DATA
|
|
|
|
end
|
|
|
|
|
|
|
|
head do
|
|
|
|
url 'https://encfs.googlecode.com/svn/branches/1.x'
|
|
|
|
|
|
|
|
depends_on 'autoconf' => :build
|
|
|
|
depends_on 'automake' => :build
|
|
|
|
depends_on 'libtool' => :build
|
|
|
|
end
|
2010-06-18 03:49:12 +00:00
|
|
|
|
|
|
|
def install
|
2013-11-12 05:22:57 +00:00
|
|
|
# Add correct flags for linkage with {osx,}fuse and gettext libs
|
2014-02-25 05:25:59 +00:00
|
|
|
gettext = Formula['gettext']
|
|
|
|
ENV.append 'CPPFLAGS', %x[pkg-config fuse --cflags].chomp + "-I#{gettext.include}"
|
|
|
|
ENV.append 'LDFLAGS', %x[pkg-config fuse --libs].chomp + "-L#{gettext.lib}"
|
2014-05-01 10:27:18 +00:00
|
|
|
if build.stable?
|
|
|
|
inreplace "configure", "-lfuse", "-losxfuse"
|
|
|
|
end
|
2013-11-12 05:22:57 +00:00
|
|
|
|
|
|
|
# Adapt to changes in recent Xcode by making local copy of endian-ness definitions
|
2014-05-12 15:02:19 +00:00
|
|
|
mkdir "encfs/sys"
|
|
|
|
cp "#{MacOS.sdk_path}/usr/include/sys/_endian.h", "encfs/sys/endian.h"
|
2013-11-12 05:22:57 +00:00
|
|
|
|
2014-05-01 10:27:18 +00:00
|
|
|
if build.stable?
|
|
|
|
# Fix runtime "dyld: Symbol not found" errors
|
|
|
|
# Following 3 ugly inreplaces come instead of big patch
|
|
|
|
inreplace ["encfs/Cipher.cpp", "encfs/CipherFileIO.cpp", "encfs/NullCipher.cpp",
|
|
|
|
"encfs/NullNameIO.cpp", "encfs/SSL_Cipher.cpp"], "using boost::shared_ptr;", ""
|
2013-11-12 05:22:57 +00:00
|
|
|
|
2014-05-01 10:27:18 +00:00
|
|
|
inreplace ["encfs/BlockNameIO.cpp", "encfs/Cipher.cpp", "encfs/CipherFileIO.cpp",
|
|
|
|
"encfs/Context.cpp", "encfs/DirNode.cpp", "encfs/encfs.cpp",
|
|
|
|
"encfs/encfsctl.cpp", "encfs/FileNode.cpp", "encfs/FileUtils.cpp",
|
|
|
|
"encfs/MACFileIO.cpp", "encfs/main.cpp", "encfs/makeKey.cpp",
|
|
|
|
"encfs/NameIO.cpp", "encfs/NullCipher.cpp", "encfs/NullNameIO.cpp",
|
|
|
|
"encfs/SSL_Cipher.cpp", "encfs/StreamNameIO.cpp", "encfs/test.cpp"], "shared_ptr<", "boost::shared_ptr<"
|
2013-11-12 05:22:57 +00:00
|
|
|
|
2014-05-01 10:27:18 +00:00
|
|
|
inreplace ["encfs/Context.cpp", "encfs/encfsctl.cpp", "encfs/FileUtils.cpp"], "boost::boost::shared_ptr<", "boost::shared_ptr<"
|
|
|
|
else
|
|
|
|
system "make", "-f", "Makefile.dist"
|
|
|
|
end
|
2011-09-01 20:59:27 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
2011-03-21 23:51:31 +00:00
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--with-boost=#{HOMEBREW_PREFIX}"
|
2010-06-18 03:49:12 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2011-03-10 05:11:03 +00:00
|
|
|
end
|
2013-11-12 05:22:57 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
|
|
|
|
--- a/encfs/encfs.cpp
|
|
|
|
+++ b/encfs/encfs.cpp
|
|
|
|
@@ -489,7 +489,11 @@
|
|
|
|
|
|
|
|
int _do_chmod(EncFS_Context *, const string &cipherPath, mode_t mode)
|
|
|
|
{
|
|
|
|
+#ifdef __APPLE__
|
|
|
|
+ return lchmod( cipherPath.c_str(), mode );
|
|
|
|
+#else
|
|
|
|
return chmod( cipherPath.c_str(), mode );
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int encfs_chmod(const char *path, mode_t mode)
|
|
|
|
@@ -706,7 +710,11 @@
|
|
|
|
int _do_setxattr(EncFS_Context *, const string &cyName,
|
|
|
|
tuple<const char *, const char *, size_t, uint32_t> data)
|
|
|
|
{
|
|
|
|
+#ifdef __APPLE__
|
|
|
|
+ int options = XATTR_NOFOLLOW;
|
|
|
|
+#else
|
|
|
|
int options = 0;
|
|
|
|
+#endif
|
|
|
|
return ::setxattr( cyName.c_str(), data.get<0>(), data.get<1>(),
|
|
|
|
data.get<2>(), data.get<3>(), options );
|
|
|
|
}
|