diff --git a/python-biopython.spec b/python-biopython.spec index 94bdeff..0e8f887 100644 --- a/python-biopython.spec +++ b/python-biopython.spec @@ -20,7 +20,7 @@ Name: python-biopython Version: 1.66 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python tools for computational molecular biology Source0: http://biopython.org/DIST/biopython-%{version}.tar.gz License: MIT @@ -76,13 +76,15 @@ biology. %endif %package doc -Summary: PDF documentation +Summary: PDF and HTML documentation of %{module} BuildArch: noarch %description doc -PDF documentation of %{module}. +PDF/HTML documentation of %{module}. %prep -%setup -q -n biopython-%{version} +%setup -qc +mv %{module}-%{version} python2 +pushd python2 # remove all execute bits from documentation and fix line endings find Scripts -type f -exec chmod -x {} 2>/dev/null ';' @@ -93,36 +95,40 @@ find Doc -type f -exec sed -i 's/\r//' {} 2>/dev/null ';' find Bio -type f -exec chmod -x {} 2>/dev/null ';' # remove she-bang lines in .py files to keep rpmlint happy find Bio -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/.*$/ d' {} 2>/dev/null ';' +popd %if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} +cp -a python2 python3 %endif # with_python3 %build -CFLAGS="$RPM_OPT_FLAGS -Wl,-z,relro -Wl,-z,now" %{__python2} setup.py build +pushd python2 +CFLAGS="$RPM_OPT_FLAGS -Wl,-z,relro -Wl,-z,now" %{__python2} setup.py build --executable="%{__python2} -s" +popd %if 0%{?with_python3} -pushd %{py3dir} -CFLAGS="$RPM_OPT_FLAGS -Wl,-z,relro -Wl,-z,now" %{__python3} setup.py build +pushd python3 +CFLAGS="$RPM_OPT_FLAGS -Wl,-z,relro -Wl,-z,now" %{__python3} setup.py build --executable="%{__python3} -s" popd %endif # with_python3 %install %if 0%{?with_python3} -pushd %{py3dir} +pushd python3 %{__python3} setup.py install -O1 --skip-build --root=$RPM_BUILD_ROOT --install-data=%{_datadir}/python-biopython popd %endif +pushd python2 %{__python2} setup.py install -O1 --skip-build --root=$RPM_BUILD_ROOT --install-data=%{_datadir}/python-biopython +popd ##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 -pushd Tests +pushd python2/Tests find . -name 'run_tests.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python2}|' for test in `ls test_*.py | grep -v Tutorial`; do %{__python2} run_tests.py --offline -v ${test} @@ -131,20 +137,20 @@ popd ##Not all tests are ready for Python3 %if 0%{?with_python3} -pushd %{py3dir} -pushd Tests +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 test_Tutorial | grep -v test_SeqIO | grep -v test_NCBIXML | grep -v test_Phylo`; do %{__python3} run_tests.py --offline -v ${test} done +popd %endif %endif %files %{!?_licensedir:%global license %doc} -%doc Scripts -%doc CONTRIB DEPRECATED NEWS README -%license LICENSE +%doc python2/Scripts +%doc python2/CONTRIB python2/DEPRECATED python2/NEWS python2/README +%license python2/LICENSE %{python2_sitearch}/*egg-info %{python2_sitearch}/Bio/ %{python2_sitearch}/BioSQL/* @@ -152,9 +158,9 @@ done %if 0%{?with_python3} %files -n python3-%{module} %{!?_licensedir:%global license %doc} -%doc Doc Scripts -%doc CONTRIB DEPRECATED NEWS README -%license LICENSE +%doc python3/Scripts +%doc python3/CONTRIB python3/DEPRECATED python3/NEWS python3/README +%license python3/LICENSE %{python3_sitearch}/*egg-info %{python3_sitearch}/Bio/ %{python3_sitearch}/BioSQL/* @@ -162,21 +168,24 @@ done %files doc %{!?_licensedir:%global license %doc} -%doc Doc/*.pdf -%license LICENSE +%doc python2/Doc +%license python2/LICENSE %changelog +* Wed Dec 09 2015 Antonio Trande - 1.66-3 +- SPEC file adapted to recent guidelines for Python + * Wed Dec 09 2015 Antonio Trande - 1.66-2 - Built with Python3 - Some cleanups - Set --cflags - Fixed MySQL dependencies in Fedora -* Tue Dec 08 2015 Luis Bazan -- 1.66-1 - new upstream version +* Tue Dec 08 2015 Luis Bazan - 1.66-1 +- new upstream version -* Thu Jun 18 2015 Fedora Release Engineering -- 1.65-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild +* Thu Jun 18 2015 Fedora Release Engineering - 1.65-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Thu Jan 08 2015 Luis Bazan - 1.65-1 - New upstream version