Build and documentation updates

This commit is contained in:
adustman
2003-04-19 04:26:57 +00:00
parent aea6704864
commit 43854cc57e
2 changed files with 72 additions and 43 deletions

View File

@ -13,8 +13,8 @@ Prerequisites:
* Versions lower than 1.5.2 WON'T WORK.
* All versions from 1.5.2 should work. 1.6.x versions have not been
tested. 2.1.3 and 2.2.1 have both been tested. 2.0.x has not been
recently tested.
tested. 2.1.3 and 2.2.3 have both been tested. 2.0.x has not been
recently tested. 2.3 (alpha) support is coming summer 2003.
* Red Hat Linux:
@ -51,14 +51,19 @@ Prerequisites:
* Versions lower than 3.22.19 might not work.
* MySQL-4.0 is supported. Current release 4.0.2 alpha.
* MySQL-4.1 is not yet supported, but should be by summer 2003.
Current release 4.1.0 (alpha).
* MySQL-3.23 is supported. Current release: 3.23.51.
* MySQL-4.0 is supported. Current release 4.0.12.
* MySQL-3.23 is supported. Current release: 3.23.56.
* MySQL-3.22 is deprecated in favor of 3.23, but still supported.
* Red Hat Linux packages:
o XXX May be out of date for Red Hat 8.0 and newer
o mysql-devel to compile; doesn't seem to come with the
thread-safe client library
@ -76,6 +81,10 @@ Prerequisites:
* I prefer the MySQL.com packages to the Red Hat packages.
* Transactions (particularly InnoDB tables) are supported for
MySQL-3.23 and up. You may need a special package from your
vendor with this support turned on.
zlib
@ -85,7 +94,7 @@ Prerequisites:
o zlib-devel to compile
* zlib to run
o zlib to run
A C COMPILER!!!
@ -111,14 +120,30 @@ Building and installing
remove the parameters that are complained about. Upgrading distutils
is the smart way to go.
Note that recent binary distributions from mysql.com include two
sets of client libraries: mysqlclient and mysqlclient_r. The latter
are the "thread-safe" libraries, so use those if you can, and if
threading is important to you. By default, thread-safe libraries are
used. You can find out what you actually have by using the
_mysql.thread_safe_client() function (returns boolean). Strangely,
it appears that the thread-safe library is only available as a
shared library.
Depending on which version of MySQL you have, you may have the
option of using three different client libraries:
mysqlclient -- mostly but not guaranteed thread-safe
mysqlclient_r -- thread-safe, use if you can
mysqld -- embedded server
mysqlclient is used by default. To use one of the others, set
the environment variable mysqlclient to the name of the library
you want to use.
There are several active versions of MySQL out there, and this
makes it a little tricky to configure setup.py automatically and
still be cross-platform. setup.py assumes you are using version
3.23.32. To specify a different version, set the environment
variable mysqlversion.
If your MySQL is compiled with certain options, you may need to
add some more libraries to the link. In particular, with 4.0 and
up, if MySQL was configured to use SSL, you need to link against
crypto and ssl. You can do this by setting the environment
variable mysqloptlibs a space-separated list of libraries.
If you have the dynamic client libraries (on Linux, .so vs. .a),
those will be used by default. If they are not on your standard
@ -133,8 +158,11 @@ Building and installing
Finally, putting it together:
$ tar xfz MySQL-python-0.9.2.tar.gz
$ cd MySQL-python-0.9.2
$ tar xfz MySQL-python-0.9.3.tar.gz
$ cd MySQL-python-0.9.3
$ export mysqlversion="4.0.12"
$ export mysqlclient="mysqlclient_r"
$ export mysqloptlibs="ssl crypto"
$ python setup.py build
$ su
# python setup.py install
@ -142,7 +170,9 @@ Building and installing
Windows
I don't do Windows.
I don't do Windows. However if someone provides me with a package
for Windows, I'll make it available. Don't ask me for help with
Windows because I can't help you.
Zope
@ -176,12 +206,22 @@ Building and installing
MySQL-python is pre-packaged in Red Hat Linux 7.x and newer.
Debian
Debian GNU/Linux
Packaged as python-mysql.
http://www.debian.org/distrib/packages
Gentoo Linux
It's in the portage tree.
# emerge sync
# emerge mysql-python
# emerge zmysqlda # if you use Zope
Note that zmysqlda will pull in mysql-python-py2.1 automatically
as Zope still officially requires Python-2.1.3.
*BSD
@ -202,4 +242,4 @@ License
Andy Dustman <andy@dustman.net>
2002-07-10
2003-04-19

View File

@ -10,29 +10,16 @@ import string
YES = 1
NO = 0
# set this to YES to use the special thread-safe mysqlclient_r library
# Note that since MySQL 4.0, it appears the normal library is
# thread-safe by default, so you can leave this set as NO.
# If building an embedded server, this option is ignored.
thread_safe_library = NO
# set this to YES if you want an embedded server version
embedded_server = NO
# You probably don't have to do anything past this point. If you
# do, please mail me the configuration for your platform. Don't
# forget to include the value of sys.platform and os.name.
mysqlclient = os.getenv('mysqlclient', 'mysqlclient')
mysqlversion = tuple(map(int, string.split(os.getenv('mysqlversion', '3.23.32'), '.')))
mysqloptlibs = string.split(os.getenv('mysqloptlibs', ''))
embedded_server = (mysqlclient == 'mysqld')
name = "MySQL-%s" % os.path.basename(sys.executable)
if embedded_server:
name = name + "-embedded"
version = "0.9.3"
if embedded_server:
mysqlclient = "mysqld"
else:
mysqlclient = thread_safe_library and "mysqlclient_r" or "mysqlclient"
# include files and library locations should cover most platforms
include_dirs = [
'/usr/include/mysql', '/usr/local/include/mysql',
@ -43,9 +30,12 @@ library_dirs = [
'/usr/local/mysql/lib/mysql'
]
libraries = [mysqlclient] + mysqloptlibs
# MySQL-3.23 and newer need libz
libraries = [mysqlclient, "z"]
if embedded_server:
if mysqlversion > (3,23,0):
libraries.append("z")
if mysqlversion > (4,0,0):
libraries.append("crypt")
# On some platorms, this can be used to find the shared libraries
@ -74,8 +64,7 @@ elif sys.platform == "sunos5": # Solaris 2.8 + gcc
elif sys.platform == "win32": # Ugh
include_dirs = [r'c:\mysql\include']
library_dirs = [r'c:\mysql\lib\opt']
libraries = [mysqlclient, 'zlib', 'msvcrt', 'libcmt',
'wsock32', 'advapi32']
libraries.extend(['zlib', 'msvcrt', 'libcmt', 'wsock32', 'advapi32'])
extra_objects = [r'c:\mysql\lib\opt\mysqlclient.lib']
elif sys.platform == "cygwin":
include_dirs = ['/c/mysql/include']
@ -94,7 +83,7 @@ else:
(sys.platform, os.name)
long_description = \
"""Python interface to MySQL-3.23
"""Python interface to MySQL
MySQLdb is an interface to the popular MySQL database server for Python.
The design goals are:
@ -102,7 +91,7 @@ The design goals are:
- Compliance with Python database API version 2.0
- Thread-safety
- Thread-friendliness (threads will not block each other)
- Compatibility with MySQL-3.23 and later
- Compatibility with MySQL-3.22 and later
This module should be mostly compatible with an older interface
written by Joe Skinner and others. However, the older version is