ece3571
%if 0%{?fedora}
ece3571
%global with_python3 1
ece3571
%endif
ece3571
ece3571
%{!?_licensedir: %global license %%doc}
ece3571
ece3571
%if 0%{?rhel} && 0%{?rhel} <= 6
ece3571
%{!?__python2:        %global __python2 /usr/bin/python2}
ece3571
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
ece3571
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
ece3571
%endif
ece3571
ece3571
%global modname munch
ece3571
ece3571
Name:               python-munch
ece3571
Version:            2.0.2
567e2d9
Release:            3%{?dist}
ece3571
Summary:            A dot-accessible dictionary (a la JavaScript objects)
ece3571
ece3571
Group:              Development/Libraries
ece3571
License:            MIT
ece3571
URL:                http://pypi.python.org/pypi/munch
ece3571
Source0:            https://pypi.python.org/packages/source/m/%{modname}/%{modname}-%{version}.tar.gz
ece3571
ece3571
BuildArch:          noarch
ece3571
ece3571
BuildRequires:      python2-devel
ece3571
BuildRequires:      python-setuptools
ece3571
ece3571
%if 0%{?with_python3}
ece3571
BuildRequires:      python3-devel
ece3571
BuildRequires:      python3-setuptools
ece3571
%endif
ece3571
ece3571
%description
ece3571
munch is a fork of David Schoonover's **Bunch** package, providing similar
ece3571
functionality. 99% of the work was done by him, and the fork was made
ece3571
mainly for lack of responsiveness for fixes and maintenance on the original
ece3571
code.
ece3571
ece3571
Munch is a dictionary that supports attribute-style access, a la
ece3571
JavaScript.
ece3571
ece3571
%if 0%{?with_python3}
ece3571
%package -n python3-munch
ece3571
Summary:            A dot-accessible dictionary (a la JavaScript objects)
ece3571
Group:              Development/Libraries
ece3571
ece3571
%description -n python3-munch
ece3571
munch is a fork of David Schoonover's **Bunch** package, providing similar
ece3571
functionality. 99% of the work was done by him, and the fork was made
ece3571
mainly for lack of responsiveness for fixes and maintenance on the original
ece3571
code.
ece3571
ece3571
Munch is a dictionary that supports attribute-style access, a la
ece3571
JavaScript.
ece3571
%endif
ece3571
ece3571
%prep
ece3571
%setup -q -n %{modname}-%{version}
ece3571
ece3571
# Remove shebang to make rpmlint happy.
ece3571
sed -i '/\/usr\/bin\/python/d' munch/__init__.py
ece3571
ece3571
# Remove bundled egg-info in case it exists
ece3571
rm -rf %{modname}.egg-info
ece3571
%if 0%{?with_python3}
ece3571
rm -rf %{py3dir}
ece3571
cp -a . %{py3dir}
ece3571
%endif
ece3571
ece3571
%build
ece3571
%{__python2} setup.py build
ece3571
%if 0%{?with_python3}
ece3571
pushd %{py3dir}
ece3571
%{__python3} setup.py build
ece3571
popd
ece3571
%endif
ece3571
ece3571
%install
ece3571
%if 0%{?with_python3}
ece3571
pushd %{py3dir}
ece3571
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
ece3571
popd
ece3571
%endif
ece3571
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
ece3571
ece3571
%files
ece3571
%doc README.md
ece3571
%license LICENSE.txt
ece3571
%{python2_sitelib}/%{modname}/
ece3571
%{python2_sitelib}/%{modname}-%{version}*
ece3571
ece3571
%if 0%{?with_python3}
ece3571
%files -n python3-munch
ece3571
%doc README.md
ece3571
%license LICENSE.txt
ece3571
%{python3_sitelib}/%{modname}/
ece3571
%{python3_sitelib}/%{modname}-%{version}*
ece3571
%endif
ece3571
ece3571
%changelog
567e2d9
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-3
567e2d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
567e2d9
ece3571
* Sun Apr 12 2015 Ralph Bean <rbean@redhat.com> - 2.0.2-2
ece3571
- Remove shebang to make rpmlint happy.
ece3571
ece3571
* Sat Apr 11 2015 Ralph Bean <rbean@redhat.com> - 2.0.2-1
ece3571
- Initial package for Fedora