2012-07-01 12:05:26 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Csync < Formula
|
|
|
|
homepage 'http://www.csync.org/'
|
2013-08-17 18:50:00 +00:00
|
|
|
head 'git://git.csync.org/projects/csync.git'
|
2012-09-03 13:33:35 +00:00
|
|
|
url 'http://www.csync.org/files/csync-0.49.9.tar.gz'
|
|
|
|
sha1 'fd7df6c13aa6fc6de74cb48c2ac35ad11f6d895d'
|
2012-07-01 12:05:26 +00:00
|
|
|
|
|
|
|
depends_on 'check' => :build
|
2013-08-17 18:50:00 +00:00
|
|
|
depends_on 'cmake' => :build
|
2013-08-17 18:53:12 +00:00
|
|
|
depends_on 'doxygen' => [:build, :optional]
|
2012-07-01 12:05:26 +00:00
|
|
|
depends_on 'argp-standalone'
|
2013-08-17 18:50:00 +00:00
|
|
|
depends_on 'iniparser'
|
|
|
|
depends_on 'sqlite'
|
2012-07-01 12:05:26 +00:00
|
|
|
depends_on 'libssh' => :optional
|
2012-09-03 18:58:34 +00:00
|
|
|
|
|
|
|
if build.head?
|
2013-08-17 18:50:00 +00:00
|
|
|
# Log4c and libsmbclient are optional in HEAD.
|
2012-07-01 12:05:26 +00:00
|
|
|
depends_on 'log4c' => :optional
|
|
|
|
depends_on 'samba' => :optional
|
|
|
|
else
|
|
|
|
depends_on 'log4c'
|
|
|
|
depends_on 'samba'
|
|
|
|
end
|
|
|
|
|
|
|
|
def patches
|
2012-09-03 13:33:35 +00:00
|
|
|
DATA
|
2012-07-01 12:05:26 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2012-09-03 13:33:35 +00:00
|
|
|
mkdir 'build' unless build.head?
|
2012-07-01 12:05:26 +00:00
|
|
|
cd 'build' do
|
|
|
|
system "cmake", "..", *std_cmake_args
|
|
|
|
# We need to run make csync first to make the "core",
|
|
|
|
# or the build system will freak out and try to link
|
|
|
|
# modules against core functions that aren't compiled
|
|
|
|
# yet. We also have to patch "link.txt" for all module
|
|
|
|
# targets. This should probably be reported upstream.
|
|
|
|
system "make csync"
|
2013-08-17 18:50:00 +00:00
|
|
|
inreplace Dir['modules/CMakeFiles/*/link.txt'] do |s|
|
|
|
|
s.gsub! '-o', "../src/libcsync.dylib ../src/std/libcstdlib.a -o"
|
2012-07-01 12:05:26 +00:00
|
|
|
end
|
|
|
|
# Now we can make and install.
|
|
|
|
system "make all"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def test
|
|
|
|
system "csync", "-V"
|
|
|
|
end
|
|
|
|
end
|
2012-09-03 13:33:35 +00:00
|
|
|
|
2012-07-01 12:05:26 +00:00
|
|
|
__END__
|
|
|
|
--- a/src/csync_propagate.c 2012-07-01 13:12:12.000000000 +0200
|
|
|
|
+++ b/src/csync_propagate.c 2012-07-01 13:12:59.000000000 +0200
|
|
|
|
@@ -101,10 +101,6 @@
|
|
|
|
/* Open the source file */
|
|
|
|
ctx->replica = srep;
|
|
|
|
flags = O_RDONLY|O_NOFOLLOW;
|
|
|
|
- /* O_NOATIME can only be set by the owner of the file or the superuser */
|
|
|
|
- if (st->uid == ctx->pwd.uid || ctx->pwd.euid == 0) {
|
|
|
|
- flags |= O_NOATIME;
|
|
|
|
- }
|
|
|
|
sfp = csync_vio_open(ctx, suri, flags, 0);
|
|
|
|
if (sfp == NULL) {
|
|
|
|
if (errno == ENOMEM) {
|