|
|
97f8dbd |
# grafana
|
|
|
3557495 |
The grafana package
|
|
|
97f8dbd |
|
|
|
f922bfd |
## Setup instructions
|
|
|
f922bfd |
* clone the upstream sources: `git clone https://github.com/grafana/grafana && cd grafana`
|
|
|
cba27cf |
* checkout the version of the specfile: `git checkout <currentversion>`
|
|
|
cba27cf |
* apply existing patches: `git am ../0*.patch`
|
|
|
f922bfd |
|
|
|
3557495 |
## Upgrade instructions
|
|
|
cba27cf |
* follow the Setup instructions above
|
|
|
cba27cf |
* rebase to the new version: `git fetch && git rebase --onto <newversion> <oldversion>`
|
|
|
cba27cf |
* rebasing `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 automatically
|
|
|
cba27cf |
* rebasing `remove-unused-frontend-crypto.patch`: only apply the patch to `package.json` and run `yarn install`, then `yarn.lock` will get updated automatically
|
|
|
cba27cf |
* create new patches from the modified git commits: `git format-patch -N --no-stat --no-signature <newversion> && mv *.patch ..`
|
|
|
7f0368f |
* update `Version`, `Release`, `%changelog` and tarball NVRs in the specfile
|
|
|
cba27cf |
* create bundles and manifest: `./create_bundles_in_container.sh`
|
|
|
cba27cf |
* inspect the vendor tarball for any new non-FIPS crypto (`vendor/golang.org/x/crypto`), delete these files/directories in the Makefile and update the `patch-removed-backend-crypto.patch` if required
|
|
|
6b8f02a |
* update specfile with contents of the `.manifest` file
|
|
|
f922bfd |
* update the manpages patch in `0002-add-manpages.patch` and other patches if required
|
|
|
7a1a656 |
* run local build: `rpkg local`
|
|
|
cba27cf |
* run rpmlint: `rpmlint -r grafana.rpmlintrc /tmp/rpkg/grafana-*/grafana-*.src.rpm /tmp/rpkg/grafana-*/x86_64/grafana-*.x86_64.rpm`
|
|
|
3557495 |
* run a scratch build: `fedpkg scratch-build --srpm`
|
|
|
8b048a5 |
* upload new source tarballs: `fedpkg new-sources *.tar.gz *.tar.xz`
|
|
|
7f0368f |
* commit new `sources` file
|
|
|
35e322c |
|
|
|
b3f6907 |
## Patches
|
|
|
35e322c |
* create the patch
|
|
|
35e322c |
* declare and apply (`%prep`) the patch in the specfile
|
|
|
35e322c |
* if the patch affects Go or Node.js dependencies, or the webpack
|
|
|
b5e14d4 |
* update the `create_bundles.sh` script and apply the patch
|
|
|
7f0368f |
* create new tarballs
|
|
|
b3f6907 |
* update the specfile with new tarball name and contents of the `.manifest` file
|
|
|
35e322c |
|
|
|
b3f6907 |
### General guidelines
|
|
|
b3f6907 |
* aim to apply all patches in the specfile
|
|
|
b3f6907 |
* avoid rebuilding the tarballs
|
|
|
7f0368f |
|
|
|
b3f6907 |
Patches fall in several categories:
|
|
|
b3f6907 |
* modify dependency versions
|
|
|
b3f6907 |
* modify both sources and vendored dependencies (e.g. CVEs)
|
|
|
b3f6907 |
* modify the Node.js source (i.e. affect the webpack)
|
|
|
b3f6907 |
* some patches are conditional (e.g. FIPS)
|
|
|
b3f6907 |
|
|
|
b3f6907 |
Patches cannot be applied twice.
|
|
|
b3f6907 |
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.
|
|
|
8515ac3 |
|
|
|
8efab3c |
## Reproducible Bundles
|
|
|
8efab3c |
Run `./create_bundles_in_container.sh` to generate a reproducible vendor and webpack bundle.
|
|
|
8efab3c |
|
|
|
8515ac3 |
## Verification
|
|
|
8515ac3 |
* compare the list of files with the upstream RPM at https://grafana.com/grafana/download
|