Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Remi Collet
22f13e5bb6 update to 1.0.12 (GA) 2013-08-26 18:17:46 +02:00
Remi Collet
a93fe5a79e update to 1.0.10 2013-05-08 15:29:53 +02:00
Remi Collet
34d36bd0d3 version 1.0.9 GA, disable test suite in mock 2013-02-27 09:03:53 +01:00
4 changed files with 55 additions and 67 deletions

4
.gitignore vendored
View file

@ -5,3 +5,7 @@
/mysql-connector-python-1.0.6b2-nodocs.tar.bz2
/mysql-connector-python-1.0.7-nodocs.tar.bz2
/mysql-connector-python-1.0.8-nodocs.tar.bz2
/mysql-connector-python-1.0.9-nodocs.tar.bz2
/mysql-connector-python-1.0.10.tar.gz
/mysql-connector-python-1.0.11.tar.gz
/mysql-connector-python-1.0.12.tar.gz

View file

@ -1,32 +1,47 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
# spec file for mysql-connector-python
#
# Copyright (c) 2011-2013 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/3.0/
#
# Please, preserve the changelog entries
#
%{!?__python2: %global __python2 %{__python}}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%if 0%{?fedora} >= 13
%global with_python3 1
%else
%global with_python3 0
%endif
#global versuffix b2
# Tests only run on manual build --with tests
# Tests rely on MySQL version 5.6
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
Name: mysql-connector-python
Version: 1.0.8
Release: 1%{?versuffix:.%{versuffix}}%{?dist}
Version: 1.0.12
Release: 1%{?dist}
Summary: MySQL Connector for Python 2
Group: Development/Languages
License: GPLv2 with exceptions
URL: http://dev.mysql.com/usingmysql/python/
# Launch stripdocs.sh to remove non GPL documentation
Source0: %{name}-%{version}%{?versuffix}-nodocs.tar.bz2
Source1: stripdocs.sh
URL: http://dev.mysql.com/doc/connector-python/en/index.html
# Upstream has a mirror redirector for downloads, so the URL is hard to
# represent statically. You can get the tarball by following a link from
# http://dev.mysql.com/downloads/connector/python/
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python-devel
BuildRequires: python2-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif
%if %{with_tests}
# for unittest
BuildRequires: mysql-server
%endif
%description
@ -36,8 +51,7 @@ is necessary to run this Python DB API v2.0 compliant driver.
%if 0%{?with_python3}
%package -n mysql-connector-python3
Summary: MySQL Connector for Python 3
Summary: MySQL Connector for Python 3
%description -n mysql-connector-python3
MySQL Connector/Python is implementing the MySQL Client/Server protocol
@ -47,9 +61,8 @@ is necessary to run this Python DB API v2.0 compliant driver.
%prep
%setup -q -n %{name}-%{version}%{?versuffix}
%setup -q -n %{name}-%{version}
chmod -x python?/examples/*py
mv docs/README.txt README-docs
%build
@ -57,55 +70,59 @@ mv docs/README.txt README-docs
%install
rm -rf $RPM_BUILD_ROOT
rm -rf %{buildroot}
%if 0%{?with_python3}
# Python 3 build
%{__python3} setup.py install --root $RPM_BUILD_ROOT
%{__python3} setup.py install --root %{buildroot}
rm -rf build
%endif
# Python 2 build (end with this for tests)
%{__python} setup.py install --root $RPM_BUILD_ROOT
%{__python2} setup.py install --root %{buildroot}
%check
ver=$(mysql_config --version 2>/dev/null || echo 0)
if [ "$ver" \< "5.5" ]
then
## Test 809033 fails with mysql 5.1
sed -e '/test_bugs/d' \
-i python2/tests/__init__.py
fi
%if 0%{?rhel} == 5
sed -e '/test_network/d' \
-e '/test_connection/d' \
-i python2/tests/__init__.py
%endif
%{__python} unittests.py \
%if %{with_tests}
%{__python2} unittests.py \
--mysql-basedir=%{_prefix} \
--verbosity=1
%else
: echo test suite disabled, need '--with tests' option
%endif
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc ChangeLog COPYING README*
%doc ChangeLog COPYING README* docs/README_DOCS.txt
%doc python2/examples
%{python_sitelib}/*
%{python2_sitelib}/*
%if 0%{?with_python3}
%files -n mysql-connector-python3
%defattr(-,root,root,-)
%doc ChangeLog COPYING README*
%doc ChangeLog COPYING README* docs/README_DOCS.txt
%doc python3/examples
%{python3_sitelib}/*
%endif
%changelog
* Mon Aug 26 2013 Remi Collet <remi@fedoraproject.org> - 1.0.12-1
- version 1.0.12 GA
* Wed May 8 2013 Remi Collet <remi@fedoraproject.org> - 1.0.10-1
- version 1.0.10 GA
- archive is now free (no more doc to strip)
* Wed Feb 27 2013 Remi Collet <remi@fedoraproject.org> - 1.0.9-1
- version 1.0.9 GA
- disable test suite in mock, fix FTBFS #914203
* Sat Dec 29 2012 Remi Collet <remi@fedoraproject.org> - 1.0.8-1
- version 1.0.8 GA

View file

@ -1 +1 @@
38655dade1b06d18ba1085ac6f00018f mysql-connector-python-1.0.8-nodocs.tar.bz2
caac07dc8fa08d1f55ad0c51491d2ba7 mysql-connector-python-1.0.12.tar.gz

View file

@ -1,33 +0,0 @@
#!/bin/bash
if [ "$1" = "" ]; then
echo usage $0 version
exit 1
fi
if [ ! -f mysql-connector-python-$1.tar.gz ]; then
echo please download mysql-connector-python-$1.tar.gz
echo http://dev.mysql.com/downloads/connector/python/
exit 1
fi
tdir=`mktemp -d tmpXXXXXX`
pushd $tdir
echo -n "unpacking..."
tar xzf ../mysql-connector-python-$1.tar.gz && echo " done"
rm -rf mysql-connector-python-$1/docs/my*
echo -n "packing..."
tar cjf ../mysql-connector-python-$1-nodocs.tar.bz2 mysql-connector-python-$1 && echo " done"
echo -n "diffing..."
tar tzf ../mysql-connector-python-$1.tar.gz | sort >before
echo -n "..."
tar tjf ../mysql-connector-python-$1-nodocs.tar.bz2 | sort >after
diff before after
popd
echo "cleaning..."
rm -rf $tdir