[pyp2rpm] Initial package.

Bohuslav Kabrda bkabrda at fedoraproject.org
Tue Jun 19 14:03:40 UTC 2012


commit df72b1549977325c8f18e7672342c258fe63a6f3
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Tue Jun 19 16:03:37 2012 +0200

    Initial package.

 .gitignore   |    2 +
 pyp2rpm.spec |  132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources      |    2 +
 3 files changed, 136 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..ddd3757 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/pyp2rpm-0.5.1-tests.tgz
+/pyp2rpm-0.5.1.tar.gz
diff --git a/pyp2rpm.spec b/pyp2rpm.spec
new file mode 100644
index 0000000..556434e
--- /dev/null
+++ b/pyp2rpm.spec
@@ -0,0 +1,132 @@
+# Created by pyp2rpm-0.5.1
+%global pypi_name pyp2rpm
+%global with_python3 1
+
+Name:           %{pypi_name}
+Version:        0.5.1
+Release:        1%{?dist}
+Summary:        Convert Python packages to RPM SPECFILES
+
+License:        MIT
+URL:            http://pypi.python.org/pypi/pyp2rpm/0.5.1
+Source0:        http://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
+# to get tests:
+# git clone git at bitbucket.org:bkabrda/pyp2rpm.git && cd pyp2rpm
+# git checkout v0.5.1 && tar czf pyp2rpm-0.5.1-tests.tgz tests/
+Source1:        %{name}-%{version}-tests.tgz
+BuildArch:      noarch
+ 
+BuildRequires:  python-devel
+BuildRequires:  pytest
+BuildRequires:  python-flexmock >= 0.9.3
+BuildRequires:  python-jinja2
+BuildRequires:  python-setuptools
+ 
+%if %{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-pytest
+BuildRequires:  python3-flexmock >= 0.9.3
+BuildRequires:  python3-jinja2
+BuildRequires:  python3-setuptools
+%endif # if with_python3
+ 
+Requires:       python-jinja2
+Requires:       python-setuptools
+ 
+%if %{?with_python3}
+Requires:       python3-jinja2
+Requires:       python3-setuptools
+%endif # if with_python3
+
+%description
+Convert Python packages to RPM SPECFILES. The packages can be downloaded from
+PyPI and the produced SPEC is in line with Fedora Packaging Guidelines.
+
+Users can provide their own templates for rendering the package metadata. Both
+the package source and metadata can be extracted from PyPI or from local
+filesystem (local file doesn't provide that much information though).
+
+%if 0%{?with_python3}
+%package -n     python3-%{pypi_name}
+Summary:        Convert Python packages to RPM SPECFILES
+
+%description -n python3-%{pypi_name}
+Convert Python packages to RPM SPECFILES. The packages can be downloaded from
+PyPI and the produced SPEC is in line with Fedora Packaging Guidelines.
+
+Users
+can provide their own templates for rendering the package metadata. Both the
+package
+source and metadata can be extracted from PyPI or from local filesystem
+(local file doesn't
+provide that much information though).
+%endif # with_python3
+
+
+%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 # with_python3
+
+
+%build
+%{__python} setup.py build
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
+
+
+%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}
+mv %{buildroot}%{_bindir}/pyp2rpm %{buildroot}/%{_bindir}/python3-pyp2rpm
+popd
+%endif # with_python3
+
+%{__python} setup.py install --skip-build --root %{buildroot}
+
+
+%check
+tar xzf %{SOURCE1}
+PYTHONPATH=$(pwd) py.test
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+tar xzf %{SOURCE1}
+PYTHONPATH=$(pwd) py.test-3.2
+popd
+%endif
+
+
+%files
+%doc README.rst LICENSE
+%{_bindir}/pyp2rpm
+%{python_sitelib}/%{pypi_name}lib
+%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+%if 0%{?with_python3}
+%files -n python3-%{pypi_name}
+%doc README.rst LICENSE
+%{_bindir}/python3-pyp2rpm
+%{python3_sitelib}/%{pypi_name}lib
+%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+%endif # with_python3
+
+
+%changelog
+* Mon Jun 18 2012 Bohuslav Kabrda <bkabrda at redhat.com> - 0.5.1-1
+- Initial package.
diff --git a/sources b/sources
index e69de29..c430b83 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+cb908357a378a7575a4a9681dc184b02  pyp2rpm-0.5.1-tests.tgz
+86e7140838cbe4cddd86af5fdfe1b431  pyp2rpm-0.5.1.tar.gz


More information about the scm-commits mailing list