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.
49 lines
1.5 KiB
Bash
Executable file
49 lines
1.5 KiB
Bash
Executable file
#!/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"
|