do_mysql 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake/gempackagetask'
3
3
 
4
4
  PLUGIN = "do_mysql"
5
5
  NAME = "do_mysql"
6
- VERSION = "0.2.1"
6
+ VERSION = "0.2.2"
7
7
  AUTHOR = "Yehuda Katz"
8
8
  EMAIL = "wycats@gmail.com"
9
9
  HOMEPAGE = "http://dataobjects.devjavu.com"
@@ -0,0 +1,149 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = .
7
+ topdir = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
8
+ hdrdir = $(topdir)
9
+ VPATH = $(srcdir):$(topdir):$(hdrdir)
10
+ prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
11
+ exec_prefix = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
12
+ sitedir = $(DESTDIR)/Library/Ruby/Site
13
+ rubylibdir = $(libdir)/ruby/$(ruby_version)
14
+ docdir = $(datarootdir)/doc/$(PACKAGE)
15
+ dvidir = $(docdir)
16
+ datarootdir = $(prefix)/share
17
+ archdir = $(rubylibdir)/$(arch)
18
+ sbindir = $(exec_prefix)/sbin
19
+ psdir = $(docdir)
20
+ localedir = $(datarootdir)/locale
21
+ htmldir = $(docdir)
22
+ datadir = $(datarootdir)
23
+ includedir = $(prefix)/include
24
+ infodir = $(DESTDIR)/usr/share/info
25
+ sysconfdir = $(prefix)/etc
26
+ mandir = $(DESTDIR)/usr/share/man
27
+ libdir = $(DESTDIR)/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib
28
+ sharedstatedir = $(prefix)/com
29
+ oldincludedir = $(DESTDIR)/usr/include
30
+ pdfdir = $(docdir)
31
+ sitearchdir = $(sitelibdir)/$(sitearch)
32
+ bindir = $(exec_prefix)/bin
33
+ localstatedir = $(prefix)/var
34
+ sitelibdir = $(sitedir)/$(ruby_version)
35
+ libexecdir = $(exec_prefix)/libexec
36
+
37
+ CC = gcc
38
+ LIBRUBY = $(LIBRUBY_SO)
39
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
40
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
41
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)
42
+
43
+ RUBY_EXTCONF_H =
44
+ CFLAGS = -fno-common -arch i386 -Os -pipe -fno-common -Wall
45
+ INCFLAGS = -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I.
46
+ CPPFLAGS = -I/usr/local/mysql/include
47
+ CXXFLAGS = $(CFLAGS)
48
+ DLDFLAGS = -L. -arch i386
49
+ LDSHARED = cc -arch i386 -pipe -bundle
50
+ AR = ar
51
+ EXEEXT =
52
+
53
+ RUBY_INSTALL_NAME = ruby
54
+ RUBY_SO_NAME = ruby
55
+ arch = universal-darwin9.0
56
+ sitearch = universal-darwin9.0
57
+ ruby_version = 1.8
58
+ ruby = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
59
+ RUBY = $(ruby)
60
+ RM = rm -f
61
+ MAKEDIRS = mkdir -p
62
+ INSTALL = /usr/bin/install -c
63
+ INSTALL_PROG = $(INSTALL) -m 0755
64
+ INSTALL_DATA = $(INSTALL) -m 644
65
+ COPY = cp
66
+
67
+ #### End of system configuration section. ####
68
+
69
+ preload =
70
+
71
+ libpath = . $(libdir) /usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm
72
+ LIBPATH = -L"." -L"$(libdir)" -L""/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm""
73
+ DEFFILE =
74
+
75
+ CLEANFILES =
76
+ DISTCLEANFILES =
77
+
78
+ extout =
79
+ extout_prefix =
80
+ target_prefix =
81
+ LOCAL_LIBS =
82
+ LIBS = $(LIBRUBYARG_SHARED) -lmysqlclient -lpthread -ldl -lm
83
+ SRCS = mysql_c.c
84
+ OBJS = mysql_c.o
85
+ TARGET = mysql_c
86
+ DLLIB = $(TARGET).bundle
87
+ EXTSTATIC =
88
+ STATIC_LIB =
89
+
90
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
91
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
92
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
93
+
94
+ TARGET_SO = $(DLLIB)
95
+ CLEANLIBS = $(TARGET).bundle $(TARGET).il? $(TARGET).tds $(TARGET).map
96
+ CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
97
+
98
+ all: $(DLLIB)
99
+ static: $(STATIC_LIB)
100
+
101
+ clean:
102
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
103
+
104
+ distclean: clean
105
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
106
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
107
+
108
+ realclean: distclean
109
+ install: install-so install-rb
110
+
111
+ install-so: $(RUBYARCHDIR)
112
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
113
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
114
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
115
+ install-rb: pre-install-rb install-rb-default
116
+ install-rb-default: pre-install-rb-default
117
+ pre-install-rb: Makefile
118
+ pre-install-rb-default: Makefile
119
+ $(RUBYARCHDIR):
120
+ $(MAKEDIRS) $@
121
+
122
+ site-install: site-install-so site-install-rb
123
+ site-install-so: install-so
124
+ site-install-rb: install-rb
125
+
126
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
127
+
128
+ .cc.o:
129
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
130
+
131
+ .cxx.o:
132
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
133
+
134
+ .cpp.o:
135
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
136
+
137
+ .C.o:
138
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
139
+
140
+ .c.o:
141
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
142
+
143
+ $(DLLIB): $(OBJS)
144
+ @-$(RM) $@
145
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
146
+
147
+
148
+
149
+ $(OBJS): ruby.h defines.h
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>English</string>
7
+ <key>CFBundleIdentifier</key>
8
+ <string>com.apple.xcode.dsym.conftest</string>
9
+ <key>CFBundleInfoDictionaryVersion</key>
10
+ <string>6.0</string>
11
+ <key>CFBundlePackageType</key>
12
+ <string>dSYM</string>
13
+ <key>CFBundleShortVersionString</key>
14
+ <string>1.0</string>
15
+ <key>CFBundleSignature</key>
16
+ <string>????</string>
17
+ <key>CFBundleVersion</key>
18
+ <string>1.0</string>
19
+ <key>dSYM_UUID</key>
20
+ <dict>
21
+ <key>i386</key>
22
+ <string>05 b9 4d f7 0d 04 81 0a df 53 f8 8d ab f7 aa 08</string>
23
+ </dict>
24
+ </dict>
25
+ </plist>
@@ -1,46 +1,53 @@
1
- require 'mkmf'
2
- require 'open3'
1
+ if `uname -sr` =~ /^Darwin/
2
+ ENV["RC_ARCHS"] = `uname -m`.chomp
3
+ unless File.exists?("/usr/local/mysql/lib/mysql")
4
+ `sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql` rescue nil
5
+ end
6
+ end
3
7
 
