2012-03-30 23:51:59 +00:00
|
|
|
class Fakeroot < Formula
|
2014-10-24 01:41:21 +00:00
|
|
|
homepage "https://tracker.debian.org/pkg/fakeroot"
|
2014-12-09 20:49:38 +00:00
|
|
|
url "https://mirrors.kernel.org/debian/pool/main/f/fakeroot/fakeroot_1.20.2.orig.tar.bz2"
|
|
|
|
mirror "http://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.20.2.orig.tar.bz2"
|
|
|
|
sha1 "367040df07043edb630942b21939e493f3fad888"
|
2014-10-24 01:41:21 +00:00
|
|
|
|
2014-12-19 22:02:31 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-01-27 15:00:53 +00:00
|
|
|
revision 1
|
|
|
|
sha1 "33ae18f3adadf47b0266d5e8ef7d2ec6d87f49a4" => :yosemite
|
|
|
|
sha1 "96ab6f2489b44639d575f61604401eba046ff08c" => :mavericks
|
|
|
|
sha1 "3f4c8d4554f6311d38dcdccc7844e1a62e4de13b" => :mountain_lion
|
2014-12-19 22:02:31 +00:00
|
|
|
end
|
|
|
|
|
2014-12-09 20:49:38 +00:00
|
|
|
# Compile is broken. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766649
|
|
|
|
# Patches submitted upstream on 24/10/2014, but no reply from maintainer thus far.
|
|
|
|
patch do
|
|
|
|
url "https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=0001-Implement-openat-2-wrapper-which-handles-optional-ar.patch;att=1;bug=766649"
|
|
|
|
sha1 "9207619d6d8a55f25d50ba911bfa72f486911d81"
|
2014-10-24 01:41:21 +00:00
|
|
|
end
|
|
|
|
|
2014-12-09 20:49:38 +00:00
|
|
|
patch do
|
|
|
|
url "https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=0002-OS-X-10.10-introduced-id_t-int-in-gs-etpriority.patch;att=2;bug=766649"
|
|
|
|
sha1 "a30907ffdcfe159c2ac6b3f829bd5b9a67188940"
|
|
|
|
end
|
2012-09-27 18:55:41 +00:00
|
|
|
|
2015-01-26 19:28:05 +00:00
|
|
|
# This patch handles mapping the variadic arguments to the system openat to
|
|
|
|
# the fixed arguments for our next_openat function.
|
|
|
|
# Patch has been submitted to
|
|
|
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766649
|
|
|
|
patch :DATA
|
|
|
|
|
2012-03-30 23:51:59 +00:00
|
|
|
def install
|
2014-01-27 00:37:36 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
2012-03-30 23:51:59 +00:00
|
|
|
"--disable-static",
|
2014-12-09 20:49:38 +00:00
|
|
|
"--disable-silent-rules",
|
2012-03-30 23:51:59 +00:00
|
|
|
"--prefix=#{prefix}"
|
2015-01-26 19:28:05 +00:00
|
|
|
|
|
|
|
# Yosemite introduces an openat function, which has variadic arguments,
|
|
|
|
# which the "fancy" wrapping scheme used by fakeroot does not handle. So we
|
|
|
|
# have to patch the generated file after it is generated.
|
|
|
|
# Patch has been submitted with detailed explanation to
|
|
|
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766649
|
|
|
|
system "make", "wraptmpf.h"
|
|
|
|
(buildpath/"patch-for-wraptmpf-h").write <<-EOS.undent
|
|
|
|
diff --git a/wraptmpf.h b/wraptmpf.h
|
|
|
|
index dbfccc9..0e04771 100644
|
|
|
|
--- a/wraptmpf.h
|
|
|
|
+++ b/wraptmpf.h
|
|
|
|
@@ -575,6 +575,10 @@ static __inline__ int next_mkdirat (int dir_fd, const char *pathname, mode_t mod
|
|
|
|
#endif /* HAVE_MKDIRAT */
|
|
|
|
#ifdef HAVE_OPENAT
|
|
|
|
extern int openat (int dir_fd, const char *pathname, int flags, ...);
|
|
|
|
+static __inline__ int next_openat (int dir_fd, const char *pathname, int flags, mode_t mode) __attribute__((always_inline));
|
|
|
|
+static __inline__ int next_openat (int dir_fd, const char *pathname, int flags, mode_t mode) {
|
|
|
|
+ return openat (dir_fd, pathname, flags, mode);
|
|
|
|
+}
|
|
|
|
|
|
|
|
#endif /* HAVE_OPENAT */
|
|
|
|
#ifdef HAVE_RENAMEAT
|
|
|
|
EOS
|
|
|
|
|
|
|
|
system "patch < patch-for-wraptmpf-h"
|
|
|
|
|
2014-12-09 20:49:38 +00:00
|
|
|
system "make"
|
2014-10-24 01:41:21 +00:00
|
|
|
system "make", "install"
|
2012-03-30 23:51:59 +00:00
|
|
|
end
|
|
|
|
|
2013-03-25 18:34:48 +00:00
|
|
|
test do
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "root", shell_output("#{bin}/fakeroot whoami").strip
|
2012-03-30 23:51:59 +00:00
|
|
|
end
|
|
|
|
end
|
2015-01-26 19:28:05 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
index 15fdd1d..29d738d 100644
|
|
|
|
--- a/libfakeroot.c
|
|
|
|
+++ b/libfakeroot.c
|
|
|
|
@@ -2446,6 +2446,6 @@ int openat(int dir_fd, const char *pathname, int flags, ...)
|
|
|
|
va_end(args);
|
|
|
|
return next_openat(dir_fd, pathname, flags, mode);
|
|
|
|
}
|
|
|
|
- return next_openat(dir_fd, pathname, flags);
|
|
|
|
+ return next_openat(dir_fd, pathname, flags, NULL);
|
|
|
|
}
|
|
|
|
#endif
|