Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate source RPMs #3136

Open
2 tasks done
twpayne opened this issue Jan 3, 2022 · 7 comments · May be fixed by #3412
Open
2 tasks done

Generate source RPMs #3136

twpayne opened this issue Jan 3, 2022 · 7 comments · May be fixed by #3412
Assignees
Labels
enhancement New feature or request

Comments

@twpayne
Copy link
Contributor

twpayne commented Jan 3, 2022

Is your feature request related to a problem? Please describe.

@dngray in twpayne/chezmoi#1800 requested that a project released with Goreleaser should be available in Copr. Copr builds RPMs for multiple RedHat-like distributions, and takes a source RPM (.src.rpm) from a public website as input.

Right now, Goreleaser (building on nfpm) builds RPMs but not source RPMs.

Describe the solution you'd like

I would like Goreleaser to build source RPMs as an additional output.

Describe alternatives you've considered

  • Adding custom code to my project's release process to generate the source RPM.
  • Not implementing the user-requested feature.

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

I would be happy to implement this if you think it's a good idea.

@caarlos0
Copy link
Member

caarlos0 commented Jan 3, 2022

not sure how much effort is required for this, will have to investigate...

@caarlos0 caarlos0 transferred this issue from goreleaser/goreleaser Jan 7, 2022
@caarlos0
Copy link
Member

caarlos0 commented Jan 7, 2022

cc/ @goreleaser/nfpm thoughts?

@erikgeiser
Copy link
Member

I'm not really sure how source RPMs look internally and I always find it hard to find good documentation that is useful for implementers instead of users. Are they structured differently from regular RPMs or do they only differ in their contents (e.g. source code instead of binaries and build scripts instead of install scripts)? I they differ only in content I guess they can be built with nfpm as-is. If they only have some additional RPM tags I guess we could maybe also expose them in the RPM specific nfpm config. Larger structural differences would probably be harder to handle through rpmpack.

However, my personal vision of nfpm is to be able to be able to take advantage of the upsides of the Linux packaging infrastructure without worrying about all the idiosyncrasies. With my current limited understanding I'd count source RPM to those idiosyncrasies. So for such features it would be beneficial discuss nfpm's vision.

@twpayne
Copy link
Contributor Author

twpayne commented Apr 24, 2022

My understanding is that SRPM packages are tar archives with the source archive in a SOURCES/ subdirectory and a .spec file in a SPECS/ subdirectory. GoReleaser already generates source archives. It should be possible to generate the .spec file from the existing data in GoReleaser's configuration file.

Note that the dependency on the source archive means that this functionality might need to be implemented in GoReleaser, not in nfpm.

@erikgeiser
Copy link
Member

In this case, this should probably be a goreleaser feature rather than an nfpm feature my opinion, although I do see that there could be an argument for the opposite.

@twpayne
Copy link
Contributor Author

twpayne commented May 28, 2022

Should this issue be transferred back to goreleaser?

@caarlos0 caarlos0 transferred this issue from goreleaser/nfpm May 30, 2022
@caarlos0 caarlos0 added the enhancement New feature or request label Jun 23, 2022
@twpayne twpayne linked a pull request Sep 28, 2022 that will close this issue
8 tasks
@hickford
Copy link

FWIW you don't need source rpms to package a Go module on Fedora COPR, a spec file is enough. Fedora recommends you generate the spec file with go2rpm. This worked for me.

Debian have a similar command dh-make-golang to package Go modules https://go-team.pages.debian.net/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants