fedora-java / javapackages

Macros and scripts for Java packaging support
Other
7 stars 15 forks source link

Javadoc subpackage generator #19

Closed mizdebsk closed 7 years ago

mizdebsk commented 8 years ago

Long time ago we tried to introduce experimental generator of javadoc subpackages (see 26ebe8d701f53159f10194b43e51891fa1864eda) aimed at reducing boilerplate code in spec files, but it wasn't successful for different reasons.

Since then we added several missing bits that can make it easier to implement such feature:

Therefore lets reconsider adding this feature.

msimacek commented 7 years ago

%license macro - the same license can be reused for javadocs, it was not possible with %doc used for licenses

Do you have any idea how to do that? I don't see any way how to programatically access filelists. I though I could redefine %license macro to capture the licenses in some global variable, but RPM doesn't allow that (ironically, this can be done for %doc, but not for %license).

mizdebsk commented 7 years ago

This should do the trick:

%files javadoc -f .mfiles-javadoc
%{_licensedir}/*
mizdebsk commented 7 years ago

Or even better (will work even when there are no license files installed):

%install
install -d -m 755 %{buildroot}%{_licensedir}

%files javadoc -f .mfiles-javadoc
%{_licensedir}
%exclude %dir %{_licensedir}
msimacek commented 7 years ago

That works, thanks. It should also have %license on %{_licensedir} in order to have RPMFILE_LICENSE flag set. There are some limitations of this approach:

msimacek commented 7 years ago

Solution with a macro that the user explicitly uses:

Fully automatic "solution" (user doesn't specify anything):

mizdebsk commented 7 years ago

The first option (explicit macro invocation) seems fine to me. It has clear migration path and is safer than the other proposal.

Perhaps it could be improved a bit to make the macro more flexible:

Also I would avoid word "Javadoc" in summary/description - it causes rpmlint warning.