On 18 October 2017 at 14:35, Vít Ondruch vondruch@redhat.com wrote:
Dne 13.10.2017 v 21:49 James Hogarth napsal(a):
On 4 October 2017 at 15:16, James Hogarth james.hogarth@gmail.com wrote:
I have a Facter 3.9.0 package I'm happy with on initial testing. I'll be writing up a F28 self contained change shortly. I've tested puppet in F26 against this and it appears to behave correctly - would appreciate more eyes on it though.
The ruby- subpackage could be noarch IMO.
And it should depend on libfacter.so (probably instead of ruby dependency) ... but this code 'require "#{facter_dir}/lib64/libfacter.so"' is rather unfortunate, because it should not load the unversioned library, since this package belongs to -devel subpackage IMO. You have it in the main package for this reason I suppose, but that is wrong IMO:
https://fedoraproject.org/wiki/Packaging:Guidelines#Devel_Packages
Hmm is it valid to noarch a subpackage? How would it be able to pull in the correct arch'd dependency in that case?
With respect to where the .so is in %files and to that facter/rb requires line ... I tried to change it to the versioned .so and it fails to load it stating that it can't find the file (the fallback failure to load response) so check it exists etc etc ...
If you can make it work with it pointing to the versioned .so I'd be very happy ... I just fell back on what I could get working ;)
The relevant bit of policy surrounding that in the link you provided for this is:
"When in doubt as to whether a file belongs in the base package or in -devel, packagers should consider whether the file is necessary to be present for a user to use or execute the functionality in the base package properly, or if it is only necessary for development. If it is only necessary for development, it must go into a -devel package."
Seeing as I could not carry out a 'require facter' in a test ruby script with a versioned library there instead of the unversioned I figured it fell into the case where it is required to function properly ... and thus the unversioned .so according to the guidelines would fall within facter and not facter-devel
I'm happy to change the requires to require the library specifically rather than facter ... but I don't think that makes much difference beyond pure semantics as the library really needs to be with the facter package anyway as they are nto independently usable.