Download the BDB source code on demand.
This commit is contained in:
parent
e20a91e082
commit
f14f426828
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,3 +8,4 @@ test/test.cover
|
||||||
int_test/test.cover
|
int_test/test.cover
|
||||||
bdberl-*
|
bdberl-*
|
||||||
priv/mibs
|
priv/mibs
|
||||||
|
c_src/db-*.tar.gz
|
||||||
|
|
14
Rakefile
14
Rakefile
|
@ -22,19 +22,31 @@
|
||||||
require 'erlbox'
|
require 'erlbox'
|
||||||
require 'erlbox/driver'
|
require 'erlbox/driver'
|
||||||
require 'erlbox/snmp'
|
require 'erlbox/snmp'
|
||||||
|
require 'net/http'
|
||||||
|
|
||||||
CLOBBER.include %w( c_src/system )
|
CLOBBER.include %w( c_src/system )
|
||||||
|
|
||||||
UNIT_TEST_FLAGS << '+A10'
|
UNIT_TEST_FLAGS << '+A10'
|
||||||
INT_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"
|
DB_LIB = "c_src/system/lib/libdb.a"
|
||||||
|
|
||||||
CC_FLAGS << "-Ic_src/system/include -pthread"
|
CC_FLAGS << "-Ic_src/system/include -pthread"
|
||||||
LD_LIBS << DB_LIB
|
LD_LIBS << DB_LIB
|
||||||
LD_FLAGS << "-pthread"
|
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"
|
sh "cd c_src && ./buildlib.sh 2>&1"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue