diff options
author | Katsuhiko Nishimra <ktns.87@gmail.com> | 2013-04-29 18:10:40 +0900 |
---|---|---|
committer | Katsuhiko Nishimra <ktns.87@gmail.com> | 2013-04-29 18:35:35 +0900 |
commit | 9ce84ddb914eb933d59d4dfb1a40a9429ca5519b (patch) | |
tree | 98c69d2a79ec1cc84ade0eb2f4a7f796138f92ea | |
parent | 9fc23ed4edf0eb8f3738fd703bffd677bc69b84a (diff) |
Use Kernel.system instead of `command`
-rw-r--r-- | ext/openbabel/extconf.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/openbabel/extconf.rb b/ext/openbabel/extconf.rb index e0dfbae..9e67b8f 100644 --- a/ext/openbabel/extconf.rb +++ b/ext/openbabel/extconf.rb @@ -15,27 +15,27 @@ begin Dir.chdir main_dir do FileUtils.rm_rf ob_main_dir puts "Downloading OpenBabel sources" - puts `curl -L -d use_mirror=netcologne "http://downloads.sourceforge.net/project/openbabel/openbabel/#{ob_num_ver}/openbabel-#{ob_num_ver}.tar.gz" | tar xz` + system "curl -L -d use_mirror=netcologne 'http://downloads.sourceforge.net/project/openbabel/openbabel/#{ob_num_ver}/openbabel-#{ob_num_ver}.tar.gz' | tar xz" end Dir.chdir ob_main_dir do puts "Configuring OpenBabel" - puts `cmake #{ob_main_dir} -DCMAKE_INSTALL_PREFIX=#{lib_dir}` + system "cmake #{ob_main_dir} -DCMAKE_INSTALL_PREFIX=#{lib_dir}" openbabel_libs = have_library('openbabel') unless openbabel_libs puts "OpenBabel not installed. Compiling sources." - puts `make` - puts `make install` + system "make" + system "make install" end end Dir.chdir ob_bindings_dir do puts "Compiling and instaling OpenBabel Ruby bindings." - `sed -i -e 's/Init_OpenBabel/Init_openbabel/g' *cpp` + system "sed -i -e 's/Init_OpenBabel/Init_openbabel/g' *cpp" # get include and lib from pkg-config ob_include=`pkg-config openbabel-2.0 --cflags-only-I`.sub(/\s+/,'').sub(/-I/,'') ob_lib=`pkg-config openbabel-2.0 --libs-only-L`.sub(/\s+/,'').sub(/-L/,'') - `ruby extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}` - `sed -i -e 's/-flat_namespace//' Makefile` - puts `make` + system "ruby extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}" + system "sed -i -e 's/-flat_namespace//' Makefile" + system "make" end FileUtils.cp(ob_bindings_dir+"/openbabel.#{RbConfig::CONFIG["DLEXT"]}", "./") File.open('Makefile', 'w') do |makefile| |