mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-16 03:50:43 +08:00
Minor updates.
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
prune CVS
|
||||
recursive-include doc *.html *.sgml
|
||||
recursive-include examples db* README test.sql
|
||||
include build.py
|
||||
recursive-include doc *
|
||||
recursive-include examples *
|
||||
include README.MySQLmodule
|
||||
include compile.py
|
||||
include license.py
|
||||
include MANIFEST.in
|
||||
include MANIFEST
|
||||
|
@ -1,5 +1,5 @@
|
||||
%define ver 0.2.2
|
||||
%define rel 3
|
||||
%define ver 0.3.0b1
|
||||
%define rel 1
|
||||
Summary: Python interface to MySQL-3.22 and 3.23
|
||||
Name: MySQL-python
|
||||
Version: %ver
|
||||
@ -47,17 +47,13 @@ derived from the Python license.
|
||||
%setup -n MySQLdb-%ver
|
||||
|
||||
%build
|
||||
python build.py
|
||||
python setup.py build
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/python1.5/site-packages
|
||||
make install prefix=$RPM_BUILD_ROOT/usr
|
||||
cp MySQLdb.py{,c,o} $RPM_BUILD_ROOT/usr/lib/python1.5/site-packages
|
||||
python setup.py install --root $RPM_BUILD_ROOT
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%doc license.py examples/* doc/* CompatMysqldb.py
|
||||
/usr/lib/python1.5/site-packages/MySQLdb.py
|
||||
/usr/lib/python1.5/site-packages/MySQLdb.pyc
|
||||
/usr/lib/python1.5/site-packages/MySQLdb.pyo
|
||||
/usr/lib/python1.5/site-packages/_mysqlmodule.so
|
||||
%doc license.py examples/* doc/*.html doc/*.sgml README
|
||||
/usr/lib/python*/site-packages/*
|
||||
|
62
mysql/README
62
mysql/README
@ -1,25 +1,53 @@
|
||||
Python-2.0:
|
||||
Prerequisites:
|
||||
|
||||
Edit setup.py and make sure the paths are right for your system. This
|
||||
uses Distutils, so it should work on all platforms.
|
||||
Python 1.5.2 or higher
|
||||
-- http://www.pythonlabs.com/products/python2.0/download_python2.0.html
|
||||
-- http://www.python.org/1.6/
|
||||
-- http://www.python.org/1.5/
|
||||
-- Versions lower than 1.5.2 WON'T WORK.
|
||||
-- If you have Red Hat Linux or a similar packaging system, make sure
|
||||
you have the Python development headers and libraries (python-devel).
|
||||
|
||||
Distutils 1.0 or higher
|
||||
-- comes with Python 1.6 and 2.0
|
||||
-- http://www.python.org/sigs/distutils-sig/download.html
|
||||
|
||||
MySQL 3.22.19 or higher
|
||||
-- http://www.mysql.com/downloads/
|
||||
-- Versions lower than 3.22 definitely WON'T WORK.
|
||||
-- Versions lower than 3.22.19 might not work.
|
||||
-- The current (recommended) 3.22 release is 3.22.32.
|
||||
-- MySQL-3.23 is beta at present but supported.
|
||||
-- If you have Red Hat Linux or a similar packaging system, make sure
|
||||
you have the MySQL development headers and libraries (MySQL-devel).
|
||||
|
||||
First thing to do is edit setup.py. There are some variables towards the
|
||||
beginning that tell it where your MySQL include files and libraries are.
|
||||
The values are right for MySQL's standard Red Hat Linux (6.2) RPMs. If
|
||||
you have another platform, you'll have to figure out the right values
|
||||
yourself.
|
||||
|
||||
Note that recent binary distributions 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.
|
||||
|
||||
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 loader path,
|
||||
you will have to set or adjust the LD_LIBRARY_PATH environment variable
|
||||
(on Linux) or whatever your platform requires. Otherwise, you can adjust
|
||||
setup.py to link against the static library.
|
||||
|
||||
Finally, putting it together:
|
||||
|
||||
$ python setup.py build
|
||||
# python setup.py install
|
||||
|
||||
Python-1.6:
|
||||
If you prefer RPMs, you can use the bdist_rpm command with setup.py.
|
||||
|
||||
The previous method should work, else use the classic method.
|
||||
Thanks go to Brian Fordham for cooking up an early version of setup.py.
|
||||
|
||||
Python-1.5.2:
|
||||
License: GPL or the original license based on Python 1.5.2's license.
|
||||
|
||||
Get Distutils from www.pythonlabs.com and install it. Then do as above.
|
||||
Else, use the classic method.
|
||||
|
||||
Classic method:
|
||||
|
||||
Check Setup.in and make sure it has the right paths for your system.
|
||||
|
||||
To build: python build.py
|
||||
To install: follow additional instructions after build.
|
||||
|
||||
Got windows? Try compile.py instead.
|
||||
Andy Dustman <andy@dustman.net>
|
||||
2000-11-30
|
||||
|
@ -597,7 +597,7 @@ _mysql_string_literal(
|
||||
if (!str) return PyErr_NoMemory();
|
||||
out = PyString_AS_STRING(str);
|
||||
#if MYSQL_VERSION_ID < 32321
|
||||
len = mysql_escape_string(out+1, s, size);
|
||||
len = mysql_escape_string(out+1, in, size);
|
||||
#else
|
||||
if (self)
|
||||
len = mysql_real_escape_string(&(self->connection), out+1, in, size);
|
||||
|
@ -18,7 +18,7 @@ thread_safe_library = NO
|
||||
|
||||
mysqlclient = thread_safe_library and "mysqlclient_r" or "mysqlclient"
|
||||
|
||||
if sys.platform == "linux-386": # Red Hat
|
||||
if sys.platform == "linux-i386": # Red Hat
|
||||
include_dirs = ['/usr/include/mysql']
|
||||
library_dirs = ['/usr/lib/mysql']
|
||||
libraries = [mysqlclient, "z"]
|
||||
@ -48,10 +48,30 @@ else:
|
||||
raise "UnknownPlatform", "sys.platform=%s, os.name=%s" % \
|
||||
(sys.platform, os.name)
|
||||
|
||||
long_description = \
|
||||
"""Python interface to MySQL-3.22 and 3.23
|
||||
|
||||
MySQLdb is an interface to the popular MySQL database server for Python.
|
||||
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.22 and 3.23
|
||||
|
||||
This module should be mostly compatible with an older interface
|
||||
written by Joe Skinner and others. However, the older version is
|
||||
a) not thread-friendly, b) written for MySQL 3.21, c) apparently
|
||||
not actively maintained. No code from that version is used in
|
||||
MySQLdb. MySQLdb is distributed free of charge under a license
|
||||
derived from the Python license.
|
||||
"""
|
||||
|
||||
setup (# Distribution meta-data
|
||||
name = "MySQLdb",
|
||||
version = "0.3.0b2",
|
||||
name = "MySQL-python",
|
||||
version = "0.3.0",
|
||||
description = "An interface to MySQL",
|
||||
long_description=long_description,
|
||||
author = "Andy Dustman",
|
||||
author_email = "andy@dustman.net",
|
||||
url = "http://dustman.net/andy/python/MySQLdb",
|
||||
@ -61,7 +81,7 @@ setup (# Distribution meta-data
|
||||
py_modules = ["MySQLdb", "CompatMysqldb"],
|
||||
|
||||
ext_modules = [Extension(
|
||||
name='_mysqlmodule',
|
||||
name='_mysql',
|
||||
sources=['_mysqlmodule.c'],
|
||||
include_dirs=include_dirs,
|
||||
library_dirs=library_dirs,
|
||||
|
Reference in New Issue
Block a user