Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 83 lines (75 sloc) 2.318 kb
c3431a1 @copiousfreetime core library in extension working
authored
1 require 'tasks/config'
2 require 'pathname'
f16060b @copiousfreetime update to upstream SQLite v3.6.3
authored
3 require 'zlib'
4 require 'archive/tar/minitar'
c3431a1 @copiousfreetime core library in extension working
authored
5
6 #-----------------------------------------------------------------------
7 # Extensions
8 #-----------------------------------------------------------------------
9
10 if ext_config = Configuration.for_if_exist?('extension') then
827e38e @copiousfreetime progress made on database and statement
authored
11 namespace :ext do
32791aa @copiousfreetime initial import
authored
12 desc "Build the extension(s)"
13 task :build do
c3431a1 @copiousfreetime core library in extension working
authored
14 ext_config.configs.each do |extension|
15 path = Pathname.new(extension)
16 parts = path.split
17 conf = parts.last
18 Dir.chdir(path.dirname) do |d|
19 ruby conf.to_s
5376cfc @copiousfreetime Convert to using mkmf instead of mkrf
authored
20 #sh "rake default"
21 sh "make"
32791aa @copiousfreetime initial import
authored
22 end
c3431a1 @copiousfreetime core library in extension working
authored
23 end
24 end
32791aa @copiousfreetime initial import
authored
25
c3431a1 @copiousfreetime core library in extension working
authored
26 task :clean do
27 ext_config.configs.each do |extension|
28 path = Pathname.new(extension)
29 parts = path.split
30 conf = parts.last
31 Dir.chdir(path.dirname) do |d|
5376cfc @copiousfreetime Convert to using mkmf instead of mkrf
authored
32 #sh "rake clean"
33 sh "make clean"
c3431a1 @copiousfreetime core library in extension working
authored
34 end
35 end
36 end
37
38 task :clobber do
39 ext_config.configs.each do |extension|
40 path = Pathname.new(extension)
41 parts = path.split
42 conf = parts.last
43 Dir.chdir(path.dirname) do |d|
5376cfc @copiousfreetime Convert to using mkmf instead of mkrf
authored
44 #sh "rake clobber"
45 sh "make distclean"
c3431a1 @copiousfreetime core library in extension working
authored
46 end
47 end
48 end
f16060b @copiousfreetime update to upstream SQLite v3.6.3
authored
49
50 desc "Download and integrate the next version of sqlite"
51 task :update_sqlite do
52 next_version = ENV['VERSION']
53 puts "downloading ..."
54 url = URI.parse("http://sqlite.org/sqlite-amalgamation-#{next_version}.tar.gz")
55 file = "tmp/#{File.basename( url.path ) }"
56 File.open( file, "wb+") do |f|
57 res = Net::HTTP.get_response( url )
58 f.write( res.body )
59 end
60
61 puts "extracting..."
62 upstream_files = %w[ sqlite3.h sqlite3.c sqlite3ext.h ]
63 Zlib::GzipReader.open( file ) do |tgz|
64 Archive::Tar::Minitar::Reader.open( tgz ) do |tar|
65 tar.each_entry do |entry|
66 bname = File.basename( entry.full_name )
67 if upstream_files.include?( bname ) then
68 dest_file = File.join( "ext", bname )
69 puts "updating #{ dest_file }"
70 File.open( dest_file, "wb" ) do |df|
71 while bytes = entry.read do
72 df.write bytes
73 end
74 end
75 end
76 end
77 end
78 end
79
80 end
c3431a1 @copiousfreetime core library in extension working
authored
81 end
82 end
Something went wrong with that request. Please try again.