From 00ce3baf6d955829814edc1fe1d5b3bc033c2263 Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Jan 27 2015 13:23:06 +0000 Subject: initial --- diff --git a/.gitignore b/.gitignore index e69de29..1495091 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/testing.postgresql-1.1.0.tar.gz diff --git a/python-testing.postgresql.spec b/python-testing.postgresql.spec new file mode 100644 index 0000000..38a49b0 --- /dev/null +++ b/python-testing.postgresql.spec @@ -0,0 +1,106 @@ +# Created by pyp2rpm-1.1.1 +%global pypi_name testing.postgresql +%global with_python3 1 + +Name: python-%{pypi_name} +Version: 1.1.0 +Release: 1%{?dist} +Summary: Automatically setup a PostgreSQL testing instance + +License: ASL 2.0 +URL: http://bitbucket.org/tk0miya/testing.postgresql +Source0: https://pypi.python.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +BuildArch: noarch + +BuildRequires: python-devel +BuildRequires: python-nose +BuildRequires: python-psycopg2 +BuildRequires: postgresql-server + +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-nose +BuildRequires: python3-psycopg2 +%endif + +Requires: python-psycopg2 +Requires: postgresql-server + +%description +testing.PostgreSQL automatically setups a PostgreSQL instance +in a temporary directory, and destroys it after testing. + +%if 0%{?with_python3} +%package -n python3-%{pypi_name} +Summary: Automatically setup a PostgreSQL testing instance + +Requires: python3-psycopg2 + +%description -n python3-%{pypi_name} +testing.PostgreSQL automatically setups a PostgreSQL instance +in a temporary directory, and destroys it after testing. +%endif + +%prep +%setup -q -n %{pypi_name}-%{version} +# Remove bundled egg-info +rm -rf %{pypi_name}.egg-info + + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif + +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + + +%install +# Must do the subpackages' install first because the scripts in /usr/bin are +# overwritten with every setup.py install (and we want the python2 version +# to be the default for now). +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +popd +%endif + +%{__python2} setup.py install --skip-build --root %{buildroot} + + +%check +%{__python2} setup.py test + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py test +popd +%endif + + +%files +%doc README.rst LICENSE +%{python2_sitelib}/testing +%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info + +%if 0%{?with_python3} +%files -n python3-%{pypi_name} +%doc README.rst LICENSE +%{python3_sitelib}/testing +%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%endif + + +%changelog +* Thu Jan 08 2015 Richard Marko - 1.1.0-1 +- Initial package diff --git a/sources b/sources index e69de29..ffc1898 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +08355f834f47cf7c8344175eef1646c0 testing.postgresql-1.1.0.tar.gz