From a47d01a805792f87a7bd6fc02b0492dc190676a6 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Oct 02 2023 11:20:38 +0000 Subject: Stop distributing the format specification PDF - Its license terms are unclear, so we exclude it from the lookaside cache and the SRPM going forward. --- diff --git a/.gitignore b/.gitignore index 04b7a63..114bc34 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /pybv-0.6.0.tar.gz +/pybv-0.6.0-filtered.tar.xz diff --git a/get_source b/get_source new file mode 100755 index 0000000..007c1e9 --- /dev/null +++ b/get_source @@ -0,0 +1,46 @@ +#!/bin/sh +set -o nounset +set -o errexit + +FORGEURL='https://github.com/bids-standard/pybv' + +print_help() +{ + cat <&2 + print_help "${0}" + exit 1 +elif [ "${1-}" = '-h' ] || [ "${1-}" = '--help' ] +then + print_help "${0}" + exit 0 +fi + +VERSION="${1}" +SOURCE0="${FORGEURL}/archive/v${VERSION}/pybv-${VERSION}.tar.gz" +TARNAME="$(basename "${SOURCE0}")" +TARDIR="$(basename "${SOURCE0}" '.tar.gz')" +NEWTAR="${TARDIR}-filtered.tar.xz" + +SAVEDIR="${PWD}" +XDIR="$(mktemp -d)" +trap "rm -rvf '${XDIR}'" INT TERM EXIT + +cd "${XDIR}" +curl -L -O "${SOURCE0}" +tar -xzvf "${TARNAME}" +rm -rvf "${TARDIR}/specification" +tar -cv "${TARDIR}/" | xz -9e > "${NEWTAR}" + +cd "${SAVEDIR}" +mv -v "${XDIR}/${NEWTAR}" . diff --git a/python-pybv.spec b/python-pybv.spec index 7de2bca..8b43080 100644 --- a/python-pybv.spec +++ b/python-pybv.spec @@ -9,12 +9,23 @@ Version: 0.6.0 Release: %autorelease Summary: A lightweight I/O utility for the BrainVision data format -%global forgeurl https://github.com/bids-standard/pybv -%forgemeta - License: BSD-3-Clause URL: https://pybv.readthedocs.io/en/stable/ -Source: %{forgesource} +# A filtered source archive, obtained by (see Source1): +# +# ./get_source %%{version} +# +# is required because specification/ contains a PDF file, +# BrainVisionCoreDataFormat_1-0.pdf, with unclear license terms. +# +# The unfiltered base source URL would be: +# +# https://github.com/bids-standard/pybv/archive/v%%{version}/pybv-%%{version}.tar.gz +# +# We have asked upstream to stop distributing the specification/ directory in +# PyPI sdists: https://github.com/bids-standard/pybv/pull/106 +Source0: pybv-%{version}-filtered.tar.xz +Source1: get_source # Replace deprecated mne.utils.requires_version # https://github.com/bids-standard/pybv/pull/105 @@ -57,7 +68,7 @@ Summary: Documentation for python-pybv %prep -%forgeautosetup -p1 +%autosetup -n pybv-%{version} -p1 # Filter unwanted dev dependencies: # diff --git a/sources b/sources index 9c75d89..85a8572 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pybv-0.6.0.tar.gz) = 85e76b1590581d03d2d9f0d3f471952babfa0458c974a3b2c673a05003b5bf8f21f42c2c3bedc2592fed58e3fc2cb71d5a17dd733f881f22185ca3b4b2eadbcf +SHA512 (pybv-0.6.0-filtered.tar.xz) = 5559c12b26f0581fe2796fd831578727b8f63e65cefded82f4c0242714c5054d68b7942558fab6460f82a6ae1c564a7461912076b68c1805a55f8bc83057435c