GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Motto-mysql is a complementary library to enhance and make faster 'mysql-ruby' library.
Clone URL: git://github.com/kwatch/motto-mysql.git
Update Rookbook.yaml to add ':package' recipe.
kwatch (author)
Sat Oct 04 21:44:31 -0700 2008
commit  6e6d9edeef800277e6c3585df3db679dd4b7be29
tree    ac48085dbe5a3990504c2013440a8db65859b43a
parent  044a7df7efd6f9d756fced356d2c5735dc280419
...
1
2
3
4
5
 
 
 
 
 
6
7
8
9
10
11
12
 
 
 
 
 
13
14
15
16
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
19
 
20
21
22
23
 
24
25
26
...
32
33
34
 
35
36
37
...
91
92
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
95
96
...
1
 
2
3
 
4
5
6
7
8
9
10
11
12
13
14
 
15
16
17
18
19
20
21
22
23
 
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
39
40
41
42
 
43
44
45
46
...
52
53
54
55
56
57
58
...
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
0
@@ -1,26 +1,46 @@
0
 
0
-
0
 properties:
0
 
0
- - target: motto_mysql
0
+ - project : motto-mysql
0
+ - target : motto_mysql
0
+ - release : 0.1.0
0
+ - copyright : copyright(c) 2006-2008 kuwata-lab all rights reserved.
0
+ - license : "License: Ruby's license"
0
   #- mysql_ruby_version: '2.7.4'
0
   #- mysql_ruby_version: '2.7.5'
0
   #- mysql_ruby_version: '2.7.6'
0
   #- mysql_ruby_version: '2.8pre4'
0
   - mysql_ruby_version: '2.8'
0
   - mysql_srcdir:  external/mysql-ruby-$(mysql_ruby_version)
0
- - mysql_c: $(mysql_srcdir)/mysql.c
0
+ - mysql_c : $(mysql_srcdir)/mysql.c
0
+
0
+parameters:
0
+
0
+ #- rook_product: :all
0
 
0
 recipes:
0
 
0
   - product:  :all
0
- ingreds: [ Makefile, $(target).h ]
0
+ ingreds: [:build, :install, :test, :clean, :package]
0
+
0
+ - product: :build
0
+ desc: create Makefile and compile
0
+ ingreds: [ ext/Makefile, ext/$(target).h ]
0
+ method*: |
0
+ chdir "ext" do sys "make" end
0
+
0
+ - product: :install
0
+ ingreds: [ :build ]
0
+ method*: |
0
+ chdir "ext" do sys "sudo make install" end
0
+
0
+ - product: :test
0
     method*: |
0
- sys "make"
0
+ sys "testrb test"
0
 
0
   - product:  :clean
0
     method*: |
0
- rm_rf 'Makefile', '$(target).h', '$(target).o', '$(target).bundle', 'debug', 'mkmf.log'
0
+ rm_rf 'ext/Makefile', 'ext/$(target).o', 'ext/$(target).bundle', 'ext/mkmf.log'
0
 
0
   - product:  ext/Makefile
0
     ingreds:  [ ext/extconf.rb ]
0
@@ -32,6 +52,7 @@ recipes:
0
   end
0
 
0
   - product:  :header
0
+ desc: create 'ext/*.h' file
0
     ingreds:  [ ext/$(target).h ]
0
 
0
   - product:  ext/$(target).h
0
@@ -91,6 +112,39 @@ recipes:
0
    content << "dd { margin-top: 5px; margin-bottom: 10px; }\n"
0
   end
0
 
0
+ - product: :package
0
+ desc: create *.tar.gz and *.gem under 'build' directory
0
+ ingreds: [ :clean ]
0
+ method*: |
0
+ ## remove and create build directory
0
+ base = "$(project)-$(release)"
0
+ dir = "build/#{base}"
0
+ rm_rf dir
0
+ mkdir_p dir
0
+ ## copy files
0
+ store %w[README.rdoc $(project).gemspec setup.rb], dir
0
+ store 'ext/**/*', 'test/**/*', dir
0
+ ## edit files
0
+ edit "#{dir}/**/*" do |content|
0
+ content.gsub!(/\$Release\$/, "$(release)")
0
+ content.gsub!(/\$Release:.*?\$/, "$Release: $(release) $")
0
+ content.gsub!(/\$Copyright.*?\$/, "$(copyright)")
0
+ content.gsub!(/\$License.*?\$/, "$(license)")
0
+ content
0
+ end
0
+ ## create packages
0
+ chdir "build" do
0
+ tar_czf "#{base}.tar.gz", base
0
+ end
0
+ chdir dir do
0
+ #sys "gem build $(project).gemspec"
0
+ Gem.manage_gems
0
+ require 'rubygems/gem_runner'
0
+ Gem::GemRunner.new.run ['build', '$(project).gemspec']
0
+ mv "#{base}.gem", ".."
0
+ end
0
+
0
+
0
   - product:  :debug
0
     method*: |
0
   items = %w[string var_string int24 long longlong float double

Comments

    No one has commented yet.