-
Notifications
You must be signed in to change notification settings - Fork 24
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
RPM %define support attempt #12
base: master
Are you sure you want to change the base?
Conversation
Added support for %define lines in the RPM spec file. To use them, add in a defineStatements tag with define tags specifying the values to use for %define lines: <configuration> <rpm> <defineStatements> <define>_source_filedigest_algorithm md5</define> <define>_binary_filedigest_algorithm md5</define> <define>_source_payload w9.gzdio</define> <define>_binary_payload w9.gzdio</define> </defineStatements> ... </configuration>
That seems like a reasonable approach. I'm not very used to RPM stuff, but I'm wondering if it might better to have a simple include mechanism so people can include anything into the spec file? Something like:
It makes it possible to add any kind of stuff they want. |
Including an external file makes a LOT of sense for the %pre, %prep, %post, %install, etc. script sections, as having those inside the pom would be painful. SpecFile.java has what looks to be the necessary pieces in it already for nearly all the valid portions of an RPM SPEC file, but there aren't any means of getting values from the pom file through the plugin so that they can be used. As it was already there, I tried to do the minimum amount of code to reasonably expose the mechanism for setting %define values. |
The pre/post install/remove is already supported and works fine, I was more wondering about other parts of the spec file that the plugin doesn't care much about. The SpecFile is just the DAO object, but your patch itself seems fine. If you want to copy stuff from the file system or access the Maven project the RpmUnixPackage.prepare() where that should happen. What is the define stuff used for in RPMs? Do you know if there are equivalent features in the deb format? |
1 similar comment
The pre/post install/remove is already supported and works fine, I was more wondering about other parts of the spec file that the plugin doesn't care much about. The SpecFile is just the DAO object, but your patch itself seems fine. If you want to copy stuff from the file system or access the Maven project the RpmUnixPackage.prepare() where that should happen. What is the define stuff used for in RPMs? Do you know if there are equivalent features in the deb format? |
For RPM land, the %define directive allows creating macros and setting variable values for use in the SPEC file. In some cases these influence the RPM building behavior. For the example I used:
Those settings change the hash generation and compression used for RPM creation so that they are compatible with RHEL 5 (and 4, etc., I think) when created on a RHEL 6 system and it's newer hash and compression settings. I've had to do some reading, as I knew nothing about Debian packages (and know only a tiny bit now), and it looks like |
I can't claim I fully know what I'm doing, but some hacking on the code resulted in what appears to not break things, as the tests pass Let me know your thoughts?
To use the %define support, add in a defineStatements tag with define tags specifying the values to use for %define lines: