Blame SPECS/python-pytoml.spec

99ecbe
%global project_owner avakar
99ecbe
%global github_name pytoml
99ecbe
%global commit 7dea353c8f02c8d02df1acd72121413823b574cc
99ecbe
%global shortcommit %(c=%{commit}; echo ${c:0:7})
99ecbe
%global sum Parser for TOML
99ecbe
%global desc A parser for TOML-0.4.0
99ecbe
99ecbe
%if 0%{?rhel} > 7 || 0%{?fedora} > 28
99ecbe
# Disable python2 build by default
99ecbe
%bcond_with python2
99ecbe
%else
99ecbe
%bcond_without python2
99ecbe
%endif
99ecbe
99ecbe
# The support for TOML 4 in python-toml is not complete. I (Julien Enselme)
99ecbe
# tried to improve it (I contributed for inline object # support) but the
99ecbe
# upstream maintainer is slow to respond and still hasn't published a
99ecbe
# new version with this support. Furthermore, I find the code hard to read and
99ecbe
# modify. From what I looked at pytoml, it is better written, has a better
99ecbe
# support of toml including edge cases.
99ecbe
99ecbe
# I'd recommend python-pytoml but for some usage, python-toml will do the
99ecbe
# trick just fine (I find it a little easier to use). That's why I'll keep
99ecbe
# maintaining it for the foreseeable future.
99ecbe
99ecbe
Name:           python-%{github_name}
99ecbe
Version:        0.1.14
99ecbe
Release:        5.git%{shortcommit}%{?dist}
99ecbe
Summary:        %{sum}
99ecbe
99ecbe
License:        MIT
99ecbe
# Take source from github since the license file is not provided in pypi release.
99ecbe
URL:            https://github.com/%{project_owner}/%{github_name}
99ecbe
Source0:        https://github.com/%{project_owner}/%{github_name}/archive/%{commit}/%{github_name}-%{commit}.tar.gz
99ecbe
BuildArch:      noarch
99ecbe
99ecbe
%description
99ecbe
%{desc}
99ecbe
99ecbe
99ecbe
%if %{with python2}
99ecbe
%package -n     python2-%{github_name}
99ecbe
BuildArch:      noarch
99ecbe
BuildRequires:  python2-devel
99ecbe
BuildRequires:  python2-setuptools
99ecbe
Summary:        %{sum}
99ecbe
%{?python_provide:%python_provide python2-%{github_name}}
99ecbe
99ecbe
%description -n python2-%{github_name}
99ecbe
%{desc}
99ecbe
%endif # with python2
99ecbe
99ecbe
99ecbe
%package -n     python%{python3_pkgversion}-%{github_name}
99ecbe
Summary:        %{sum}
99ecbe
BuildArch:      noarch
99ecbe
BuildRequires:  python%{python3_pkgversion}-devel
99ecbe
BuildRequires:  python%{python3_pkgversion}-setuptools
99ecbe
%{?python_provide:%python_provide python%{python3_pkgversion}-%{github_name}}
99ecbe
99ecbe
%if %{without python2}
99ecbe
Obsoletes:      python-%{github_name} < %{version}-%{release}
99ecbe
Obsoletes:      python2-%{github_name} < %{version}-%{release}
99ecbe
%endif # without python2
99ecbe
99ecbe
99ecbe
%description -n python%{python3_pkgversion}-%{github_name}
99ecbe
%{desc}
99ecbe
99ecbe
99ecbe
%prep
99ecbe
%setup -qn %{github_name}-%{commit}
99ecbe
99ecbe
99ecbe
%build
99ecbe
%if %{with python2}
99ecbe
%py2_build
99ecbe
%endif # with python2
99ecbe
99ecbe
%py3_build
99ecbe
99ecbe
99ecbe
%install
99ecbe
%py3_install
99ecbe
99ecbe
%if %{with python2}
99ecbe
%py2_install
99ecbe
%endif # with python2
99ecbe
99ecbe
99ecbe
# We cannot run check for now: the README ask to use git submodules, but we
99ecbe
# can't just use git submodules because it requires network access and pull code
99ecbe
# that is not from the package. The good way to do this would be to package the
99ecbe
# go program that include the tests file. It was done for python-toml that rely
99ecbe
# on golang-github-BurntSushi-toml-test. The problem is pytoml cannot pass this
99ecbe
# suite since it is outdated. The maintainer of pytoml uses his own fork of
99ecbe
# golang-github-BurntSushi-toml-test which has no release. So until improvement
99ecbe
# on that side, it's better not to run check within %%check and trust the
99ecbe
# upstream maintainer won't release broken stuff.
99ecbe
99ecbe
99ecbe
%if %{with python2}
99ecbe
%files -n python2-%{github_name}
99ecbe
%doc README.md
99ecbe
%license LICENSE
99ecbe
%{python2_sitelib}/%{github_name}-%{version}*-py%{python2_version}.egg-info/
99ecbe
%{python2_sitelib}/%{github_name}/
99ecbe
%endif # with python2
99ecbe
99ecbe
99ecbe
%files -n python%{python3_pkgversion}-%{github_name}
99ecbe
%doc README.md
99ecbe
%license LICENSE
99ecbe
%{python3_sitelib}/%{github_name}-%{version}*-py%{python3_version}.egg-info/
99ecbe
%{python3_sitelib}/%{github_name}/
99ecbe
99ecbe
99ecbe
%changelog
99ecbe
* Fri Mar 16 2018 Tomas Orsava <torsava@redhat.com> - 0.1.14-5.git7dea353
99ecbe
- Conditionalize the Python 2 subpackage
99ecbe
- Don't build the Python 2 subpackage on EL > 7 and Fedora > 28
99ecbe
99ecbe
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.14-4.git7dea353
99ecbe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
99ecbe
99ecbe
* Sat Jan 27 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.1.14-3.git7dea353
99ecbe
- Update Python 2 dependency declarations to new packaging standards
99ecbe
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
99ecbe
99ecbe
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.14-2.git7dea353
99ecbe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
99ecbe
99ecbe
* Sat Jul 01 2017 Julien Enselme <jujens@jujens.eu> - 0.1.14-1.git7dea353
99ecbe
- Update to 0.1.14
99ecbe
99ecbe
* Mon May 22 2017 Julien Enselme <jujens@jujens.eu> - 0.1.13-1.git270397b
99ecbe
- Update ot 0.1.13
99ecbe
99ecbe
* Thu Apr 13 2017 Julien Enselme <jujens@jujens.eu> - 0.1.12-1.gite4ec5fb
99ecbe
- Update to 0.1.12
99ecbe
99ecbe
* Tue Mar 21 2017 Julien Enselme <jujens@jujens.eu> - 0.1.11-4.git01d900f
99ecbe
- Use %%{python3_pkgversion} to build for epel
99ecbe
- Add a BR to setuptools
99ecbe
99ecbe
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.11-3.git01d900f
99ecbe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
99ecbe
99ecbe
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.1.11-2.git01d900f
99ecbe
- Rebuild for Python 3.6
99ecbe
99ecbe
* Mon Aug 22 2016 Julien Enselme <jujens@jujens.eu> - 0.1.11-1.git01d900f
99ecbe
- Update to 0.1.11
99ecbe
99ecbe
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.10-3.gitd883c7c
99ecbe
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
99ecbe
99ecbe
* Mon Jul 11 2016 Julien Enselme <jujens@jujens.eu> - 0.1.10-2.gitd883c7c
99ecbe
- Add comments to explain why python-toml and python-pytoml exist, why the
99ecbe
  source is taken from github and why the tests are not run for now.
99ecbe
99ecbe
* Thu Jul 07 2016 Julien Enselme <jujens@jujens.eu> - 0.1.10-1.gitd883c7c
99ecbe
- Inital package