From b39a2b360d3e7e4c16fab79bbee26c44b58a67b8 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 3 Jun 2021 16:31:16 +0200 Subject: [PATCH] Remove test files with a no-nuclear license from the sources --- .gitignore | 1 + get-clean-tarball.sh | 26 ++++++++++++++++++++++++++ python-pygments.spec | 13 +++++++++++-- sources | 2 +- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100755 get-clean-tarball.sh diff --git a/.gitignore b/.gitignore index 0459ea3..ece74be 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ Pygments-1.3.1.tar.gz /Pygments-2.7.2.tar.gz /Pygments-2.7.4.tar.gz /Pygments-2.8.1.tar.gz +/Pygments-2.8.1-clean.tar.xz diff --git a/get-clean-tarball.sh b/get-clean-tarball.sh new file mode 100755 index 0000000..a70175e --- /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/java/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 c2267bd..d65563b 100644 --- a/python-pygments.spec +++ b/python-pygments.spec @@ -4,12 +4,18 @@ Name: python-pygments Version: 2.8.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Syntax highlighting engine written in Python License: BSD URL: https://pygments.org/ -Source0: %{pypi_source Pygments %{version}} + +# One of the examples cannot be distributed in Fedora SRPM, 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,9 @@ make test PYTHON=%{python3} %endif %changelog +* Thu Jun 03 2021 Petr Viktorin - 2.8.1-4 +- Remove test files with a no-nuclear license from the sources + * Wed Jun 02 2021 Python Maint - 2.8.1-3 - Rebuilt for Python 3.10 diff --git a/sources b/sources index 3cf6930..b8755df 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Pygments-2.8.1.tar.gz) = 223835c78615207ad590d364ba9a0f4bc9b5815baa080e60b9b71ce7b8e1ebfcc7a292d2a2b1cd358c08d820fc89e02c4060876d37ee17fd9e2759c9a0dcc80c +SHA512 (Pygments-2.8.1-clean.tar.xz) = a0711c479c29fb94423e55e0b10ca55f38acce3e495af8677e5b13d292ed767223a419ae588cdbd8f0fc001b6290cf28aefd5bb88732eca08bf5aea3a4a13577