<div dir="ltr">2016-12-20 21:53 GMT+01:00 Paul Londino <span dir="ltr"><<a href="mailto:londinop@gmail.com" target="_blank">londinop@gmail.com</a>></span>:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I am trying to create an RPM package using CPack. I am having trouble<br>
packaging the documentation. There is a custom target that generates<br>
HTML using DoxyGen (in a folder called html), and this gets installed<br>
to /usr/doc/share during the packaging process. However, this<br>
generates 12,000+ files which are all added individually to the .spec<br>
file.<br>
<br>
What I would like to do is just add the whole doc directory to the RPM<br>
package using the %doc attribute so the RPM correctly installs this in<br>
the package-named subfolder of /usr/share/doc and marks it as<br>
documentation. I experimented with the<br>
CPACK_RPM_EXCLUDE_FROM_AUTO_<wbr>FILELIST variable but this doesn't seem to<br>
work on a wildcard basis and excluding all 12,000 generated files by<br>
hand does not seem practical. Also, I was able to generate the %doc<br>
attribute using CPACK_RPM_USER_FILELIST, but I believe in order to<br>
have the auto-generated doc dir, it needs to be a relative path<br>
instead of absolute, which I had problems setting using the CMAKE<br>
variable (this could be more an RPM issue than a CMAKE one).<br>
<br>
Any ideas in the best way to achieve what I'm trying to do? I could<br>
try using a custom .spec file but there is a lot of value in the<br>
automatically generated one from the CMake, so I would prefer to use<br>
that if possible.<br></blockquote><div><br></div><div>I don't believe that CPack/RPM can currently do what you want.<br><br>CPACK_RPM_EXCLUDE_FROM_AUTO_<wbr>FILELIST is not intended to be used for removing an entire list of files so it doesn't support wildcards - it is meant to be used to exclude directory paths from being tracked by rpm and deleted during rpm package uninstall.<br></div><div><br></div><div>Why exactly do you want to remove all those files? Spec file size or something else?<br></div><div>If you write something like this:<br></div><div><br>install(FILES CMakeLists.txt DESTINATION x/maabc COMPONENT test RENAME manx.txt)<br></div></div>install(FILES CMakeLists.txt DESTINATION x/maabc COMPONENT test RENAME many.txt)<br><br>set(CPACK_RPM_USER_FILELIST<br>  "%doc /usr/x"<br>  )<br><br></div><div class="gmail_extra">Where /usr is packaging install prefix (this part could be replaced with a variable so that it depends on for e.g. CPACK_PACKAGING_INSTALL_PREFIX or some other path).<br><br></div><div class="gmail_extra">And then expect the generated package with (listing only files marked with %doc):<br><br></div><div class="gmail_extra">rpm -qpld <your_rpm_package_name><br><br></div><div class="gmail_extra">You'll get both files in that subdirectory flagged with %doc and I believe that that's what you'd like to achieve.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">If for some reason you'd really like to remove those files from spec file you'll either have to patch your CPackRPM.cmake or write your own spec file. If that's the case then please explain the reasons a bit further and if it would be useful for others it could be added to a later CPackRPM release.<br><br></div><div class="gmail_extra">Regards,<br></div><div class="gmail_extra">Domen<br></div></div>