From 1ce0b26c2225eece72eb07e0a3af32a4a359c4ee Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Nov 01 2018 21:59:12 +0000 Subject: Initial scm import --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33192b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/pylems-a96812a.tar.gz diff --git a/python-PyLEMS.spec b/python-PyLEMS.spec new file mode 100644 index 0000000..e440369 --- /dev/null +++ b/python-PyLEMS.spec @@ -0,0 +1,138 @@ +%global srcname PyLEMS +%global libname pylems +%global commit a96812a2a979a0bb4c503c6459d14e7d3602ea7c +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +# https://fedoraproject.org/wiki/Packaging:DistTag?rd=Packaging/DistTag#Conditionals +%if 0%{?fedora} < 30 +%global with_py2 1 +%else +%global with_py2 0 +%endif + +# Most tests try to download files from other github repos, so we cannot use them +%global run_tests 0 + +%global _description \ +A LEMS (http://lems.github.io/LEMS) simulator written in Python which can be \ +used to run NeuroML2 (http://neuroml.org/neuroml2.php) models. + + +Name: python-%{srcname} +Version: 0.4.9.1 +Release: 1%{?dist} +Summary: LEMS interpreter implemented in Python + +License: LGPLv3 + +# Use github source. Pypi source does not include license and examples. +URL: https://github.com/LEMS/%{libname}/ +Source0: https://github.com/LEMS/%{libname}/archive/%{commit}/%{libname}-%{shortcommit}.tar.gz + +BuildArch: noarch + +%description +%{_description} + +%package -n python3-%{srcname} +Summary: %{summary} +BuildRequires: python3-devel +BuildRequires: %{py3_dist lxml} +Requires: %{py3_dist lxml} +Requires: %{py3_dist matplotlib} +Requires: %{py3_dist numpy} +%if %{run_tests} +BuildRequires: %{py3_dist nose} +%endif +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +%{_description} + +%package doc +Summary: %{summary} + +%description doc +%{_description} + + +%if %{with_py2} +%package -n python2-%{srcname} +Summary: %{summary} +BuildRequires: python2-devel +BuildRequires: %{py2_dist lxml} +Requires: %{py2_dist lxml} +Requires: %{py2_dist matplotlib} +Requires: %{py2_dist numpy} +%if %{run_tests} +BuildRequires: %{py2_dist nose} +%endif +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +%{_description} +%endif + +%prep +%autosetup -n %{libname}-%{commit} + +# remove shebang +sed -i '1d' lems/dlems/exportdlems.py + +%build +%py3_build + +%if %{with_py2} +%py2_build +%endif + +%install +%py3_install + +%if %{with_py2} +%py2_install +%endif + +%check + +%if %{run_tests} +# From test*sh scripts in the source and .travis.yml + +nosetests-3 +PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} examples/apitest.py +PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} examples/apitest2.py +PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} examples/loadtest.py +PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} lems/dlems/exportdlems.py + +%if %{with_py2} +nosetests-2 +PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} examples/apitest.py +PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} examples/apitest2.py +PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} examples/loadtest.py +PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} lems/dlems/exportdlems.py +%endif +%endif + +%files -n python3-%{srcname} +%license LICENSE.lesser +%doc README.md +%{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info +%{python3_sitelib}/lems +%{_bindir}/%{libname} + +%files doc +%license LICENSE.lesser +%doc README.md examples + +%if %{with_py2} +%files -n python2-%{srcname} +%license LICENSE.lesser +%doc README.md +%{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info +%{python2_sitelib}/lems +%{_bindir}/%{libname} +%endif + +%changelog +* Sat Oct 27 2018 Ankur Sinha - 0.4.9.1-1 +- Initial build diff --git a/sources b/sources new file mode 100644 index 0000000..26f1d8b --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (pylems-a96812a.tar.gz) = 09dc91aa37e8758de2f4516428208ad503b779355a636901797d6fa1a0b0d6fef724f8e486c64db72cf1f08dc914d8f6e5f5aa9cacb769ad6d711264f605ec1c