How can I package some plugins into rpm package for local install?

I have to install grafana rpm offline in our customer’s machine, and I can not install plugins via "
grafana-cli plugins install grafana-piechart-panel". So I want to build a custom rpm install package with these plugins. I found there is a folder in source code “”. Is there any doc to introduce how to add external plugin in source code and then build and package into a rpm release package?
Found some clue at