[CMake] DEB and RPM Generation?

David Cristian auledoom at gmail.com
Fri Dec 2 14:28:13 EST 2011


Thanks Eric

2011/12/2 Eric Noulard <eric.noulard at gmail.com>

> 2011/12/2 David Cristian <auledoom at gmail.com>:
> > Thanks for your quick response!
> >
> > I'll have all this things in consideration, specially wrong dependencies
> and
> > libs version.
> > I'll plan to test packages on vbox for others distros, my project isn't
> big
> > or complex (just a few dependencies), and I'll guess binary libs
> > compatibility isn't and issue between minor versions.
>
> Most of the time cross-packaging (packaging one one distro for
> another) works for simple project.
> Binary lib-x.y dep is usually ok for 'y' until one distro does x=x+1.
>
> My opinion w.r.t. cross-packaging is that unless you don't want your
> user to have the source
> it's better to invest time in order to have a fully automatized
> package build procedure
> than trying to cross-package yourself.
> This way your users build their own package on their target system.


I'll agree, and cmake actually does a very good job automating package
creation, even if isn't the same as creating a package using the official
guidelines provided on every distro,  it's getting better and closer on
every release.
I'm just learning cmake and i'm really impressed about it's potential, like
creating win32 app and nsis installer on debian without issues, no need of
rebooting or open an vmbox like i used to do :P
I'm just wanted to know how close you could go cross-compiling binaries for
the most common platforms and then create packages for most common distros
in just one step, even if it isn't optimal and knowing that it isn't the
way cmake it's intended to work.
Happens it may help indie devs (like me) who may work on personal stuff on
it's reduced free time, to easy the distribution of every project release.
We have to consider the term 'user' here, there are more and more casual
user who uses linux distros because it's open philosophy and don't have a
clue about what a terminal console it is, I can't just say ok just download
the source, configure, build and install (said WHAT?!??!)
Cmake allows me now (thanks to ExternalProjectAdd) to download from git,
apply my patches, build for different systems and architectures and create
packages in just two steps. So most important, share my alpha state work
with most possible people and have much appreciated feedback and bugs
reports.. just like M$ does :P

> I'm using components and works ok with nsis as single package, but with
> > debian merge all components in one package,
>
> This is the default backward compatible behavior.
> RPM, DEB and Archive generators (TGZ, ZIP, TBZ2, ...)
> are all component-aware but you have to tell them to do component
> packaging by setting
>
> CPACK_<GENNAME>_COMPONENT_INSTALL to ON
>
> i..e
> set(CPACK_DEB_COMPONENT_INSTALL ON) will tell CPackDEB to generate
> several deb packages
> depending on the components specification.
>

I was setting CPACK_*DEBIAN*_COMPONENT_INSTALL.... ...  .... fixed!

Unlike NSIS those generators do generate *several* files/packages so
> that you have to tell them
> how you want to gather components into package files.
>
> see the description here:
>
> http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#Controlling_Differents_Ways_of_packaging_components
>
> You can set those CPACK_xxxx specific variables either in your
> CMakeLists.txt or in a
> CPACK_PROJECT_CONFIG_FILE
> see:
>
> http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29
>

CPack project config file may be necessary for Archive Generators which
> share
> the CPACK_ARCHIVE_COMPONENT_INSTALL variable.
> i.e. setting it to true will make *ALL* Archive generators produce
> component packages.
>
> If you want a monolithic for ZIP and component package for TGZ then you
> have
> to set CPACK_ARCHIVE_COMPONENT_INSTALL selectively (depending on the
> generator actual name)
> in a CPack project config file.
>

 This must be relatively new, i don't remember to have read all this!!

> i read the links you mention about Component Installation,
> > the official documentation say CMAKE support
> > package per component creation everything excepts DEB,
>
> where did you read that, what do you mean by "official documentation" ?
> If this is the Wiki page:
>
> http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#CPack_Generator_specific_behavior
> it is out-dated (for DEB) I'll update it.
> > but http://public.kitware.com/Bug/view.php?id=11655 says otherwise,
>
> This one was closed for 2.8.5.
>
> > i have the last version installed.
>
> By last version you mean 2.8.6 ?


Nop, sorry my mistake, I have 2.8.5 on Ubuntu Oneiric; assuming  2.8.6 will
come with the next ubuntu release. So i just build it from source.

Thanks again Eric for all your recomendations

-- 
"Seamos Realistas y Hagamos lo Imposible"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111202/75178d78/attachment-0001.htm>


More information about the CMake mailing list