Permalink
Browse files

go back to building from tarball, remove apache-zookeeper submodule

  • Loading branch information...
1 parent 5dc2c49 commit 63dd8bc30738c923c921658fd3935b22ee8eb374 @slyphon slyphon committed May 11, 2012
Showing with 17 additions and 57 deletions.
  1. +1 −0 .dotfiles/rvmrc
  2. +0 −3 .gitmodules
  3. +9 −46 ext/Rakefile
  4. +0 −1 ext/apache-zookeeper
  5. +7 −7 ext/extconf.rb
View
@@ -1 +1,2 @@
rvm ruby-1.9.3@zookeeper --create
+export DEV=1
View
@@ -1,6 +1,3 @@
[submodule "releaseops"]
path = releaseops
url = git://github.com/slyphon/releaseops.git
-[submodule "ext/apache-zookeeper"]
- path = ext/apache-zookeeper
- url = git://github.com/slyphon/apache-zookeeper.git
View
@@ -1,53 +1,10 @@
require 'rbconfig'
-AZK_ROOT = 'apache-zookeeper'
-AZK_SRC = File.join(AZK_ROOT, 'src')
-AZK_C_SRC = File.join(AZK_SRC, 'c')
-
-AZK_C_SRC_FILES = FileList["#{AZK_C_SRC}/{include,src}/**/*.{h,c}"]
-
LIB_ZK_SO = 'lib/libzookeeper_mt_gem.la'
-GENERATED_DIR = File.join(AZK_C_SRC, 'generated')
-CONFIGURE_PATH = File.join(AZK_C_SRC, 'configure')
-
-file LIB_ZK_SO => CONFIGURE_PATH
-file LIB_ZK_SO => AZK_C_SRC_FILES
-
-file GENERATED_DIR do
- cd AZK_C_SRC do
- sh 'ant compile_jute'
- end
-end
-
-file CONFIGURE_PATH => GENERATED_DIR do
- cd AZK_C_SRC do
- sh 'autoreconf -if'
- end
-end
+TARBALL = FileList['zkc-*.tar.gz'].first
-namespace :azk do
- task :clean do
- cd AZK_C_SRC do
- if File.exists?('Makefile')
- sh 'make clean'
- end
- end
- end
-
- task :clobber => :clean do
- cd AZK_C_SRC do
- sh "git clean -Xd"
- end
- end
-
- task :build => LIB_ZK_SO do
- sh "ruby extconf.rb"
- end
-end
-
-task :clean => 'azk:clean'
-task :clobber => 'azk:clobber'
+raise "Where is the zkc tarball!?" unless TARBALL
namespace :zkrb do
task :clean do
@@ -77,6 +34,10 @@ GENERATE_GVL_CODE_RB = 'generate_gvl_code.rb'
# end
# end
+file 'c' => TARBALL do
+ sh "tar -zxf #{TARBALL}"
+end
+
file GENERATE_GVL_CODE_RB
file 'zkrb_wrapper.c' => GENERATE_GVL_CODE_RB do
@@ -91,7 +52,9 @@ ZKRB_WRAPPER = %w[zkrb_wrapper.c zkrb_wrapper.h]
task :wrappers => ZKRB_WRAPPER
-file 'Makefile' => 'azk:build'
+file 'Makefile' do
+ sh "ruby extconf.rb"
+end
task :build => [ZKRB_WRAPPER, 'Makefile'].flatten do
sh 'make'
Submodule apache-zookeeper deleted from 8f6754
View
@@ -1,10 +1,10 @@
-
require 'mkmf'
require 'rbconfig'
HERE = File.expand_path(File.dirname(__FILE__))
BUNDLE = Dir.glob("zkc-*.tar.gz").first
-BUNDLE_PATH = "apache-zookeeper/src/c"
+
+BUNDLE_PATH = File.join(HERE, 'c')
$EXTRA_CONF = ''
@@ -54,10 +54,10 @@ def safe_sh(cmd)
else
puts "Building zkc."
-# unless File.exists?('c')
-# puts(cmd = "tar xzf #{BUNDLE} 2>&1")
-# raise "'#{cmd}' failed" unless system(cmd)
-# end
+ unless File.exists?('c')
+ puts(cmd = "tar xzf #{BUNDLE} 2>&1")
+ raise "'#{cmd}' failed" unless system(cmd)
+ end
Dir.chdir(BUNDLE_PATH) do
configure = "./configure --prefix=#{HERE} --with-pic --without-cppunit --disable-dependency-tracking #{$EXTRA_CONF} 2>&1"
@@ -68,7 +68,7 @@ def safe_sh(cmd)
safe_sh("make install 2>&1")
end
-# system("rm -rf #{BUNDLE_PATH}") unless ENV['DEBUG'] or ENV['DEV']
+ system("rm -rf #{BUNDLE_PATH}") unless ENV['DEBUG'] or ENV['DEV']
end
end

0 comments on commit 63dd8bc

Please sign in to comment.