The grafana package
git clone https://github.com/grafana/grafana && cd grafana
git checkout <currentversion>
git am ../0*.patch
git fetch && git rebase --onto <newversion> <oldversion>
remove-unused-backend-dependencies.patch
: only apply the patch to pkg/extensions/main.go
and run go mod tidy
, then go.mod
and go.sum
will get updated automaticallyremove-unused-frontend-crypto.patch
: only apply the patch to package.json
and run yarn install
, then yarn.lock
will get updated automaticallygit format-patch -N --no-stat --no-signature <newversion> && mv *.patch ..
Version
, Release
, %changelog
and tarball NVRs in the specfile./create_bundles_in_container.sh
vendor/golang.org/x/crypto
), delete these files/directories in the Makefile and update the patch-removed-backend-crypto.patch
if required.manifest
file0002-add-manpages.patch
and other patches if requiredrpkg local
rpmlint -r grafana.rpmlintrc /tmp/rpkg/grafana-*/grafana-*.src.rpm /tmp/rpkg/grafana-*/x86_64/grafana-*.x86_64.rpm
fedpkg scratch-build --srpm
fedpkg new-sources *.tar.gz *.tar.xz
sources
file%prep
) the patch in the specfilecreate_bundles.sh
script and apply the patch.manifest
filePatches fall in several categories: * modify dependency versions * modify both sources and vendored dependencies (e.g. CVEs) * modify the Node.js source (i.e. affect the webpack) * some patches are conditional (e.g. FIPS)
Patches cannot be applied twice. It is not possible to unconditionally apply all patches in the Makefile, and great care must be taken to include the required patches at the correct stage of the build.
Run ./create_bundles_in_container.sh
to generate a reproducible vendor and webpack bundle.