From e6f5c70610d44da80352af5c0f861e9bfb264464 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 23 May 2016 17:04:44 +0200 Subject: [PATCH] Initial import (#1335965) --- .gitignore | 1 + py3c.spec | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 95 insertions(+) create mode 100644 py3c.spec diff --git a/.gitignore b/.gitignore index e69de29..6c88476 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/py3c-0.6.tar.gz diff --git a/py3c.spec b/py3c.spec new file mode 100644 index 0000000..c2c36cf --- /dev/null +++ b/py3c.spec @@ -0,0 +1,93 @@ +# A header-only library has no debuginfo +%global debug_package %{nil} + +Name: py3c +Version: 0.6 +Release: 2%{?dist} +Summary: Guide and compatibility macros for porting extensions to Python 3 + +# Licences differ for subpackages +License: MIT and CC-BY-SA + +URL: http://py3c.readthedocs.io/ + +Source0: https://github.com/encukou/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz + +BuildRequires: python2-devel +BuildRequires: python3-devel +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx_rtd_theme + +%description +py3c helps you port C extensions to Python 3. + +It provides a detailed guide, and a set of macros to make porting easy +and reduce boilerplate. + +%package devel +License: MIT +Summary: Header files for py3c + +# Do not *require* python?-devel, because some projects can drop support +# for one of the Python versions, but still use the compat macros. +Suggests: python2-devel +Suggests: python3-devel + +# A header-only library counts as static +Provides: %{name}-static = %{version}-%{release} +%{?_isa:Provides: %{name}-static%{?_isa} = %{version}-%{release}} + +%description devel +%{name}-devel is only required for building software that uses py3c. +Because py3c is a header-only library, there is no matching run-time package. + +%package doc +BuildArch: noarch +License: CC-BY-SA +Summary: Guide for porting C extensions to Python 3 + +Requires: python3-sphinx_rtd_theme + +%description doc +Guide for porting CPython extensions from Python 2 to Python 3, using the +py3c macros. + +%prep +%setup -q + +%build +make %{?_smp_mflags} py3c.pc includedir=%{_includedir} + +make %{?_smp_mflags} doc SPHINXBUILD=sphinx-build-3 + +# unbundle fonts provided by the theme package +bundledfonts=doc/build/html/_static/fonts +themefonts=%{python3_sitelib}/sphinx_rtd_theme/static/fonts +diff -r $bundledfonts $themefonts +rm -rv $bundledfonts +ln -s $themefonts $bundledfonts + +%check +export CFLAGS="%{optflags}" +make %{?_smp_mflags} test-python +make %{?_smp_mflags} test-python3 + +%install +make install prefix=%{buildroot}%{_prefix} includedir=%{buildroot}%{_includedir} +mkdir -p %{buildroot}%{_pkgdocdir} +cp -rv doc/build/html/* %{buildroot}%{_pkgdocdir} + +%files devel +%license LICENSE.MIT +%doc README.rst +%{_includedir}/py3c.h +%{_includedir}/py3c/ +%{_datadir}/pkgconfig/py3c.pc + +%files doc +%license doc/LICENSE.CC-BY-SA-3.0 +%doc %{_pkgdocdir}/ + +%changelog +* Thu May 19 2016 Petr Viktorin - 0.6-2 +- Initial package diff --git a/sources b/sources index e69de29..0198aad 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +8d961477c00ebe4be19398ee4602946b py3c-0.6.tar.gz