46e8345
%if 0%{?rhel} && 0%{?rhel} <= 7
46e8345
%bcond_with python3
46e8345
%if 0%{?rhel} <= 6
8778f5f
%{!?python2_version: %global python2_version %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3])")}
46e8345
%{!?_licensedir:%global license %%doc}
a00bcfe
%endif
46e8345
%else
46e8345
%bcond_without python3
a00bcfe
%endif
a00bcfe
46e8345
%bcond_without tests
8778f5f
46e8345
%global srcname dockerfile-parse
46e8345
%global modname %(n=%{srcname}; echo ${n//-/_})
a00bcfe
46e8345
Name:           python-%{srcname}
a6718ca
Version:        0.0.11
7321716
Release:        4%{?dist}
a00bcfe
a00bcfe
Summary:        Python library for Dockerfile manipulation
a00bcfe
License:        BSD
46e8345
URL:            https://github.com/DBuildService/dockerfile-parse
46e8345
Source0:        %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
a00bcfe
a00bcfe
BuildArch:      noarch
a00bcfe
46e8345
%description
46e8345
%{summary}.
46e8345
46e8345
%package -n python2-%{srcname}
46e8345
Summary:        %{summary}
46e8345
%{?python_provide:%python_provide python2-%{srcname}}
a00bcfe
BuildRequires:  python2-devel
46e8345
%if 0%{?rhel} && 0%{?rhel} <= 7
a00bcfe
BuildRequires:  python-setuptools
8778f5f
BuildRequires:  pytest
46e8345
%else
46e8345
BuildRequires:  python2-setuptools
46e8345
BuildRequires:  python2-pytest
f4616fc
BuildRequires:  python2-six
46e8345
%endif
19ba077
Requires:  python2-six
8778f5f
46e8345
%description -n python2-%{srcname}
46e8345
%{summary}.
a00bcfe
46e8345
Python 2 version.
46e8345
46e8345
%if %{with python3}
46e8345
%package -n python3-%{srcname}
46e8345
Summary:        %{summary}
46e8345
%{?python_provide:%python_provide python3-%{srcname}}
a00bcfe
BuildRequires:  python3-devel
a00bcfe
BuildRequires:  python3-setuptools
46e8345
%if %{with tests}
8778f5f
BuildRequires:  python3-pytest
f4616fc
BuildRequires:  python3-six
46e8345
%endif
19ba077
Requires:  python3-six
a00bcfe
46e8345
%description -n python3-%{srcname}
46e8345
%{summary}.
a00bcfe
46e8345
Python 3 version.
46e8345
%endif
a00bcfe
a00bcfe
%prep
2ed479a
%setup -n %{srcname}-%{version}
2ed479a
a00bcfe
a00bcfe
%build
46e8345
%py2_build
46e8345
%if %{with python3}
46e8345
%py3_build
46e8345
%endif
a00bcfe
a00bcfe
%install
46e8345
%py2_install
46e8345
%if %{with python3}
46e8345
%py3_install
46e8345
%endif
a00bcfe
46e8345
%if %{with tests}
8778f5f
%check
46e8345
export LANG=C.UTF-8
46e8345
py.test-%{python2_version} -v tests
46e8345
%if %{with python3}
46e8345
py.test-%{python3_version} -v tests
46e8345
%endif
46e8345
%endif
a00bcfe
46e8345
%files -n python2-%{srcname}
a00bcfe
%license LICENSE
a00bcfe
%doc README.md
46e8345
%{python2_sitelib}/%{modname}-*.egg-info/
46e8345
%{python2_sitelib}/%{modname}/
46e8345
46e8345
%if %{with python3}
46e8345
%files -n python3-%{srcname}
a00bcfe
%license LICENSE
46e8345
%doc README.md
46e8345
%{python3_sitelib}/%{modname}-*.egg-info/
46e8345
%{python3_sitelib}/%{modname}/
46e8345
%endif
a00bcfe
a00bcfe
%changelog
7321716
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.11-4
7321716
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
7321716
19ba077
* Mon Jul 16 2018 Tim Waugh <twaugh@redhat.com> - 0.0.11-3
19ba077
- Require six
19ba077
417503c
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.11-2
417503c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
417503c
a6718ca
* Thu Jul 12 2018 Tim Waugh <twaugh@redhat.com> - 0.0.11-1
a6718ca
- New upstream release 0.0.11
a6718ca
cb567e6
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.0.10-2
cb567e6
- Rebuilt for Python 3.7
cb567e6
5c9d7c7
* Thu Apr 19 2018 Tomas Tomecek <ttomecek@redhat.com> - 0.0.10-1
5c9d7c7
- New upstream release 0.0.10
5c9d7c7
ef05861
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.7-2
ef05861
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ef05861
3834e24
* Thu Oct 05 2017 Tomas Tomecek <ttomecek@redhat.com> - 0.0.7-1
3834e24
- new upstream release: 0.0.7
3834e24
a594dc7
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-10
a594dc7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
a594dc7
dd1c130
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-9
dd1c130
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
dd1c130
76e37ed
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.0.5-8
76e37ed
- Rebuild for Python 3.6
76e37ed
2ed479a
* Tue Dec 06 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.0.5-7
2ed479a
- Patch to handle inheriting parent Dockerfile ENVs
2ed479a
46e8345
* Wed Sep 07 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.0.5-6
46e8345
- Modernize spec
46e8345
- Trivial fixes
46e8345
40d3fe7
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.5-5
40d3fe7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
40d3fe7
25f12ae
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.5-4
25f12ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
25f12ae
e936c1e
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.5-3
e936c1e
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
e936c1e
8778f5f
* Fri Nov 06 2015 Jiri Popelka <jpopelka@redhat.com> - 0.0.5-2
8778f5f
- %%check section
8778f5f
5660952
* Mon Sep 21 2015 Jiri Popelka <jpopelka@redhat.com> - 0.0.5-1
5660952
- 0.0.5
5660952
721670d
* Thu Aug 27 2015 Jiri Popelka <jpopelka@redhat.com> - 0.0.4-1
721670d
- 0.0.4
721670d
a00bcfe
* Tue Jun 30 2015 Jiri Popelka <jpopelka@redhat.com> - 0.0.3-2
a00bcfe
- define macros for RHEL-6
a00bcfe
a00bcfe
* Fri Jun 26 2015 Jiri Popelka <jpopelka@redhat.com> - 0.0.3-1
a00bcfe
- 0.0.3
a00bcfe
a00bcfe
* Fri Jun 26 2015 Jiri Popelka <jpopelka@redhat.com> - 0.0.2-1
a00bcfe
- 0.0.2
a00bcfe
a00bcfe
* Thu Jun 18 2015 Jiri Popelka <jpopelka@redhat.com> - 0.0.1-1
a00bcfe
- initial release