25ac00e
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
25ac00e
25ac00e
%define srcname sqlalchemy-migrate
25ac00e
25ac00e
Name: python-migrate
25ac00e
Version: 0.4.4
25ac00e
Release: 3%{?dist}
25ac00e
Summary: Schema migration tools for SQLAlchemy
25ac00e
25ac00e
Group: Development/Languages
25ac00e
License: MIT
25ac00e
URL: http://code.google.com/p/%{srcname}/
25ac00e
Source0: http://%{srcname}.googlecode.com/files/%{srcname}-%{version}.tar.gz
25ac00e
# Fix a test when migrate is not installed.  Applied upstream.
25ac00e
Patch0: python-migrate-shell-test.patch
25ac00e
25ac00e
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
25ac00e
25ac00e
BuildArch: noarch
25ac00e
BuildRequires: python-devel
25ac00e
BuildRequires: python-setuptools-devel
25ac00e
Requires: python-sqlalchemy >= 0.3.10
25ac00e
25ac00e
%description
25ac00e
Schema migration tools for SQLAlchemy designed to support an agile approach
25ac00e
to database design and make it easier to keep development and production
25ac00e
databases in sync as schema changes are required.  It allows you to manage 
25ac00e
atabase change sets and database repository versioning.
25ac00e
25ac00e
%prep
25ac00e
%setup -q -n %{srcname}-%{version}
25ac00e
%patch0 -p1 -b .env
25ac00e
25ac00e
%build
25ac00e
%{__python} setup.py build
25ac00e
25ac00e
%install
25ac00e
%{__rm} -rf %{buildroot}
25ac00e
%{__python} setup.py install --skip-build --root %{buildroot}
25ac00e
%{__mv} %{buildroot}%{_bindir}/migrate %{buildroot}%{_bindir}/sqlalchemy-migrate
25ac00e
25ac00e
%clean
25ac00e
%{__rm} -rf %{buildroot}
25ac00e
25ac00e
# Check needs py.test in order to run
25ac00e
#%check
25ac00e
#echo 'sqlite:///__tmp__' > test_db.cfg
25ac00e
# setuptools doesn't appear to be compatible with py.test
25ac00e
# %{__python} setup.py test
25ac00e
#%{__python} -c 'from py.test.cmdline import main; main(["test"])'
25ac00e
25ac00e
%files
25ac00e
%defattr(-,root,root,-)
25ac00e
%doc README CHANGELOG docs/
25ac00e
%{_bindir}/sqlalchemy-migrate
25ac00e
%{python_sitelib}/*
25ac00e
25ac00e
%changelog
25ac00e
* Tue Jul 15 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4.4-3
25ac00e
- Rename binary to sqlalchemy-migrate to avoid potential filename clashes.
25ac00e
  (Queried upstream but the change is only in Fedora).  Noted that
25ac00e
  openmosix defintely has a /usr/bin/migrate already.
25ac00e
25ac00e
* Sat Jul 06 2008 Ricky Zhou <ricky@fedoraproject.org> 0.4.4-2
25ac00e
- Add BuildRequires on python-setuptools-devel.
25ac00e
- Add Requires on SQLAlchemy.
25ac00e
25ac00e
* Sat Jun 21 2008 Toshio Kuratomi <toshio@fedoraproject.org> 0.4.4-1
25ac00e
- Initial Fedora Build.