4
- # Heimidal hack
5
- ENV["ARCHFLAGS"] = '-arch i386'
6
- if `uname -sr` =~ /^Darwin 9/
7
- `sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql` rescue nil
8
- `sudo ln -s /usr/local/mysql/bin/mysql_config /usr/local/mysql/bin/mysql_config5` rescue nil
8
+ # Figure out where mysql_config is
9
+ if !`which mysql_config`.chomp.empty?
10
+ @mysql_config_bin = "mysql_config"
11
+ elsif !`which mysql_config5`.chomp.empty?
12
+ @mysql_config_bin = "mysql_config5"
13
+ else
14
+ puts "Cannot find mysql_config in your path. Please enter a location: "
15
+ location = gets.chomp
16
+ if File.exists?(location)
17
+ @mysql_config_bin = location
18
+ else
19
+ puts "Cannot find that file. Exiting."
20
+ exit
21
+ end
9
22
  end
10
23
 
24
+ require 'mkmf'
25
+ require 'open3'
26
+
11
27
  def config_value(type)
12
28
  ENV["MYSQL_#{type.upcase}"] || mysql_config(type)
13
29
  end
14
30
 
15
- def mysql_config(type)
31
+ @mysql_config = {}
16
32
 
17
- sin, sout, serr = Open3.popen3("mysql_config5 --#{type}")
18
-
19
- unless serr.read.empty?
20
- sin, sout, serr = Open3.popen3("mysql_config --#{type}")
21
- end
33
+ def mysql_config(type)
34
+ return @mysql_config[type] if @mysql_config[type]
22
35
 
