Skip to content

Commit

Permalink
OpenSUSE 11.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
amedeo committed Aug 7, 2010
1 parent cbad9a0 commit d9032e2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 9 deletions.
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -45,6 +45,13 @@ On **Ubuntu and Debian**:

On **OSX**, install XCode.

On **OpenSUSE**:

sudo zypper install flex lksctp-tools-devel zip \
rubygem-rake gcc-c++ make m4 zlib-devel \
libopenssl-devel libtool automake libcurl-devel


## Getting the Code

You will need the Git tool. Check out the code and pull in the third-party
Expand Down
23 changes: 18 additions & 5 deletions tasks/all.rake
Expand Up @@ -39,10 +39,11 @@ namespace :build do

Dir.mktmpdir 'couchdb-build' do |dir|
Dir.chdir dir do
env = { :ubuntu => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
:debian => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
:fedora => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
:osx => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
env = { :ubuntu => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
:debian => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
:fedora => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
:osx => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
:opensuse => "LDFLAGS='-R#{BUILD}/lib -L#{BUILD}/lib' CFLAGS='-I#{BUILD}/include/js'",
}.fetch DISTRO[0], ''
sh "env #{env} #{source}/configure --prefix=#{BUILD} --with-erlang=#{BUILD}/lib/erlang/usr/include"
sh "make"
Expand Down Expand Up @@ -71,7 +72,7 @@ namespace :build do
end

desc 'Confirm (and install if possible) the OS dependencies'
task :os_dependencies => [:mac_dependencies, :ubuntu_dependencies, :debian_dependencies]
task :os_dependencies => [:mac_dependencies, :ubuntu_dependencies, :debian_dependencies, :opensuse_dependencies]

task :debian_dependencies => :known_distro do
if DISTRO[0] == :debian
Expand Down Expand Up @@ -109,6 +110,18 @@ namespace :build do
end
end

task :opensuse_dependencies => :known_distro do
if DISTRO[0] == :opensuse
# For building OTP
install %w[ flex lksctp-tools-devel zip]

# All OpenSUSE gets these.
install %w[rubygem-rake gcc-c++ make m4 zlib-devel libopenssl-devel libtool automake libcurl-devel]

end
end


#desc 'Completely uninstall everything except source'
#task :distclean => :clean do
# sh "rm -rf #{RUBY_BUILD}"
Expand Down
10 changes: 9 additions & 1 deletion tasks/distro.rake
@@ -1,5 +1,5 @@

task :known_distro => [ :known_mac, :known_ubuntu, :known_debian, :known_redhat ] do
task :known_distro => [ :known_mac, :known_ubuntu, :known_debian, :known_redhat, :known_opensuse ] do
raise 'Unknown distribution, build not supported' unless Object.const_defined? 'DISTRO'
end

Expand Down Expand Up @@ -27,3 +27,11 @@ task :known_redhat do
DISTRO = [:fedora, release]
end
end

task :known_opensuse do
if File.exist? '/etc/SuSE-release'
release = File.new('/etc/SuSE-release').readline.match(/openSUSE (\d+)/)[1]
DISTRO = [:opensuse, release]
end
end

16 changes: 13 additions & 3 deletions tasks/lib.rb
Expand Up @@ -33,9 +33,19 @@ def set_port_cap file

# TODO: Get rid of this. Packages should be installed as a dependency of other software, declared by package_dep().
def install packages
installed = `dpkg --list`.split("\n").map { |x| x.split[1] } # Hm, this is out of scope if defined outside.
packages.select{ |pkg| ! installed.include? pkg }.each do |package|
sh "sudo apt-get -y install #{package}"
puts "Required: #{packages.inspect}"
case DISTRO[0]
when :opensuse
installed = %x[rpm -qa].split("\n")
packages.select{|pkg| ! installed.detect{|d| d =~ /^#{Regexp.escape(pkg)}/ } }.each do |package|
# puts "Installing #{package} ..."
%x[sudo zypper install '#{package}']
end
else
installed = `dpkg --list`.split("\n").map { |x| x.split[1] } # Hm, this is out of scope if defined outside.
packages.select{ |pkg| ! installed.include? pkg }.each do |package|
sh "sudo apt-get -y install #{package}"
end
end
end

Expand Down

0 comments on commit d9032e2

Please sign in to comment.