757b8ba
%if !(0%{?fedora} > 12 || 0%{?rhel} > 5)
757b8ba
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
757b8ba
%endif
6322798
757b8ba
%global srcname sqlalchemy-migrate
6322798
6322798
Name: python-migrate
edccf8a
Version: 0.7.2
2edd588
Release: 1%{?dist}
6322798
Summary: Schema migration tools for SQLAlchemy
6322798
6322798
Group: Development/Languages
6322798
License: MIT
6322798
URL: http://code.google.com/p/%{srcname}/
a4c8ee8
Source0: http://%{srcname}.googlecode.com/files/%{srcname}-%{version}.tar.gz
5613a61
# Patch to update to new scripttest API submitted upstream
5613a61
Patch0: migrate-scripttest-update.patch
731cb66
# Patch to fix a unittest on python-2.7
731cb66
Patch1: migrate-py27.patch
34c4971
# Local patch to rename /usr/bin/migrate to sqlalchemy-migrate
731cb66
Patch100: python-migrate-sqlalchemy-migrate.patch
6322798
6322798
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
6322798
6322798
BuildArch: noarch
6322798
BuildRequires: python-devel
001c0cd
BuildRequires: python-sqlalchemy
6322798
BuildRequires: python-setuptools-devel
001c0cd
BuildRequires: python-nose
136962d
BuildRequires: python-sphinx
757b8ba
BuildRequires: python-decorator
526a10b
bfd9e8b
# for testsuite
bfd9e8b
BuildRequires: python-scripttest
bfd9e8b
BuildRequires: python-tempita
bfd9e8b
e3d1840
Requires: python-sqlalchemy
34c4971
Requires: python-setuptools
757b8ba
Requires: python-decorator
6322798
757b8ba
%if 0%{?rhel} && 0%{?rhel} < 6
526a10b
BuildRequires: python-sqlite2
526a10b
Requires:      python-sqlite2
526a10b
%endif
526a10b
526a10b
6322798
%description
6322798
Schema migration tools for SQLAlchemy designed to support an agile approach
6322798
to database design and make it easier to keep development and production
6322798
databases in sync as schema changes are required.  It allows you to manage 
6322798
atabase change sets and database repository versioning.
6322798
6322798
%prep
a4c8ee8
%setup -q -n %{srcname}-%{version}
5613a61
%patch0 -p1 -b .test
731cb66
%patch1 -p1 -b .py27
edccf8a
%patch100 -p1 -b .rename
bfd9e8b
bfd9e8b
# use real unittest in python 2.7 and up
bfd9e8b
sed -i "s/import unittest2/import unittest as unittest2/g" \
bfd9e8b
    migrate/tests/fixture/__init__.py \
bfd9e8b
    migrate/tests/fixture/base.py
6322798
6322798
%build
6322798
%{__python} setup.py build
6322798
6322798
%install
6322798
%{__rm} -rf %{buildroot}
6322798
%{__python} setup.py install --skip-build --root %{buildroot}
6322798
6322798
%clean
6322798
%{__rm} -rf %{buildroot}
6322798
001c0cd
%check
5613a61
# Need to set PATH for two reasons:
5613a61
# 1) Path isn't being cleared by mock so we have /root/bin/ in the PATH
5613a61
# 2) Need to be able to find the newly installed migrate binaries
5613a61
PATH=/bin:/usr/bin:%{buildroot}%{_bindir}
5613a61
export PATH
5613a61
5613a61
PYTHONPATH=`pwd`
5613a61
export PYTHONPATH
001c0cd
echo 'sqlite:///__tmp__' > test_db.cfg
5613a61
nosetests
6322798
6322798
%files
6322798
%defattr(-,root,root,-)
2edd588
%doc README docs/
34c4971
%{_bindir}/*
6322798
%{python_sitelib}/*
6322798
6322798
%changelog
edccf8a
* Tue Nov 08 2011 Martin Bacovsky <mbacovsk@redhat.com> - 0.7.2-1
edccf8a
- Updated to new version
edccf8a
2edd588
* Sat Jun 25 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7-1
2edd588
- Update to new version compatible with SQLAlchemy 0.7.x.
2edd588
a16524c
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6-4
a16524c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
a16524c
e3d1840
* Thu Jan 13 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6-3
e3d1840
- Fix SQLAlchemy Requires -- need >= 0.5, not 0.6
2edd588
5613a61
* Sun Aug 1 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6-2
5613a61
- Update to unittests to work with newer scripttest API
5613a61
bfd9e8b
* Sat Jul 31 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.6-1
bfd9e8b
- update to new version
bfd9e8b
- testsuite doesn't work right now
bfd9e8b
1fe884f
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.5.4-2
1fe884f
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
1fe884f
757b8ba
* Tue Apr 20 2010 Martin Bacovsky <mbacovsk@redhat.com> - 0.5.4-1
757b8ba
- Update to new bugfix release 
757b8ba
d447119
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.3-3
d447119
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
d447119
526a10b
* Mon Jun 01 2009 Luke Macken <lmacken@redhat.com> 0.5.3-2
526a10b
- Add python-migrate-py2.4-import.patch, which makes the use
526a10b
  of __import__ work on Python 2.4
526a10b
- Add python-sqlite2 to the build requirements on FC6 and below
526a10b
e84bee0
* Thu Apr 16 2009 Toshio Kuratomi <toshio@fedoraproject.org> 0.5.3-1
e84bee0
- Update to new bugfix release.
e84bee0
7805020
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1.2-3
7805020
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
7805020
136962d
* Wed Feb 11 2009 Toshio Kuratomi <toshio@fedoraproject.org> 0.5.1.2-2
136962d
- Add BR on python-sphinx
136962d
a4c8ee8
* Wed Feb 11 2009 Toshio Kuratomi <toshio@fedoraproject.org> 0.5.1.2-1
a4c8ee8
- Update to 0.5.1.2 release with official support for SA-0.5
a4c8ee8
- Remove patches merged upstream
a4c8ee8
001c0cd
* Mon Jan 26 2009 Toshio Kuratomi <toshio@fedoraproject.org> 0.5.1-0.1.20090122.svn479
001c0cd
- Update to snapshot so that it works with sqlalchemy-0.5
001c0cd
- Enable test suite
001c0cd
4478056
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.4.5-4
4478056
- Rebuild for Python 2.6
4478056
34c4971
* Tue Jul 29 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4.5-3
34c4971
- Patch to generate a script for the repository migrate script.
34c4971
- Move the script rename into a patch to setup.py.
34c4971
e0589b5
* Thu Jul 17 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4.5-2
e0589b5
- Remove patches that are merged upstream.
e0589b5
eb45d14
* Thu Jul 17 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4.5-1
eb45d14
- New upstream
eb45d14
964a529
* Thu Jul 17 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4.4-4
964a529
- Disable py.test so we don't try to download it during build.
964a529
6322798
* Tue Jul 15 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4.4-3
6322798
- Rename binary to sqlalchemy-migrate to avoid potential filename clashes.
6322798
  (Queried upstream but the change is only in Fedora).  Noted that
6322798
  openmosix defintely has a /usr/bin/migrate already.
6322798
6322798
* Sat Jul 06 2008 Ricky Zhou <ricky@fedoraproject.org> 0.4.4-2
6322798
- Add BuildRequires on python-setuptools-devel.
6322798
- Add Requires on SQLAlchemy.
6322798
6322798
* Sat Jun 21 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4.4-1
6322798
- Initial Fedora Build.