diff options
| author | Dominyk Tiller | 2014-10-05 20:17:28 +0100 |
|---|---|---|
| committer | Tim D. Smith | 2014-10-05 18:44:32 -0700 |
| commit | b7df51afae5e5987f28c7f2498771f8beb42db5d (patch) | |
| tree | c7af6fa191e4c1b955dc143efe6010d51976aad3 /Library/Formula | |
| parent | 5a1cc02b7e3873249de4cd3927a7f3f531d6e1ff (diff) | |
| download | homebrew-b7df51afae5e5987f28c7f2498771f8beb42db5d.tar.bz2 | |
Zookeeper: Yosemite fixes
Closes #32900.
Signed-off-by: Tim D. Smith <git@tim-smith.us>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/zookeeper.rb | 77 |
1 files changed, 55 insertions, 22 deletions
diff --git a/Library/Formula/zookeeper.rb b/Library/Formula/zookeeper.rb index 84ee67074..456c20828 100644 --- a/Library/Formula/zookeeper.rb +++ b/Library/Formula/zookeeper.rb @@ -1,11 +1,32 @@ -require 'formula' +require "formula" class Zookeeper < Formula - homepage 'http://zookeeper.apache.org/' - url 'http://www.apache.org/dyn/closer.cgi?path=zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz' - sha1 '2a9e53f5990dfe0965834a525fbcad226bf93474' + homepage "https://zookeeper.apache.org/" revision 1 + stable do + url "http://www.apache.org/dyn/closer.cgi?path=zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz" + sha1 "2a9e53f5990dfe0965834a525fbcad226bf93474" + + # To resolve Yosemite build errors. + # https://issues.apache.org/jira/browse/ZOOKEEPER-2049 + if MacOS.version == :yosemite + patch :p0 do + url "https://issues.apache.org/jira/secure/attachment/12672517/ZOOKEEPER-2049.noprefix.branch-3.4.patch" + sha1 "001424dacb82209c12653b3fbcdc0847a41f4294" + end + end + + # Everything in this block can go back to being head-only after next stable release; + # They are needed in stable presently because the Yosemite patch modifies configure. + if MacOS.version == :yosemite + depends_on "cppunit" => :build + depends_on "libtool" => :build + depends_on "autoconf" => :build + depends_on "automake" => :build + end + end + bottle do sha1 "44d960c61b67308c2e6e510399505582afe2904d" => :mavericks sha1 "df1c9ff667738859b1362541bcd14bcdfcf6804c" => :mountain_lion @@ -13,13 +34,22 @@ class Zookeeper < Formula end head do - url 'http://svn.apache.org/repos/asf/zookeeper/trunk' + url "https://svn.apache.org/repos/asf/zookeeper/trunk" + + # To resolve Yosemite build errors. + # https://issues.apache.org/jira/browse/ZOOKEEPER-2049 + if MacOS.version == :yosemite + patch :p0 do + url "https://issues.apache.org/jira/secure/attachment/12672519/ZOOKEEPER-2049.noprefix.trunk.patch" + sha1 "009e7703431a3b81043b57a6ef19885fbc15221f" + end + end - depends_on "autoconf" => :build - depends_on "automake" => :build - depends_on "libtool" => :build depends_on "ant" => :build depends_on "cppunit" => :build + depends_on "libtool" => :build + depends_on "autoconf" => :build + depends_on "automake" => :build end option "perl", "Build Perl bindings" @@ -55,9 +85,9 @@ class Zookeeper < Formula def install # Don't try to build extensions for PPC if Hardware.is_32_bit? - ENV['ARCHFLAGS'] = "-arch #{Hardware::CPU.arch_32_bit}" + ENV["ARCHFLAGS"] = "-arch #{Hardware::CPU.arch_32_bit}" else - ENV['ARCHFLAGS'] = Hardware::CPU.universal_archs.as_arch_flags + ENV["ARCHFLAGS"] = Hardware::CPU.universal_archs.as_arch_flags end if build.head? @@ -66,10 +96,13 @@ class Zookeeper < Formula end cd "src/c" do + # Remove the autotools from this block after next stable release. + system "aclocal" if MacOS.version == :yosemite + system "autoreconf", "-fvi" if MacOS.version == :yosemite system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--without-cppunit" - system "make install" + system "make", "install" end cd "src/contrib/zkpython" do @@ -81,7 +114,7 @@ class Zookeeper < Formula system "perl", "Makefile.PL", "PREFIX=#{prefix}", "--zookeeper-include=#{include}", "--zookeeper-lib=#{lib}" - system "make install" + system "make", "install" end if build.include? "perl" rm_f Dir["bin/*.cmd"] @@ -94,27 +127,27 @@ class Zookeeper < Formula end bin.mkpath - (etc+'zookeeper').mkpath - (var+'log/zookeeper').mkpath - (var+'run/zookeeper/data').mkpath + (etc+"zookeeper").mkpath + (var+"log/zookeeper").mkpath + (var+"run/zookeeper/data").mkpath Pathname.glob("#{libexec}/bin/*.sh") do |path| - next if path == libexec+'bin/zkEnv.sh' + next if path == libexec+"bin/zkEnv.sh" script_name = path.basename - bin_name = path.basename '.sh' + bin_name = path.basename ".sh" (bin+bin_name).write shim_script(script_name) end - defaults = etc/'zookeeper/defaults' + defaults = etc/"zookeeper/defaults" defaults.write(default_zk_env) unless defaults.exist? - log4j_properties = etc/'zookeeper/log4j.properties' + log4j_properties = etc/"zookeeper/log4j.properties" log4j_properties.write(default_log4j_properties) unless log4j_properties.exist? - inreplace 'conf/zoo_sample.cfg', + inreplace "conf/zoo_sample.cfg", /^dataDir=.*/, "dataDir=#{var}/run/zookeeper/data" - cp 'conf/zoo_sample.cfg', 'conf/zoo.cfg' - (etc/'zookeeper').install ['conf/zoo.cfg', 'conf/zoo_sample.cfg'] + cp "conf/zoo_sample.cfg", "conf/zoo.cfg" + (etc/"zookeeper").install ["conf/zoo.cfg", "conf/zoo_sample.cfg"] end plist_options :manual => "zkServer start" |
