[CMake] Re: CMake, CPack, RPM

kent williams nkwmailinglists at gmail.com
Thu Oct 11 09:22:53 EDT 2007


Thanks for your prompt reply.  To some extent you're answering
questions that come from me being an RPM newbie.

My problem with the Source RPM generation is that it requires that my
system -- the one building the source RPM, doesn't have CMake
installed as an RPM.    When I try and generate the source RPM, the
build process fails because it doesn't detect a CMake RPM package on
my system.

It would seem to me that the dependencies of the Source RPM shouldn't
affect the system building the RPM this way.  I should be able to
generate the source RPM, specify that I need ITK, VTK, KWWidgets, and
CMake.

Is CPack/CMake complaining about this or is it rpmbuild? If it's
rpmbuild, there's not much we can do, but it seems spurious to require
the building system to have RPMs installed that won't be needed until
the target system tries to build the RPM.

On 10/11/07, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2007/10/10, kent williams <nkwmailinglists at gmail.com>:
> > OK, so... if I use the built in RPM generator it will generate an RPM.
> >  It isn't clear to me what ends up in that RPM aside from the files in
> > the manifest -- no dependencies seem to be mentioned.
>
> That's almost true.
> RPM generator cannot guess your dependencies and
> will package all files which are INSTALL(....) in your CMakeLists.txt files.
> You'll get some dependencies because CPack RPM use
> rpmbuild command to build the RPM and this command
> try it's best to add "guessable" binary dependencies.
>
> > Using UseRPMTools.cmake to try and generate a source RPM doesn't work
> > so hot. You can only make a source RPM if there's a package 'cmake' in
> > the RPM database apparently. If you haven't installed such an RPM (and
> > I'm not sure who installs CMake from an RPM) you're SOL, even if you
> > do have CMake installed and available.
>
> The specs file generated by UseRPMTools
> include the requirement:
>
> BuildRequires:  cmake
>
> This is "logical" since the Source RPM you will build
>  precisely WILL NEED cmake to produce the binary RPM.
>
> Many RPM based distros I know DO provide cmake prebuilt RPM.
> I don't yours but you may try: http://rpm.pbone.net/ in order
> to see if you can find one.
>
> >
> > Which is kind of a cart-before-horse situation.  Obviously you have
> > CMake installed, if you're using CMake to build the RPM.  On the other
> > hand, you probably should require CMake as a prerequisite.
>
> You get it.
> That's why CPack builtin RPM don't put *any* requirement,
> using CPack buitlin RPM you should be able to build a binary RPM
> (including CMake RPM itself if you compile CMake yourself).
>
>
> > This particular program requires ITK, VTK, KWWidgets, (header and
> > libs) and CMake (executable) at a minimum for a source distribution.
> > For a binary distribution you don't need CMake, but you do need all
> > the SO Libraries from ITK, VTK, KWWidgets.  Not sure how I'd put that
> > into the spec files.
>
> If you use either CPack built-in RPM or UseRPMTools macro
> you are able to specify your own .spec file which may include
> your requirement.
> See http://wiki.rpm.org/Docs for informations about the content
> of a spec file.
>
> For example for RPMTools:
>
> RPMTools_ADD_RPM_TARGETS(packagename)
>
> will generate a "minimal" spec file for you
> whereas
> RPMTools_ADD_RPM_TARGETS(packagename ${CMAKE_SOURCE_DIR}/package.spec)
>
> will use the provided spec file.
>
> Using CPack built-in RPM
> SET(RPM_USER_BINARY_SPECFILE <pathto_specfile>)
> will provide the user spec file to the generator.
> Currently this may not work because:
> http://www.cmake.org/pipermail/cmake/2007-September/016606.html
>
> The trouble is that nor CPack nor UseRPMTools may guess
> the requirement you probably "manually" set-up using
> a bunch of FIND_PACKAGE + TARGET_LIBRARY +...
>
> May be I can think about a way to "only specify" dependencies
> and not the "whole spec file".
>
> I don't know if I would have time for working on this, by the end of this week
> but I may give it a try next week.
>
> --
> Erk
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list