Name: python3-postgresql Version: 1.0.0 Release: 1%{?dist} Summary: Connect to PostgreSQL with Python 3 Group: Applications/Databases License: BSD URL: http://python.projects.postgresql.org/ Source0: http://python.projects.postgresql.org/files/py-postgresql-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python3-devel %description py-postgresql is a Python 3 package providing modules to work with PostgreSQL. This includes a high-level driver, and many other tools that support a developer working with PostgreSQL databases. %prep %setup -q -n py-postgresql-%{version} %build CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build %install rm -rf $%{buildroot} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} # Two scripts contain useful executable content, but aren't executable, and # have "#!/usr/bin/env python" shebangs, which would lead to them being # executed with Python 2, not Python 3 for f in bin/pg_dotconf.py test/perf_query_io.py ; do g=%{buildroot}%{python3_sitearch}/postgresql/$f # Use correct shebang: sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python3|' $g # Make executable: chmod +x $g done %clean rm -rf $%{buildroot} %files %defattr(-,root,root,-) %doc AUTHORS LICENSE README %{python3_sitearch}/* %changelog * Fri Apr 2 2010 David Malcolm - 1.0.0-1 - initial package