diff --git a/python-nltk.changes b/python-nltk.changes index 92cd58e..697fd51 100644 --- a/python-nltk.changes +++ b/python-nltk.changes @@ -5,6 +5,7 @@ Mon Dec 26 10:41:22 UTC 2022 - Matej Cepl - Fix failing tests (gh#nltk/nltk#2969) by adding patches: - port-2to3.patch - skip-networked-test.patch +- Clean up the SPEC to get rid of rpmlint warnings. ------------------------------------------------------------------- Tue Mar 22 07:48:14 UTC 2022 - Matej Cepl diff --git a/python-nltk.rpmlintrc b/python-nltk.rpmlintrc new file mode 100644 index 0000000..9816082 --- /dev/null +++ b/python-nltk.rpmlintrc @@ -0,0 +1 @@ +addFilter("E: zero-length /usr/lib/python3\.\d/site-packages/nltk/tbl/api\.py") diff --git a/python-nltk.spec b/python-nltk.spec index 6c0413e..6189c2c 100644 --- a/python-nltk.spec +++ b/python-nltk.spec @@ -30,6 +30,7 @@ Source0: https://files.pythonhosted.org/packages/source/n/nltk/%{pyname}- # then unzip downloaded zip archive. # see https://www.nltk.org/data.html for more details Source1: nltk_data.tar.xz +Source99: python-nltk.rpmlintrc # PATCH-FIX-UPSTREAM skip-networked-test.patch gh#nltk/nltk#2969 mcepl@suse.com # skip tests requiring network connection Patch0: skip-networked-test.patch @@ -93,11 +94,36 @@ development in Natural Language Processing. # Remove obsolete scripts rm tools/nltk_term_index.py tools/run_doctests.py nltk_data/corpora/semcor/semcor.py -# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/corpus/reader/knbc.py -# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/test/runtests.py -# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/test/unit/test_tgrep.py -# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/tgrep.py -# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/tokenize/stanford_segmenter.py +# Fix EOL +sed -i 's/\r/\n/g; s/\n$//' \ + README.md \ + nltk/corpus/reader/knbc.py \ + nltk/test/unit/test_tgrep.py \ + nltk/tgrep.py \ + nltk/tokenize/stanford_segmenter.py \ + nltk/corpus/reader/knbc.py \ + nltk/test/unit/test_tgrep.py \ + nltk/tgrep.py \ + nltk/tokenize/stanford_segmenter.py \ + nltk/corpus/reader/knbc.py \ + nltk/test/unit/test_tgrep.py \ + nltk/tgrep.py \ + nltk/tokenize/stanford_segmenter.py + +# Remove unrequired shebangs +sed -E -i "/#![[:space:]]*\/usr\/bin\/env python/d" \ + nltk/tgrep.py \ + nltk/tokenize/stanford_segmenter.py \ + nltk/test/unit/test_tgrep.py \ + nltk/corpus/reader/knbc.py + +# Switch shebangs to the standard Python interpreter +sed -E -i "s|#![[:space:]]*%{_bindir}/env python|#!%{_bindir}/python3|" \ + setup.py \ + tools/global_replace.py \ + nltk_data/corpora/pl196x/splitter.py \ + tools/find_deprecated.py \ + tools/svnmime.py %build %python_build