diff --git a/.gitignore b/.gitignore index f107a85..9aad2f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1 @@ -Pygments-1.3.1.tar.gz -/Pygments-1.4.tar.gz -/Pygments-1.6.tar.gz -/Pygments-2.0.2.tar.gz -/fix-shell-injection-in-font-manager.patch -/Pygments-2.1.3.tar.gz -/Pygments-2.2.0.tar.gz -/Pygments-2.3.1.tar.gz -/Pygments-2.4.2.tar.gz -/Pygments-2.6.1.tar.gz -/Pygments-2.7.1.tar.gz -/Pygments-2.7.2.tar.gz -/Pygments-2.7.4.tar.gz +/Pygments-2.7.4-clean.tar.xz diff --git a/get-clean-tarball.sh b/get-clean-tarball.sh new file mode 100755 index 0000000..1072aee --- /dev/null +++ b/get-clean-tarball.sh @@ -0,0 +1,26 @@ +#! /bin/bash -ex + +# You can set the version as an argument to the script, +# default is taken from the specfile +if [ "$1" = "" ]; then + VERSION=$( + rpm -q --qf "%{VERSION}\n" --specfile python-pygments.spec | head -n1 + ) +else + VERSION=$1 +fi + +SRCURL=https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-$VERSION.tar.gz +BADFILE=Pygments-$VERSION/tests/examplefiles/Intro.java +OUT=Pygments-$VERSION-clean.tar.xz + +curl -L $SRCURL | + gunzip | + tar --delete $BADFILE --delete $BADFILE.output | + xz > $OUT + +if tar tJf $OUT | grep 'Intro.java'; then + >&2 echo "Intro.java left in!" + mv $OUT $OUT.bad + exit 1 +fi diff --git a/python-pygments.spec b/python-pygments.spec index fa17551..c8e24a0 100644 --- a/python-pygments.spec +++ b/python-pygments.spec @@ -4,12 +4,18 @@ Name: python-pygments Version: 2.7.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Syntax highlighting engine written in Python License: BSD URL: https://pygments.org/ -Source0: %{pypi_source Pygments %{version}} + +# One of the examples has a questionable licence clause, see: +# https://github.com/pygments/pygments/issues/1831 +# To obtain a cleaned-up tarball, run: +# $ ./get-clean-tarball.sh +Source0: Pygments-%{version}-clean.tar.xz +Source1: get-clean-tarball.sh BuildArch: noarch @@ -84,6 +90,10 @@ make test PYTHON=%{python3} %endif %changelog +* Thu Jun 03 2021 Petr Viktorin - 2.7.4-3 +- Remove test files with a no-nuclear license from the sources +- Related: rhbz#1950291 + * Fri Apr 16 2021 Mohan Boddu - 2.7.4-2 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 diff --git a/sources b/sources index 06bc53a..9b221e7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Pygments-2.7.4.tar.gz) = 84fb2e0c52e4683d52524ee1d70c11a9ff6cc0b21fe6aa3e1a6c4fac393f87267756b1c04b7c2555799e387b2e9ca7d2e7703ddc1690a642aa263ed27510e030 +SHA512 (Pygments-2.7.4-clean.tar.xz) = 2d254d1efb3df184214dc44cbe971c3c9f4cd43f6440cce7824b259b5633cd66c07ec1232ae62a8ac86716807db224cae37112f71089a41747dfcbd111b50bb5