Blame python-lfpy.spec

c2f4161
%global pypi_name lfpy
92f01a0
%global pretty_name LFPy
eef1ec8
eef1ec8
%global desc %{expand: \
eef1ec8
LFPy is a Python-module for calculation of extracellular potentials from
eef1ec8
multi-compartment neuron models. It relies on the NEURON simulator ( and uses
eef1ec8
the Python interface ( it provides.LFPy provides a set of easy-to-use Python
eef1ec8
classes for setting up your model, running your simulations and calculating the
eef1ec8
extracellular potentials arising from activity in your model neuron. If you
eef1ec8
have a model...}
eef1ec8
eef1ec8
%global py_version python3-
3608ae5
%global py_dist python3.8dist
eef1ec8
eef1ec8
c2f4161
Name:           python-lfpy
c2f4161
Version:        2.0.7
8aa4dd9
Release:        5%{?dist}
92f01a0
Summary:        Model extracellular potentials of multicompartment neuron models built on NEURON
c2f4161
c2f4161
License:        GPLv3
c2f4161
URL:            http://LFPy.readthedocs.io
92f01a0
Source0:        %{pypi_source %pretty_name}
c2f4161
1c83310
# Requires NEURON, so limited to arches that NEURON and Random123 support
1c83310
ExcludeArch:    mips64r2 mips32r2 s390
8aa4dd9
# Upstream does not support powerpc or 32bit arches
8aa4dd9
# https://github.com/LFPy/LFPy/issues/173
8aa4dd9
# Bug: ppc: https://bugzilla.redhat.com/show_bug.cgi?id=1838565
8aa4dd9
# Bug: armv7hl: https://bugzilla.redhat.com/show_bug.cgi?id=1838564
8aa4dd9
ExcludeArch:    %{power64} %{ix86} armv7hl
1c83310
eef1ec8
eef1ec8
%?python_enable_dependency_generator
eef1ec8
6df7c5e
BuildRequires:  gcc
92f01a0
BuildRequires:  libtool
92f01a0
BuildRequires:  readline-devel
92f01a0
BuildRequires:  ncurses-devel
92f01a0
BuildRequires:  python3-devel
92f01a0
BuildRequires:  %{py3_dist cython}
92f01a0
BuildRequires:  %{py3_dist h5py}
92f01a0
BuildRequires:  %{py3_dist neuron}
92f01a0
BuildRequires:  neuron-devel
92f01a0
BuildRequires:  %{py3_dist pytest}
92f01a0
BuildRequires:  %{py3_dist numpy}
92f01a0
BuildRequires:  %{py3_dist scipy}
92f01a0
BuildRequires:  %{py3_dist setuptools}
92f01a0
92f01a0
BuildRequires:  python3-mpi4py-openmpi
92f01a0
BuildRequires:  python3-mpi4py-mpich
92f01a0
BuildRequires:  mpich-devel
92f01a0
BuildRequires:  openmpi-devel
92f01a0
BuildRequires:  rpm-mpi-hooks
eef1ec8
eef1ec8
%description
eef1ec8
%{desc}
eef1ec8
c2f4161
92f01a0
%package -n     python3-%{pypi_name}
c2f4161
Summary:        %{summary}
c1c0a98
92f01a0
%description -n python3-%{pypi_name}
eef1ec8
%{desc}
eef1ec8
92f01a0
%{?python_provide:%python_provide python3-%{pypi_name}}
92f01a0
92f01a0
Requires:   %{py3_dist h5py}
92f01a0
Requires:   %{py3_dist numpy}
92f01a0
Requires:   %{py3_dist scipy}
92f01a0
Requires:   %{py3_dist neuron}
92f01a0
Requires:   python3-mpi4py-openmpi
92f01a0
Requires:   python3-mpi4py-mpich
c2f4161
eef1ec8
%prep
92f01a0
%autosetup -n %{pretty_name}-%{version}
eef1ec8
# Remove bundled egg-info
92f01a0
rm -rf %{pretty_name}.egg-info
eef1ec8
c1c0a98
# Remove mpi4py from requirements
c1c0a98
sed -i '/mpi4py/ d' setup.py
eef1ec8
eef1ec8
for lib in $(find . -type f -name "*.py"); do
eef1ec8
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
eef1ec8
 touch -r $lib $lib.new &&
eef1ec8
 mv $lib.new $lib
eef1ec8
done
eef1ec8
eef1ec8
%build
eef1ec8
%py3_build
eef1ec8
eef1ec8
%install
eef1ec8
%py3_install
eef1ec8
c2f4161
92f01a0
%check
92f01a0
# https://github.com/LFPy/LFPy/blob/master/continuous_integration/test_script.sh#L16
92f01a0
%{_mpich_load}
8aa4dd9
pytest-%{python3_version} LFPy/test/test*py
92f01a0
%{_mpich_unload}
eef1ec8
92f01a0
%{_openmpi_load}
8aa4dd9
pytest-%{python3_version} LFPy/test/test*py
92f01a0
%{_openmpi_unload}
eef1ec8
c2f4161
92f01a0
# Remove unneeded test files: they include objects and libraries generated from neuron.
92f01a0
rm -rf %{buildroot}/%{python3_sitearch}/%{pretty_name}/test/
92f01a0
# Remove associated debuginfo files
92f01a0
rm -rf %{buildroot}/usr/lib/debug/%{python3_sitearch}/%{pretty_name}/test/
92f01a0
92f01a0
92f01a0
%files -n python3-%{pypi_name}
eef1ec8
%license LICENSE
eef1ec8
%doc README.md
92f01a0
%{python3_sitearch}/%{pretty_name}
92f01a0
%{python3_sitearch}/%{pretty_name}-%{version}-py%{python3_version}.egg-info
eef1ec8
eef1ec8
%changelog
8aa4dd9
* Thu May 21 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.7-5
8aa4dd9
- Re-enable tests
8aa4dd9
- Add arches that we cannot build on
8aa4dd9
- List bugs for for ExcludeArch
8aa4dd9
1c83310
* Thu May 21 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.7-4
1c83310
- Update supported architectures
1c83310
92f01a0
* Wed May 13 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.7-3
92f01a0
- Cosmetic changes to spec
92f01a0
- Add missing Requires/BR on neuron
92f01a0
- Enable test
92f01a0
- List supported arches
92f01a0
- Remove unneeded test files
92f01a0
c1c0a98
* Wed May 13 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.0.7-2
c1c0a98
- Remove auto-generated mpi4py requires, we use explicitly mention the necessary packages in Requires
c1c0a98
6fd2c4b
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-8
6fd2c4b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
6fd2c4b
e90e61e
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0.3-7
e90e61e
- Rebuilt for Python 3.8.0rc1 (#1748018)
e90e61e
d3cc39f
* Sat Aug 31 2019 Luis Bazan <lbazan@fedoraproject.org> - 2.0.3-6
d3cc39f
- fix typos in spec
d3cc39f
8239d0e
* Mon Aug 26 2019 Luis Bazan <lbazan@fedoraproject.org> - 2.0.3-5
8239d0e
- fix comment #14 BZ #1727491
8239d0e
bbc5042
* Mon Aug 26 2019 Luis Bazan <lbazan@fedoraproject.org> - 2.0.3-4
bbc5042
- fix mixed space and tabs
bbc5042
- non-executable script
bbc5042
8ccadb6
* Mon Aug 26 2019 Luis Bazan <lbazan@fedoraproject.org> - 2.0.3-3
8ccadb6
- fix some typos and import source
8ccadb6
ae5921a
* Thu Aug 22 2019 Miro Hrončok <mhroncok@redhat.com> - 2.0.3-2
ae5921a
- Rebuilt for Python 3.8
ae5921a
eef1ec8
* Thu Jun  6 2019 victortyau <victortyau@gmail.com> 2.0.3-1
f4891ae
- Initial package for fedora