8a4d93a
# https://fedoraproject.org/wiki/Packaging:DistTag?rd=Packaging/DistTag#Conditionals
8a4d93a
# http://rpm.org/user_doc/conditional_builds.html
8a4d93a
%if 0%{?fedora} >= 30
8a4d93a
# disabled by default
8a4d93a
%bcond_with py2
8a4d93a
%else
8a4d93a
%bcond_without py2
8a4d93a
%endif
8a4d93a
8a4d93a
# Upstream does not use tags, so I'm using the commit that released this
8a4d93a
# version
f31648a
%global commit d1893e5ef37da6850f50d45476ac207b9c7bfc75
8a4d93a
%global shortcommit %(c=%{commit}; echo ${c:0:7})
8a4d93a
8a4d93a
%bcond_without tests
8a4d93a
8a4d93a
%global srcname pymatreader
8a4d93a
8a4d93a
%global desc %{expand: \
8a4d93a
A Python module to read Matlab files. This module works with both the old (<
8a4d93a
7.3) and the new (>= 7.3) HDF5 based format. The output should be the same for
8a4d93a
both kinds of files.
8a4d93a
8a4d93a
Documentation can be found here: http://pymatreader.readthedocs.io/en/latest/}
8a4d93a
8a4d93a
Name:           python-%{srcname}
f31648a
Version:        0.0.19
f31648a
Release:        1%{?dist}
8a4d93a
Summary:        Convenient reader for Matlab mat files
8a4d93a
8a4d93a
License:        BSD
8a4d93a
URL:            https://pypi.python.org/pypi/%{srcname}
8a4d93a
Source0:        https://gitlab.com/obob/%{srcname}/-/archive/%{commit}/%{srcname}-%{shortcommit}.tar.gz
8a4d93a
8a4d93a
BuildArch:      noarch
8a4d93a
8a4d93a
%{?python_enable_dependency_generator}
8a4d93a
8a4d93a
%description
8a4d93a
%{desc}
8a4d93a
8a4d93a
%if %{with py2}
8a4d93a
%package -n python2-%{srcname}
8a4d93a
Summary:        %{summary}
8a4d93a
BuildRequires:  python2-devel
8a4d93a
BuildRequires:  %{py2_dist scipy}
8a4d93a
BuildRequires:  %{py2_dist numpy}
8a4d93a
BuildRequires:  %{py2_dist nose}
8a4d93a
BuildRequires:  %{py2_dist xmltodict}
8a4d93a
BuildRequires:  %{py2_dist h5py}
8a4d93a
BuildRequires:  %{py2_dist twine}
8a4d93a
BuildRequires:  %{py2_dist future}
8a4d93a
BuildRequires:  %{py2_dist wheel}
8a4d93a
%{?python_provide:%python_provide python2-%{srcname}}
8a4d93a
8a4d93a
%description -n python2-%{srcname}
8a4d93a
%{desc}
8a4d93a
%endif
8a4d93a
8a4d93a
%package -n python3-%{srcname}
8a4d93a
Summary:        %{summary}
8a4d93a
BuildRequires:  python3-devel
8a4d93a
BuildRequires:  %{py3_dist sphinx}
8a4d93a
BuildRequires:  %{py3_dist sphinx_rtd_theme}
8a4d93a
BuildRequires:  %{py3_dist scipy}
8a4d93a
BuildRequires:  %{py3_dist numpy}
8a4d93a
BuildRequires:  %{py3_dist nose}
8a4d93a
BuildRequires:  %{py3_dist xmltodict}
8a4d93a
BuildRequires:  %{py3_dist h5py}
8a4d93a
BuildRequires:  %{py3_dist twine}
8a4d93a
BuildRequires:  %{py3_dist future}
8a4d93a
BuildRequires:  %{py3_dist wheel}
8a4d93a
%{?python_provide:%python_provide python3-%{srcname}}
8a4d93a
8a4d93a
%description -n python3-%{srcname}
8a4d93a
%{desc}
8a4d93a
8a4d93a
%package doc
8a4d93a
Summary:        %{summary}
8a4d93a
8a4d93a
%description doc
8a4d93a
Documentation for %{name}.
8a4d93a
8a4d93a
%prep
8a4d93a
%autosetup -n %{srcname}-%{commit}
8a4d93a
rm -rf %{srcname}.egg-info
8a4d93a
8a4d93a
%build
8a4d93a
%py3_build
8a4d93a
8a4d93a
%if %{with py2}
8a4d93a
%py2_build
8a4d93a
%endif
8a4d93a
8a4d93a
pushd doc
8a4d93a
    make SPHINXBUILD=sphinx-build-3 html
8a4d93a
    rm -rf build/html/.doctrees
8a4d93a
    rm -rf build/html/.buildinfo
8a4d93a
    # conver to utf8
8a4d93a
    pushd build/html
8a4d93a
        iconv --from=ISO-8859-1 --to=UTF-8 objects.inv > objects.inv.new && \
8a4d93a
        touch -r objects.inv objects.inv.new && \
8a4d93a
        mv objects.inv.new objects.inv
8a4d93a
    popd
8a4d93a
popd
8a4d93a
8a4d93a
%install
8a4d93a
%if %{with py2}
8a4d93a
%py2_install
8a4d93a
%endif
8a4d93a
8a4d93a
%py3_install
8a4d93a
8a4d93a
%check
8a4d93a
%if %{with tests}
8a4d93a
%if %{with py2}
8a4d93a
nosetests-%{python2_version}
8a4d93a
%endif
8a4d93a
nosetests-%{python3_version}
8a4d93a
%endif
8a4d93a
8a4d93a
%if %{with py2}
8a4d93a
%files -n python2-%{srcname}
8a4d93a
%license LICENSE
8a4d93a
%doc README.md
8a4d93a
%{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info
8a4d93a
%{python2_sitelib}/%{srcname}
8a4d93a
%endif
8a4d93a
8a4d93a
%files -n python3-%{srcname}
8a4d93a
%license LICENSE
8a4d93a
%doc README.md
8a4d93a
%{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info
8a4d93a
%{python3_sitelib}/%{srcname}
8a4d93a
8a4d93a
%files doc
8a4d93a
%license LICENSE
8a4d93a
%doc doc/build/html
8a4d93a
8a4d93a
%changelog
f31648a
* Mon Apr 08 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.0.19-1
f31648a
- Update to latest upstream release 0.0.19
f31648a
a6512d7
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.17-2
a6512d7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
a6512d7
8a4d93a
* Tue Nov 20 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.0.17-1
8a4d93a
- Initial build