diff --git a/python-ase.spec b/python-ase.spec index 83f6869..0f5c883 100644 --- a/python-ase.spec +++ b/python-ase.spec @@ -1,27 +1,17 @@ -%if 0%{?rhel} && 0%{?rhel} <= 6 -# Failsafe backport of Python2-macros for RHEL <= 6 -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -%{!?python_version: %global python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")} -%{!?__python2: %global __python2 %{__python}} -%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}} -%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}} -%{!?python2_version: %global python2_version %{python_version}} -%endif - -%if 0%{?fedora} > 12 -%global with_python3 1 +%if 0%{?fedora} +%global with_python3 1 +%else +%global with_python3 0 %endif %global upstream_name ase -%global upstream_commit c49964a2621c48185054eb27f4a28e1cadbf618e +%global upstream_commit e240cec52abeb150b1b5cefa69888b7b60489878 Name: python-ase -Version: 3.13.0 -Release: 5%{?dist} +Version: 3.16.0 +Release: 1%{?dist} Summary: Atomic Simulation Environment -%{?el5:Group: Applications/Scientific} # The entire source code is LGPLv2+ except: @@ -31,7 +21,6 @@ License: LGPLv2+ and MIT URL: https://wiki.fysik.dtu.dk/ase/ Source0: https://gitlab.com/%{upstream_name}/%{upstream_name}/repository/archive.tar.gz?ref=%{version}#/%{upstream_name}-%{version}-%{upstream_commit}.tar.gz -%{?el5:BuildRoot: %(mktemp -ud %{_tmppath}/%{upstream_name}-%{version}-%{upstream_commit}-%{release}-XXXXXX)} BuildArch: noarch %global PKG_TOP $RPM_BUILD_DIR/%{upstream_name}-%{version}-%{upstream_commit} @@ -61,11 +50,7 @@ analyzing simulations, visualization etc. %package -n python2-ase Summary: %summary -%if 0%{?fedora} -Requires: python2-matplotlib -%else -Requires: python-matplotlib -%endif +Requires: python%{?fedora:2}-matplotlib %{?python_provide:%python_provide python2-ase} %description -n python2-ase %_description @@ -109,7 +94,6 @@ popd %install -%{?el5:rm -rf $RPM_BUILD_ROOT} %if 0%{?with_python3} pushd %{py3dir} @@ -117,9 +101,11 @@ pushd %{py3dir} --optimize=1 --root $RPM_BUILD_ROOT popd # Rename Python 3 scripts -for file in `find $RPM_BUILD_ROOT/%{_bindir}/ -name "ase-*"`; do - mv -f ${file} $RPM_BUILD_ROOT/%{_bindir}/`basename $file`3 +pushd $RPM_BUILD_ROOT/%{_bindir} +for file in `find . -name "ase*"`; do + mv -fv ${file} `basename $file`3 done +popd # remove ase-gui3 (not working) rm -f $RPM_BUILD_ROOT/%{_bindir}/ase-gui3 # remove .mo files @@ -128,7 +114,19 @@ find $RPM_BUILD_ROOT%{python3_sitelib}/%{upstream_name} -type f -name "*.mo" | x %{__python2} setup.py install --skip-build --prefix=%{_prefix} \ - --optimize=1 --root $RPM_BUILD_ROOT + --optimize=1 --root $RPM_BUILD_ROOT +# Rename Python 2 scripts +pushd $RPM_BUILD_ROOT/%{_bindir} +for file in `find . -name "ase*" | grep -v 3`; do + mv -fv ${file} `basename $file`2 +done +popd +# Link Python 2 scripts +pushd $RPM_BUILD_ROOT/%{_bindir} +for file in `find . -name "ase*2"`; do + ln -sv ${file} `echo $file | rev | cut -c 2- | rev` +done +popd # doc would go under $RPM_BUILD_ROOT%%{_datadir}/%%{name} # if only we get rid of povray dependency one could build doc with: @@ -175,46 +173,47 @@ sed -i "s|$RPM_BUILD_ROOT||g" %{PKG_TOP}/files3.list %if 0%{?with_python3} pushd %{py3dir} export PYTHONPATH=`pwd`/build/lib -export PATH=`pwd`/build/scripts-%{python3_version}:${PATH} # the tests assume Python 3 scripts are named the same as Python 2 scripts +export PATH=`pwd`/bin:${PATH} # the tests assume Python 3 scripts are named the same as Python 2 scripts mkdir testase && cd testase -LC_ALL=C.UTF-8 %{__python3} -m ase.test +LC_ALL=C.UTF-8 %{__python3} -m ase test --verbose cd - popd %endif # with_python3 export PYTHONPATH=`pwd`/build/lib -export PATH=`pwd`/build/scripts-%{python2_version}:${PATH} +export PATH=`pwd`/bin:${PATH} mkdir testase && cd testase -# https://gitlab.com/ase/ase/issues/93 -%if 0%{?rhel} && 0%{?rhel} <= 6 -LC_ALL=C.UTF-8 %{__python2} -m ase.test.__main__ -%else -LC_ALL=C.UTF-8 %{__python2} -m ase.test -%endif +LC_ALL=C.UTF-8 %{__python2} -m ase test --verbose cd - - %files -n python2-ase -f files2.list %defattr(-,root,root,-) %doc COPYING* LICENSE README* -%{_bindir}/ase-* +%{_bindir}/ase* %if 0%{?with_python3} -%exclude %{_bindir}/ase-*3 +%exclude %{_bindir}/ase*3 %endif # with_python3 -%{?!el5:%{python2_sitelib}/*.egg-info} %{_datadir}/applications/%{upstream_name}-gui.desktop %{_datadir}/pixmaps/%{upstream_name}.png +%{python2_sitelib}/*.egg-info %if 0%{?with_python3} %files -n python3-ase -f files3.list %defattr(-,root,root,-) %doc COPYING* LICENSE README* -%{_bindir}/ase-*3 +%{_bindir}/ase*3 %{python3_sitelib}/*.egg-info %endif # with_python3 %changelog +* Sat Apr 07 2018 Marcin Dulak - 3.16.0-1 +- new upstream release +- clean rhel5 leftovers +- drop rhel6 support: Python 2.7 is required +- drop rhel7 support: Numpy 1.9 is required +- link Python 2 scripts as defaults + * Mon Mar 26 2018 Iryna Shcherbina - 3.13.0-5 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) diff --git a/sources b/sources index 2d3275a..0254472 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ase-3.13.0-c49964a2621c48185054eb27f4a28e1cadbf618e.tar.gz) = 94cfe0e8854a1ba214a4b3b20f88a6ceb64492f4474402a867cb6fe9dbf1c84f01b9991d33a5baebfb52a4cd3fbabbe07658f57463421dfd302d02d612d36b51 +SHA512 (ase-3.16.0-e240cec52abeb150b1b5cefa69888b7b60489878.tar.gz) = 7483ecef668454fcbe577bfb2f278cf6c3d806f1f68efd254c3155b72daa575ee7d5f36d63d533aba5610f465385da7de4eb3f0b91c20000591899cf9a054575