Re: [CMake] DEB and RPM Generation?

2011-12-02 Thread David Cristian
Thanks Eric

2011/12/2 Eric Noulard 

> 2011/12/2 David Cristian :
> > 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__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_ 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"
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmak

Re: [CMake] DEB and RPM Generation?

2011-12-01 Thread Eric Noulard
2011/12/2 David Cristian :
> 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'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__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.

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_ 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.

> 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 ?


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] DEB and RPM Generation?

2011-12-01 Thread David Cristian
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.

I'm using components and works ok with nsis as single package, but with
debian merge all components in one package, i read the links you mention
about Component Installation, the official documentation say CMAKE support
package per component creation everything excepts DEB, but
http://public.kitware.com/Bug/view.php?id=11655 says otherwise, i have the
last version installed.

But again thanks a lot. If isn't ready ill just have to wait, no problem.

2011/12/1 Eric Noulard 

> 2011/12/1 David Cristian :
> > Hello devs!
> >
> > I've searh the net with no result, i have a project builds various apps
> and
> > libs, i managed to use cmake/cpack to build and create packages for win32
> > and debian and i have two questions.
> >
> > 1 First, it's posibible to build a deb package and rpm simultaneusly
> from a
> > CMAKELists.txt? Can I set more than one generator ?
>
> Yes it is, just set CPACK_GENERATOR
> with the list of generator you want:
>
> SET(CPACK_GENERATOR "TGZ;RPM;DEB")
>
> would create TGZ, RPM and DEB.
> Note however that:
>  - some generator suppose you have some tools installed
>which not be available on the host platform.
>e.g. CPackRPM requires "rpmbuild" command
>which may not be installed on a debian-based distro.
>
>  - building an RPM on debian and installing it on
>Fedora may not work (wrong dependencies or library version etc...).
>It's usually safe to build the package
>on the same kind of host you will be installing it.
>
>  - you may have to set the list of Generator depending
>on the Platform (i.e. RPM Generator is not available on Windows)
>something like:
>if(WIN32)
>set(CPACK_GENERATOR "NSIS;ZIP")
>else()
>set(CPACK_GENERATOR "TGZ;RPM;DEB")
>endif()
>
> > 2. Can I include CPACK multiple times to generate various set of packages
> > (myproject.deb, myproject-data.deb, myprojectlibs.deb?
>
> Nope you can't currently do that:
> http://public.kitware.com/Bug/view.php?id=10751
>
> Currently you may build several package in the same build if you
> use COMPONENT installation:
>
> http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#Principles_of_CPack_Component_Packaging
>
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
>



-- 
"Seamos Realistas y Hagamos lo Imposible"
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] DEB and RPM Generation?

2011-12-01 Thread Eric Noulard
2011/12/1 David Cristian :
> Hello devs!
>
> I've searh the net with no result, i have a project builds various apps and
> libs, i managed to use cmake/cpack to build and create packages for win32
> and debian and i have two questions.
>
> 1 First, it's posibible to build a deb package and rpm simultaneusly from a
> CMAKELists.txt? Can I set more than one generator ?

Yes it is, just set CPACK_GENERATOR
with the list of generator you want:

SET(CPACK_GENERATOR "TGZ;RPM;DEB")

would create TGZ, RPM and DEB.
Note however that:
  - some generator suppose you have some tools installed
which not be available on the host platform.
e.g. CPackRPM requires "rpmbuild" command
which may not be installed on a debian-based distro.

  - building an RPM on debian and installing it on
Fedora may not work (wrong dependencies or library version etc...).
It's usually safe to build the package
on the same kind of host you will be installing it.

  - you may have to set the list of Generator depending
on the Platform (i.e. RPM Generator is not available on Windows)
something like:
if(WIN32)
set(CPACK_GENERATOR "NSIS;ZIP")
else()
set(CPACK_GENERATOR "TGZ;RPM;DEB")
endif()

> 2. Can I include CPACK multiple times to generate various set of packages
> (myproject.deb, myproject-data.deb, myprojectlibs.deb?

Nope you can't currently do that:
http://public.kitware.com/Bug/view.php?id=10751

Currently you may build several package in the same build if you
use COMPONENT installation:
http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#Principles_of_CPack_Component_Packaging


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake