@@ -26,8 +26,11 @@ Rake::ExtensionTask.new("mysql2", gemspec) do |ext|
2626
2727 ext . cross_compiling do |spec |
2828 Rake ::Task [ 'lib/mysql2/mysql2.rb' ] . invoke
29+ # vendor/libmysql.dll is invoked from extconf.rb
30+ Rake ::Task [ 'vendor/README' ] . invoke
2931 spec . files << 'lib/mysql2/mysql2.rb'
3032 spec . files << 'vendor/libmysql.dll'
33+ spec . files << 'vendor/README'
3134 spec . post_install_message = <<-POST_INSTALL_MESSAGE
3235
3336======================================================================================================
@@ -36,12 +39,10 @@ Rake::ExtensionTask.new("mysql2", gemspec) do |ext|
3639 It was built using MySQL Connector/C version #{ CONNECTOR_VERSION } .
3740 It's recommended to use the exact same version to avoid potential issues.
3841
39- At the time of building this gem, the necessary DLL files were available
40- in the following download:
41-
42+ At the time of building this gem, the necessary DLL files were retrieved from:
4243 #{ vendor_mysql_url ( spec . platform ) }
4344
44- And put lib \\ libmysql.dll file in your Ruby bin directory, for example C: \\ Ruby \\ bin
45+ This gem *includes* vendor/ libmysql.dll with redistribution notice in vendor/README.
4546
4647======================================================================================================
4748
@@ -51,6 +52,13 @@ Rake::ExtensionTask.new("mysql2", gemspec) do |ext|
5152end
5253Rake ::Task [ :spec ] . prerequisites << :compile
5354
55+ file 'vendor/README' do |t |
56+ connector_dir = File . expand_path ( "../../vendor/#{ vendor_mysql_dir } " , __FILE__ )
57+ when_writing 'copying Connector/C README' do
58+ cp "#{ connector_dir } /README" , 'vendor/README'
59+ end
60+ end
61+
5462file 'lib/mysql2/mysql2.rb' do |t |
5563 name = gemspec . name
5664 File . open ( t . name , 'wb' ) do |f |
0 commit comments