From 74793183299b1b53afbb02d3e5bd71d9d2febaae Mon Sep 17 00:00:00 2001 From: Pavol Sloboda Date: Tue, 1 Jul 2025 09:12:40 +0200 Subject: [PATCH] Started modifying the source package as it contains problematic licenses for the fonts contained in it. After inspecting the fonts inside the docs/mysqlx/_themes/sphinx_rtd_theme/static/css/fonts/ using the fontforge tool I have discovered that the font families are licensed like this: * fontawesome: Copyright Dave Gandy 2016. All rights reserved. * latto: Copyright (c) 2011-2015 by tyPoland Lukasz Dziedzic (http://www.typoland.com/) with Reserved Font Name "Lato". Licensed under the SIL Open Font License, Version 1.1 (http://scripts.sil.org/OFL) * Roboto: Font data copyright Google 2013 This means the fontawesome and Roboto font families are licensed under a strict copyright which is not supported when packaging fonts in fedora and since we don't use the fonts during the build process nor do we package them in the package I have decided to remove them from the archive and rename the archive to %{name}-%{version}-src-without-fonts.tar.gz to avoid any possible confusion when packaging this package in the future. I have also added the generate-modified-sources.sh script that downloads the original sources from the mysql upstream, unpacks them, removes the aforementioned fonts and packs the sources under a new name. --- .gitignore | 1 + generate-modified-sources.sh | 49 ++++++++++++++++++++++++++++++++++++ mysql-connector-python.spec | 13 +++++++--- sources | 2 +- 4 files changed, 60 insertions(+), 5 deletions(-) create mode 100755 generate-modified-sources.sh diff --git a/.gitignore b/.gitignore index 361ac4e..afd1ae2 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ clog /mysql-connector-python-8.0.20.tar.gz /mysql-connector-python-8.0.21.tar.gz /mysql-connector-python-8.0.33-src.tar.gz +/mysql-connector-python-8.0.33-src-without-fonts.tar.gz diff --git a/generate-modified-sources.sh b/generate-modified-sources.sh new file mode 100755 index 0000000..bf9984e --- /dev/null +++ b/generate-modified-sources.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +################################# +# downloads the sources of +# mysql-connector-python +# extracts them, removes the +# fonts since they have problematic +# copyright and packs the result +# under a new name +################################# + +set -ex + +NAME="mysql-connector-python" +# gets the version of the package from the spec file +VERSION=$( rpmspec -q --srpm --qf '%{VERSION}' "${NAME}.spec" ) + +# the source url of the mysql upstream tarball of the package +SOURCE_URL="http://dev.mysql.com/get/Downloads/Connector-python/8.0/${NAME}-${VERSION}-src.tar.gz" + +# original archive name +OLD_ARCHIVE_NAME="${NAME}-${VERSION}-src" +# new tarball name, chnaged to able to differentiate between +# the original and the changed tarball +NEW_ARCHIVE_NAME="${OLD_ARCHIVE_NAME}-without-fonts" + +# removes the old tarball, new tarball and the unpacked tarball +# if they are present in the current directory +rm -rf "./${OLD_ARCHIVE_NAME}.tar.gz" "./${OLD_ARCHIVE_NAME}/" "./${NEW_ARCHIVE_NAME}.tar.gz" + +# downloads the source tarball from the url +# specified above +wget "${SOURCE_URL}" + +#unpacks the original tarball +tar -xzf "${OLD_ARCHIVE_NAME}.tar.gz" + +# removes the problematic font files +rm "./${OLD_ARCHIVE_NAME}/docs/mysqlx/_themes/sphinx_rtd_theme/static/css/fonts/"* + +# compresses the modified sources under a new name +tar -czf "${NEW_ARCHIVE_NAME}.tar.gz" "${OLD_ARCHIVE_NAME}" + +# removes the unpacked sources +rm -r "${OLD_ARCHIVE_NAME}" + +# removes the original tarball so it isn't used +# by mistake +rm -f "${OLD_ARCHIVE_NAME}.tar.gz" diff --git a/mysql-connector-python.spec b/mysql-connector-python.spec index 4f53fc0..bd0a2dd 100644 --- a/mysql-connector-python.spec +++ b/mysql-connector-python.spec @@ -27,10 +27,15 @@ Summary: MySQL Connector for Python 3 # Automatically converted from old format: GPLv2 with exceptions - review is highly recommended. License: (MIT OR GPL-2.0-only) AND GPL-2.0-only AND BSD-2-Clause URL: http://dev.mysql.com/doc/connector-python/en/index.html -# Upstream has a mirror redirector for downloads, so the URL is hard to -# represent statically. You can get the tarball by following a link from -# http://dev.mysql.com/downloads/connector/python/ -Source0: %{name}-%{version}-src.tar.gz +# You can get the original tarball from: +# http://dev.mysql.com/get/Downloads/Connector-python/8.0/%%{name}-%%{version}-src.tar.gz" + +# The tarball has to be modified as the fonts are licensed under a copyright +# and therefore would clash with the allowed licenses for fonts in fedora if +# they were shipped in the src rpm +# to modify the tarball to the desired form use the +# generate-modified-sources.sh script available in this repo +Source0: %{name}-%{version}-src-without-fonts.tar.gz BuildRequires: python3-devel >= 3 BuildRequires: python3-setuptools diff --git a/sources b/sources index 450c654..679ad39 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mysql-connector-python-8.0.33-src.tar.gz) = da78e23fca47e7be8a1a0355f037d5fc2a68e6414b7da9bbd0cb8c68e2027b041cd78aea65a922079666df2873adebfce56c30f5726c52e7176adf9a87b9ad1b +SHA512 (mysql-connector-python-8.0.33-src-without-fonts.tar.gz) = 81e0d84ab71ed83e6f2f201b1d285507fb2b0d2dae57df97246ac037bc37974477139c500bfce2e348285ef6d7943fdba1bd0fe53c61b451492e9d1b43d0e65a