Download the BDB source code on demand.

This commit is contained in:
Phillip Toland 2009-08-10 12:44:09 -05:00
parent e20a91e082
commit f14f426828
2 changed files with 14 additions and 1 deletions

1
.gitignore vendored
View file

@ -8,3 +8,4 @@ test/test.cover
int_test/test.cover
bdberl-*
priv/mibs
c_src/db-*.tar.gz

View file

@ -22,19 +22,31 @@
require 'erlbox'
require 'erlbox/driver'
require 'erlbox/snmp'
require 'net/http'
CLOBBER.include %w( c_src/system )
UNIT_TEST_FLAGS << '+A10'
INT_TEST_FLAGS << '+A10'
DB_TARBALL = 'c_src/db-4.7.25.tar.gz'
DB_LIB = "c_src/system/lib/libdb.a"
CC_FLAGS << "-Ic_src/system/include -pthread"
LD_LIBS << DB_LIB
LD_FLAGS << "-pthread"
file DB_LIB do
file DB_TARBALL do
puts "Downloading BerkeleyDB..."
# Not the fastest or most efficient method, but it works everywhere...
# This does not rely on curl or wget being installed.
Net::HTTP.start('download.oracle.com') do |http|
resp = http.get('/berkeley-db/db-4.7.25.tar.gz')
open(DB_TARBALL, "wb") {|file| file.write(resp.body) }
end
end
file DB_LIB => DB_TARBALL do
sh "cd c_src && ./buildlib.sh 2>&1"
end