23
- # If mysql_config is not in your path
24
- unless serr.read.empty?
25
- sin, sout, serr = Open3.popen3("/usr/local/mysql/bin/mysql_config --#{type}")
26
- end
27
-
28
- unless serr.read.empty?
29
- sin, sout, serr = Open3.popen3("/usr/local/mysql/bin/mysql_config5 --#{type}")
30
- end
36
+ sin, sout, serr = Open3.popen3("#{@mysql_config_bin} --#{type}")
31
37
 
32
38
  unless serr.read.empty?
33
39
  raise "mysql_config not found"
34
40
  end
35
41
 
36
- sout.readline.chomp[2..-1]
42
+ @mysql_config[type] = sout.readline.chomp[2..-1]
43
+ @mysql_config[type]
37
44
  end
38
45
 
39
46
  $inc, $lib = dir_config('mysql', config_value('include'), config_value('libs_r'))
40
47
 
41
48
  def have_build_env
42
49
  libs = ['m', 'z', 'socket', 'nsl']
43
- while not find_library('mysqlclient', 'mysql_query', config_value('libs'), $lib, "#{$lib}/mysql") do
50
+ while not find_library('mysqlclient', "mysql_query", config_value('libs'), $lib, "#{$lib}/mysql") do
44
51
  exit 1 if libs.empty?
45
52
  have_library(libs.shift)
46
53
  end
@@ -0,0 +1,24 @@
1
+ find_library: checking for mysql_query() in -lmysqlclient... -------------------- yes
2
+
3
+ "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -I/usr/local/mysql/include -arch i386 -Os -pipe -fno-common conftest.c -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L""/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm"" -L. -arch i386 -lruby -lmysqlclient -lpthread -ldl -lm "
4
+ conftest.c: In function ‘t’:
5
+ conftest.c:3: error: ‘mysql_query’ undeclared (first use in this function)
6
+ conftest.c:3: error: (Each undeclared identifier is reported only once
7
+ conftest.c:3: error: for each function it appears in.)
8
+ checked program was:
9
+ /* begin */
10
+ 1: /*top*/
11
+ 2: int main() { return 0; }
12
+ 3: int t() { void ((*volatile p)()); p = (void ((*)()))mysql_query; return 0; }
13
+ /* end */
14
+
15
+ "gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -I/usr/local/mysql/include -arch i386 -Os -pipe -fno-common conftest.c -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L""/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm"" -L. -arch i386 -lruby -lmysqlclient -lpthread -ldl -lm "
16
+ checked program was:
17
+ /* begin */
18
+ 1: /*top*/
19
+ 2: int main() { return 0; }
20
+ 3: int t() { mysql_query(); return 0; }
21
+ /* end */
22
+
23
+ --------------------
24
+
Binary file
Binary file
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: do_mysql
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.1
7
- date: 2007-11-12 00:00:00 -08:00
6
+ version: 0.2.2
7
+ date: 2007-11-18 00:00:00 -08:00
8
8
  summary: A DataObject.rb driver for mysql
9
9
  require_paths:
10
10
  - lib
@@ -34,9 +34,19 @@ files:
34
34
  - Rakefile
35
35
  - TODO
36
36
  - lib/do_mysql.rb
37
+ - ext/conftest.dSYM
38
+ - ext/conftest.dSYM/Contents
39
+ - ext/conftest.dSYM/Contents/Info.plist
40
+ - ext/conftest.dSYM/Contents/Resources
41
+ - ext/conftest.dSYM/Contents/Resources/DWARF
42
+ - ext/conftest.dSYM/Contents/Resources/DWARF/conftest
37
43
  - ext/extconf.rb
44
+ - ext/Makefile
45
+ - ext/mkmf.log
46
+ - ext/mysql_c.bundle
38
47
  - ext/mysql_c.c
39
48
  - ext/mysql_c.i
49
+ - ext/mysql_c.o
40
50
  test_files: []
41
51
 
42
52
  rdoc_options: []