rpmbuild icon indicating copy to clipboard operation
rpmbuild copied to clipboard

Spec file with variable such as 'version' - how do we pass them?

Open strus38 opened this issue 5 years ago • 3 comments

Hi Trying to build my spec file, it contains: %{!?version: %define version 1.2.0} ... I tried to pass the version as an env variable to the container, but it is ignored: - name: build RPM package id: rpm_build uses: naveenrajm7/rpmbuild@master env: version: 1.4.0 ... So how should I do? Thanks!

strus38 avatar Apr 15 '20 17:04 strus38

Hi @strus38 , Thanks for trying out this Action. Currently, I rely on spec file for creating the source required by rpmbuild. Here is how it works in a nutshell

  1. Parse spec file get Name & Version
  2. Get repo contents and create a Source file with name <name>-<version>.tar.gz (move it to rpmbuild/SOURCE)
  3. Run rpmbuild
  4. Pass directory path for rpmbuild/RPMS and file path for rpmbuild/SRPMS as output , So it can be used by other Actions (like To Upload Release Asset or as Upload Artifact)

I do want to support multiple arguments in future versions like

  • Name & Version of RPM package
  • Any BuildRequires that need to be installed to create RPM .

As a quick response I can make version support by this week. If you would like to Contribute or give Suggestions , Please feel free to do so . Thanks!

naveenrajm7 avatar Apr 15 '20 18:04 naveenrajm7

Hi

That explains why I see %{version} everywhere, and not the value I am passing through! Thanks. Concerning your proposal, that would be great indeed, but I currently not have time to fork and propose a pull request to you. So whenever you are ready, it will be perfect. Thanks!

Le mer. 15 avr. 2020 à 20:52, Naveenraj M [email protected] a écrit :

Hi @strus38 https://github.com/strus38 , Thanks for trying out this Action. Currently, I rely on spec file for creating the source required by rpmbuild. Here is how it works in a nutshell

  1. Parse spec file get Name & Version
  2. Get repo contents and create a Source file with name -.tar.gz (move it to rpmbuild/SOURCE)
  3. Run rpmbuild
  4. Pass directory path for rpmbuild/RPMS and file path for rpmbuild/SRPMS as output , So it can be used by other Actions (like To Upload Release Asset or as Upload Artifact)

I do want to support multiple arguments in future versions like

  • Name & Version of RPM package
  • Any BuildRequires that need to installed to create RPM .

As a quick response I can make version support by this week. If you would like to Contribute or give Suggestions , Please feel free to do so . Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/naveenrajm7/rpmbuild/issues/1#issuecomment-614217180, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABM6DU7ZMQJJOAF45DRJEITRMX65BANCNFSM4MIX7HZQ .

strus38 avatar Apr 15 '20 18:04 strus38

@strus38 , have you made any updates to support your request? I would like to see this workflow support additional arguments such as, '--undefine=_disable_source_fetch' because sometimes the SOURCES tarball is downloaded directly from a http URL. I don't see any way that we can pass rpmbuild command line options but your suggestion implies that it's possible with a PR from you. Thoughts?

bschonec avatar Jan 04 '24 20:01 bschonec