<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Le jeu. 22 nov. 2018 à 16:16, Mario Emmenlauer <<a href="mailto:mario@emmenlauer.de">mario@emmenlauer.de</a>> a écri<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
I'm trying to build an RPM with CPack, and everything seems to work,<br>
but the resulting package can not be installed. I get Transaction check<br>
error:<br>
file / from install of <mypackage> conflicts with file from package filesystem-3.2-25.el7.x86_64<br>
file /opt from install of <mypackage> conflicts with file from package filesystem-3.2-25.el7.x86_64<br>
file /usr/bin from install of <mypackage> conflicts with file from package filesystem-3.2-25.el7.x86_64<br>
file /usr/share from install of <mypackage> conflicts with file from package filesystem-3.2-25.el7.x86_64<br>
file /usr from install of <mypackage> conflicts with file from package filesystem-3.2-25.el7.x86_64<br>
<br>
I've read in the CPackRPM source code about how to add excludes and<br>
CPackRPM says that my "Final list of path to OMIT in RPM" would be<br>
/etc;/etc/init.d;/usr;/usr/bin;/usr/include;/usr/lib;/usr/libx32;/usr/lib64;/usr/share;/usr/share/aclocal;/usr/share/doc;/opt;/usr/share/applications<br></blockquote><div><br></div><div>You can read the doc too:</div><div><a href="https://cmake.org/cmake/help/v3.13/cpack_gen/rpm.html#variable:CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST">https://cmake.org/cmake/help/v3.13/cpack_gen/rpm.html#variable:CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST</a><br></div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I can see that the conflicting directories are removed from<br>
CPACK_RPM_INSTALL_FILES. But that does not satisfy rpm :-(<br>
<br>
Could someone shed some light? I believe that the problem may be<br>
my install command: I call install only once for the full tree<br>
of files that I'd like to package:<br>
install(DIRECTORY "${INSTALL_TMP_ROOT}/" DESTINATION "/" USE_SOURCE_PERMISSIONS)<br></blockquote><div><br></div><div>Yep this is looking for trouble.</div><div>How did you build the "${INSTALL_TMP_ROOT}" in the first place?</div><div><br></div><div>Can't you use relative path install DESTINATION ? For all files/target you build?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I have a wild guess that this install somehow includes the<br>
directories, and probably it would be better to just call install<br>
on the individual files? </blockquote><div><br></div><div>CPack RPM tries its best to avoid shipping directories he does not need to ship, but</div><div>RPM requires that any new (non shared) directory should be specified in the spec file,</div><div>so CPackRPM tries to "discover that" automatically and make the package relocatable.</div><div><br></div><div>Installing a whole directory to an absolute DESTINATION (even "/" in you case) is probably </div><div>giving tough time to CPackRPM.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I would prefer not to call install on the<br>
individual files because that overrides file permissions for every<br>
file, and I carefully prepared my package upfront to have the<br>
exact permissions for installation.<br></blockquote><div><br></div><div>How did you "carefully prepared my package upfront" ?</div><div>And what do you mean by</div><div>"because that overrides file permissions for every file"<br></div><div> </div><div>one more question, could you tell us which version of CPack/CMake you are using?</div></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div></div></div></div>