|
Stanislav Ochotnicky |
5340182 |
%if 0%{?fedora} > 12
|
|
Stanislav Ochotnicky |
5340182 |
%global with_python3 1
|
|
Stanislav Ochotnicky |
5340182 |
%else
|
|
Stanislav Ochotnicky |
5340182 |
%{!?__python2: %global __python2 /usr/bin/python2}
|
|
Stanislav Ochotnicky |
5340182 |
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
|
|
Stanislav Ochotnicky |
5340182 |
%endif
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
2781098 |
%global microv 70
|
|
Stanislav Ochotnicky |
2781098 |
|
|
Stanislav Ochotnicky |
5340182 |
Name: python-dpath
|
|
Stanislav Ochotnicky |
5340182 |
Version: 1.2
|
|
|
9c0aab2 |
Release: 0.4.%{microv}%{?dist}
|
|
Stanislav Ochotnicky |
5340182 |
Summary: A library for searching dictionaries using XPath-like expressions
|
|
Stanislav Ochotnicky |
5340182 |
License: MIT
|
|
Stanislav Ochotnicky |
5340182 |
URL: https://github.com/akesterson/dpath-python
|
|
Stanislav Ochotnicky |
5340182 |
BuildArch: noarch
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
2781098 |
Source0: https://pypi.python.org/packages/source/d/dpath/dpath-%{version}-%{microv}.tar.gz
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
BuildRequires: python2-devel
|
|
Stanislav Ochotnicky |
5340182 |
BuildRequires: python-setuptools
|
|
Stanislav Ochotnicky |
5340182 |
%if 0%{?with_python3}
|
|
Stanislav Ochotnicky |
5340182 |
BuildRequires: python3-devel
|
|
Stanislav Ochotnicky |
5340182 |
BuildRequires: python3-setuptools
|
|
Stanislav Ochotnicky |
5340182 |
%endif # if with_python3
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%description
|
|
Stanislav Ochotnicky |
5340182 |
A python library for accessing and searching dictionaries via /slashed/paths ala
|
|
Stanislav Ochotnicky |
5340182 |
xpath
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
Basically it lets you glob over a dictionary as if it were a filesystem. It
|
|
Stanislav Ochotnicky |
5340182 |
allows you to specify globs (ala the bash eglob syntax, through some advanced
|
|
Stanislav Ochotnicky |
5340182 |
fnmatch.fnmatch magic) to access dictionary elements, and provides some facility
|
|
Stanislav Ochotnicky |
5340182 |
for filtering those results.
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%package -n python3-dpath
|
|
Stanislav Ochotnicky |
5340182 |
Summary: A python3 library for searching dictionaries using XPath-like expressions
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%description -n python3-dpath
|
|
Stanislav Ochotnicky |
5340182 |
A python library for accessing and searching dictionaries via /slashed/paths ala
|
|
Stanislav Ochotnicky |
5340182 |
xpath
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
Basically it lets you glob over a dictionary as if it were a filesystem. It
|
|
Stanislav Ochotnicky |
5340182 |
allows you to specify globs (ala the bash eglob syntax, through some advanced
|
|
Stanislav Ochotnicky |
5340182 |
fnmatch.fnmatch magic) to access dictionary elements, and provides some facility
|
|
Stanislav Ochotnicky |
5340182 |
for filtering those results.
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%prep
|
|
Stanislav Ochotnicky |
2781098 |
%setup -q -n dpath-%{version}-%{microv}
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%if 0%{?with_python3}
|
|
Stanislav Ochotnicky |
5340182 |
rm -rf %{py3dir}
|
|
Stanislav Ochotnicky |
5340182 |
cp -a . %{py3dir}
|
|
Stanislav Ochotnicky |
5340182 |
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
|
Stanislav Ochotnicky |
5340182 |
%endif # with_python3
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%build
|
|
Stanislav Ochotnicky |
5340182 |
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%if 0%{?with_python3}
|
|
Stanislav Ochotnicky |
5340182 |
pushd %{py3dir}
|
|
Stanislav Ochotnicky |
5340182 |
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
|
Stanislav Ochotnicky |
5340182 |
popd
|
|
Stanislav Ochotnicky |
5340182 |
%endif # with_python3
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%install
|
|
Stanislav Ochotnicky |
5340182 |
# Must do the python3 install first because the scripts in /usr/bin are
|
|
Stanislav Ochotnicky |
5340182 |
# overwritten with every setup.py install (and we want the python2 version
|
|
Stanislav Ochotnicky |
5340182 |
# to be the default for now).
|
|
Stanislav Ochotnicky |
5340182 |
%if 0%{?with_python3}
|
|
Stanislav Ochotnicky |
5340182 |
pushd %{py3dir}
|
|
Stanislav Ochotnicky |
5340182 |
%{__python3} setup.py install --skip-build --root %{buildroot}
|
|
Stanislav Ochotnicky |
5340182 |
popd
|
|
Stanislav Ochotnicky |
5340182 |
%endif # with_python3
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%{__python} setup.py install --skip-build --root %{buildroot}
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%files
|
|
Stanislav Ochotnicky |
5340182 |
%doc LICENSE.txt README.md
|
|
Stanislav Ochotnicky |
5340182 |
%{python_sitelib}/dpath*
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%if 0%{?with_python3}
|
|
Stanislav Ochotnicky |
5340182 |
%files -n python3-dpath
|
|
Stanislav Ochotnicky |
5340182 |
%doc LICENSE.txt README.md
|
|
Stanislav Ochotnicky |
5340182 |
%{python3_sitelib}/dpath*
|
|
Stanislav Ochotnicky |
5340182 |
%endif # with_python3
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
|
|
Stanislav Ochotnicky |
5340182 |
%changelog
|
|
|
9c0aab2 |
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-0.4.70
|
|
|
9c0aab2 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
|
|
9c0aab2 |
|
|
|
469d77a |
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.2-0.3.70
|
|
|
469d77a |
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
|
|
|
469d77a |
|
|
Stanislav Ochotnicky |
2781098 |
* Mon Apr 07 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.2-0.2.70
|
|
Stanislav Ochotnicky |
2781098 |
- Update to new upstream version
|
|
Stanislav Ochotnicky |
2781098 |
|
|
Stanislav Ochotnicky |
5340182 |
* Wed Mar 19 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.2-0.1.52.20140319gita6ce774d
|
|
Stanislav Ochotnicky |
5340182 |
- Initial packaging
|
|
Stanislav Ochotnicky |
5340182 |
|