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

Make rpmbuild module work on non-RPM based GNU/Linux systems #34056

Merged
merged 2 commits into from
Jun 17, 2016
Merged

Make rpmbuild module work on non-RPM based GNU/Linux systems #34056

merged 2 commits into from
Jun 17, 2016

Conversation

vutny
Copy link
Contributor

@vutny vutny commented Jun 16, 2016

What does this PR do?

Allows to build rpms and make YUM repositories on Debian operating systems.

I've successfully built rpm package and created a repository on Debian machine by installing the required tools using this sls:

Install rpmbuild tools:
  pkg.install:
    - pkgs:
      - createrepo
      - mock
      - python-gnupg

What issues does this PR fix or reference?

None.

Previous Behavior

The rpmbuild execution module doesn't load on Debian GNU/Linux minion.

New Behavior

The rpmbuild execution module and pkgbuild state works on Debian.

Tests written?

No

@thatch45
Copy link
Contributor

We can't take this because it will cause an error with the Debian package build module, this will cause the Debian and the redhat pkgbuild modules to collide since they abstract a virtual interface. If you return the string 'rpmbuild' then it will be ok.

@vutny
Copy link
Contributor Author

vutny commented Jun 17, 2016

Thank you @thatch45 !

Indeed, I haven't thought that if all dependencies met for both debbuild and rpmbuild modules there would be a collision.
Also, it seems that you could build RPM packages "natively" not only on RHEL clones, but on Suse Linux as well, which is RPM-based OS. So rpmbuild should be exposed as virtual module pkgbuild on Suse. I haven't tested it, but I see no problem here, tools are the same.

On the other hand, rpm packages and repositories potentially could be created on any other non-RPM based GNU/Linux distro if you install necessary tools and Python module... In this case the __virtual__ function in rpmbuild.py module would return rpmbuild string instead of pkgbuild.

I've also changed pkgbuild state module, so it will call appropriate function from rpmbuild (virtual) module on non-RPM platforms if the one would provide RPM package as a result of pkgbuild.build state argument or a directory with *.rpm file in it to pkgbuild.repo state.

Please review my last commit.

@vutny vutny changed the title Make rpmbuild module work on Debian GNU/Linux and derivatives Make rpmbuild module work on non-RPM based GNU/Linux systems Jun 17, 2016
@vutny
Copy link
Contributor Author

vutny commented Jun 17, 2016

Updated PR subj. Test failures seems not related to my changes...

@@ -7,7 +7,7 @@
This system allows for all of the components to build rpms safely in chrooted
environments. This also provides a function to generate yum repositories

This module impliments the pkgbuild interface
This module implements the pkgbuild interface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't make spelling mistakes as often as I used to, thanks!

@thatch45
Copy link
Contributor

Masterfully done! Thanks!

@thatch45 thatch45 merged commit 52b8522 into saltstack:2016.3 Jun 17, 2016
@vutny vutny deleted the rpmbuild-support-debian branch June 21, 2016 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants