diff --git a/.gitignore b/.gitignore index 3025eb6..c284b22 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ biopython-1.54.tar.gz /biopython-1.69.tar.gz /biopython-biopython-170.tar.gz /biopython-biopython-171.tar.gz +/biopython-1.72.tar.gz +/biopython-1.73.tar.gz diff --git a/python-biopython.spec b/python-biopython.spec index 1e01104..5373cdb 100644 --- a/python-biopython.spec +++ b/python-biopython.spec @@ -1,17 +1,11 @@ -%if 0%{?fedora} +%if 0%{?rhel} && 0%{?rhel} > 7 %global with_python3 1 +%global with_python2 0 %endif -%if 0%{?rhel} && 0%{?rhel} <= 6 -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -%global with_python3 0 -%global python2_version 2.6 -%endif - -%if 0%{?rhel} && 0%{?rhel} > 6 +%if 0%{?rhel} && 0%{?rhel} == 7 %global with_python3 0 +%global with_python2 1 %endif %if 0%{?rhel} @@ -20,15 +14,26 @@ %global py2_prefix python2 %endif +%if 0%{?fedora} && 0%{?fedora} < 30 +%global with_python3 1 +%global with_python2 1 +%endif + +%if 0%{?fedora} && 0%{?fedora} >= 30 +%global with_python3 1 +%global with_python2 0 +Obsoletes: python2-%{module} +%endif + %global with_check 1 %global module biopython Name: python-biopython -Version: 1.71 -Release: 1%{?dist} +Version: 1.73 +Release: 3%{?dist} Summary: Python tools for computational molecular biology -Source0: https://github.com/biopython/biopython/archive/biopython-171.tar.gz#/biopython-biopython-171.tar.gz +Source0: https://files.pythonhosted.org/packages/source/b/%{module}/%{module}-%{version}.tar.gz # Starting from biopython-1.69, BioPython is released under the # "Biopython License Agreement"; it looks like a MIT variant @@ -37,10 +42,15 @@ License: MIT and BSD URL: http://www.biopython.org/ BuildRequires: gcc +%if 0%{?with_python3_other} +BuildRequires: python%{python3_other_pkgversion}-devel +%endif + %description A set of freely available Python tools for computational molecular biology. +%if 0%{?with_python2} %package -n python2-%{module} Summary: Python tools for computational molecular biology %{?python_provide:%python_provide python2-%{module}} @@ -80,46 +90,69 @@ Requires: python2-mysql BuildRequires: MySQL-python Requires: MySQL-python %endif - -%if 0%{?fedora} && 0%{?fedora} < 28 -Requires: mysql-connector-python -%endif -%if 0%{?fedora} && 0%{?fedora} >= 28 -Requires: %{py2_prefix}-mysql-connector -%endif +Requires: %{py2_prefix}-mysql-connector %description -n python2-%{module} A set of freely available Python tools for computational molecular biology. +%endif %if 0%{?with_python3} -%package -n python3-%{module} +%package -n python%{python3_pkgversion}-%{module} Summary: Python3 tools for computational molecular biology -%{?python_provide:%python_provide python3-%{module}} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{module}} -BuildRequires: python3-devel +BuildRequires: python%{python3_pkgversion}-devel BuildRequires: flex-devel -BuildRequires: python3-reportlab -BuildRequires: python3-numpy -BuildRequires: python3-mysql -BuildRequires: python3-psycopg2 -BuildRequires: python3-rdflib -Requires: python3-networkx -Requires: python3-pygraphviz -Requires: mysql-connector-python3 -Requires: python3-reportlab -Requires: python3-numpy -Requires: python3-mysql -Requires: python3-psycopg2 +BuildRequires: python%{python3_pkgversion}-reportlab +BuildRequires: python%{python3_pkgversion}-numpy +BuildRequires: python%{python3_pkgversion}-mysql +BuildRequires: python%{python3_pkgversion}-psycopg2 +BuildRequires: python%{python3_pkgversion}-rdflib +Requires: python%{python3_pkgversion}-networkx +Requires: python%{python3_pkgversion}-pygraphviz +Requires: mysql-connector-python%{python3_pkgversion} +Requires: python%{python3_pkgversion}-reportlab +Requires: python%{python3_pkgversion}-numpy +Requires: python%{python3_pkgversion}-mysql +Requires: python%{python3_pkgversion}-psycopg2 Requires: wise2 -Requires: python3-rdflib +Requires: python%{python3_pkgversion}-rdflib -%description -n python3-%{module} +%description -n python%{python3_pkgversion}-%{module} A set of freely available Python3 tools for computational molecular biology. %endif +%if 0%{?with_python3_other} +%package -n python%{python3_other_pkgversion}-%{module} +Summary: Python3 tools for computational molecular biology + +%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{module}} + +BuildRequires: python%{python3_other_pkgversion}-devel +BuildRequires: flex-devel +BuildRequires: python%{python3_other_pkgversion}-reportlab +BuildRequires: python%{python3_other_pkgversion}-numpy +BuildRequires: python%{python3_other_pkgversion}-mysql +BuildRequires: python%{python3_other_pkgversion}-psycopg2 +BuildRequires: python%{python3_other_pkgversion}-rdflib +Requires: python%{python3_other_pkgversion}-networkx +Requires: python%{python3_other_pkgversion}-pygraphviz +Requires: mysql-connector-python%{python3_other_pkgversion} +Requires: python%{python3_other_pkgversion}-reportlab +Requires: python%{python3_other_pkgversion}-numpy +Requires: python%{python3_other_pkgversion}-mysql +Requires: python%{python3_other_pkgversion}-psycopg2 +Requires: wise2 +Requires: python%{python3_other_pkgversion}-rdflib + +%description -n python%{python3_other_pkgversion}-%{module} +A set of freely available Python3 tools for computational molecular +biology. +%endif # with_python3_other + %package doc Summary: PDF and HTML documentation of %{module} BuildArch: noarch @@ -129,9 +162,7 @@ PDF/HTML documentation of %{module}. %prep %setup -qc -mv %{module}-%{module}-171 python2 -pushd python2 - +pushd %{module}-%{version} # remove all execute bits from documentation and fix line endings find Scripts -type f -exec chmod -x {} 2>/dev/null ';' find Doc -type f -exec chmod -x {} 2>/dev/null ';' @@ -143,84 +174,171 @@ find Bio -type f -exec chmod -x {} 2>/dev/null ';' find Bio -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/.*$/ d' {} 2>/dev/null ';' popd +%if 0%{?with_python2} +cp -a %{module}-%{version} python2 +%endif + %if 0%{?with_python3} -cp -a python2 python3 +cp -a %{module}-%{version} python3 %endif # with_python3 +%if 0%{?with_python3_other} +cp -a %{module}-%{version} python%{python3_other_pkgversion} +%endif # with_python3_other + %build +%if 0%{?with_python2} pushd python2 -CFLAGS="$RPM_OPT_FLAGS -Wl,-z,relro -Wl,-z,now" %{__python2} setup.py build --executable="%{__python2} -s" +%py2_build popd +%endif %if 0%{?with_python3} pushd python3 -CFLAGS="$RPM_OPT_FLAGS -Wl,-z,relro -Wl,-z,now" %{__python3} setup.py build --executable="%{__python3} -s" +%py3_build popd %endif # with_python3 +%if 0%{?with_python3_other} +pushd python%{python3_other_pkgversion} +%py3_other_build +popd +%endif # with_python3_other + %install %if 0%{?with_python3} pushd python3 %{__python3} setup.py install -O1 --skip-build --root=$RPM_BUILD_ROOT --install-data=%{_datadir}/python-biopython + +find Scripts -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|' +popd +%endif + +%if 0%{?with_python3_other} +pushd python%{python3_other_pkgversion} +%{__python3_other} setup.py install -O1 --skip-build --root=$RPM_BUILD_ROOT --install-data=%{_datadir}/python-biopython + +find Scripts -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3_other}|' popd %endif +%if 0%{?with_python2} pushd python2 %{__python2} setup.py install -O1 --skip-build --root=$RPM_BUILD_ROOT --install-data=%{_datadir}/python-biopython + +find Scripts -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|' popd +%endif ##DocTest cannot be executed ##https://github.com/biopython/biopython/issues/669 ##http://lists.open-bio.org/pipermail/biopython-dev/2014-May/020541.html %if 0%{?with_check} %check +%if 0%{?with_python2} pushd python2 export PYTHONPATH=$RPM_BUILD_ROOT%{python2_sitearch} find . -name 'run_tests.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|' -for test in `ls test_*.py | grep -v chapter | grep -v DSSP | grep -v Tutorial`; do +for test in `ls test_*.py | grep -v Tutorial`; do %{__python2} run_tests.py --offline -v ${test} done popd +%endif # See https://github.com/biopython/biopython/issues/855 +# https://github.com/biopython/biopython/issues/1889 %if 0%{?with_python3} pushd python3/Tests find . -name 'run_tests.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|' -for test in `ls test_*.py | grep -v chapter | grep -v NCBIXML | grep -v Nexus | grep -v Phylo | grep -v SeqIO | grep -v Tutorial`; do +for test in `ls test_*.py | grep -v Nexus | grep -v Phylo | grep -v Tutorial | grep -v bgzf | grep -v SearchIO_blast`; do echo $LANG export PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch} %{__python3} run_tests.py --offline -v ${test} done popd %endif -%endif +# See https://github.com/biopython/biopython/issues/855 +%if 0%{?with_python3_other} +pushd python%{python3_other_pkgversion}/Tests +find . -name 'run_tests.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3_other}|' +for test in `ls test_*.py | grep -v Nexus | grep -v Phylo | grep -v Tutorial | grep -v bgzf`; do +echo $LANG +export PYTHONPATH=$RPM_BUILD_ROOT%{python3_other_sitearch} +%{__python3_other} run_tests.py --offline -v ${test} +done +popd +%endif # with_python3_other +%endif # with_check + +%if 0%{?with_python2} %files -n python2-%{module} -%{!?_licensedir:%global license %doc} %doc python2/Scripts -%doc python2/CONTRIB python2/DEPRECATED python2/NEWS python2/README -%license python2/LICENSE +%doc python2/CONTRIB.rst python2/DEPRECATED.rst python2/NEWS.rst python2/README.rst +%license python2/LICENSE.rst %{python2_sitearch}/*egg-info %{python2_sitearch}/Bio/ %{python2_sitearch}/BioSQL/ +%endif %if 0%{?with_python3} -%files -n python3-%{module} -%{!?_licensedir:%global license %doc} +%files -n python%{python3_pkgversion}-%{module} %doc python3/Scripts -%doc python3/CONTRIB python3/DEPRECATED python3/NEWS python3/README -%license python3/LICENSE +%doc python3/CONTRIB.rst python3/DEPRECATED.rst python3/NEWS.rst python3/README.rst +%license python3/LICENSE.rst %{python3_sitearch}/*egg-info %{python3_sitearch}/Bio/ %{python3_sitearch}/BioSQL/ %endif +%if 0%{?with_python3_other} +%files -n python%{python3_other_pkgversion}-%{module} +%doc python%{python3_other_pkgversion}/Scripts +%doc python%{python3_other_pkgversion}/CONTRIB.rst python%{python3_other_pkgversion}/DEPRECATED.rst python%{python3_other_pkgversion}/NEWS.rst python%{python3_other_pkgversion}/README.rst +%license python%{python3_other_pkgversion}/LICENSE.rst +%{python3_other_sitearch}/*egg-info +%{python3_other_sitearch}/Bio/ +%{python3_other_sitearch}/BioSQL/ +%endif + %files doc -%{!?_licensedir:%global license %doc} -%doc python2/Doc -%license python2/LICENSE +%doc %{module}-%{version}/Doc +%license %{module}-%{version}/LICENSE.rst %changelog +* Thu Jun 13 2019 Antonio Trande - 1.73-3 +- Rebuild for python-reportlab-3.5.23 + +* Sat Feb 02 2019 Fedora Release Engineering - 1.73-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jan 03 2019 Antonio Trande - 1.73-1 +- Release 1.73 + +* Sun Sep 30 2018 Antonio Trande - 1.72-3 +- Deprecate Python2 on fedora 30+ +- Prepare SPEC file for Python3-modules packaging on epel7 + +* Fri Jul 13 2018 Fedora Release Engineering - 1.72-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sat Jun 30 2018 Antonio Trande - 1.72-1 +- Update to 1.72 + +* Fri Jun 22 2018 Antonio Trande - 1.71-5 +- Enable additional tests (upstream bug #855) +- Enable DSSP test with Python2 +- Disable bgzf test with Python3 + +* Thu Jun 21 2018 Antonio Trande - 1.71-4 +- Patched for AlignIO test failure (python-3.7 issue) + +* Tue Jun 19 2018 Miro HronĨok - 1.71-3 +- Rebuilt for Python 3.7 + +* Fri Apr 27 2018 Antonio Trande - 1.71-2 +- Conform Python3 builds to coming RHEL major release + * Wed Apr 04 2018 Antonio Trande - 1.71-1 - Update to 1.71 (bz#1563655) diff --git a/sources b/sources index 7fcad34..0050477 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (biopython-biopython-171.tar.gz) = 450f7e2aed09b8764b10268c98b9b824d63864c78cdccf4014e64f385850b870890ae915b56310bcb6da06df90728eeb59009ea78e32f221d86d70c043f1dc33 +SHA512 (biopython-1.73.tar.gz) = d067330ef8e25ca6881b56f4e5e89e16a816c89760473e2f32a6236ab202f805294650aa944f0b098987425bcb65727317da7a26deb4d4937f02b00123ea9a8f