CPACK_PACKAGE_DESCRIPTION_FILE for debian

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CPACK_PACKAGE_DESCRIPTION_FILE for debian

Erik Hofman

Hi,

I'm new to this list and just recently started to use CMake and CPack.
So far I'm very pleased but there's one thing that I think could use
some improvement;

As far as I van see (from Wiki) the RPM generating backend of CPack uses
CPACK_PACKAGE_DESCRIPTION_FILE if CPACK_RPM_PACKAGE_DESCRIPTION is not
provided, but the Debian backend does not use
PACK_PACKAGE_DESCRIPTION_FILE in any way although adding it is just a
three line patch:

 file(STRINGS description descriptionFile)
 STRING(REGEX REPLACE ";" " " descriptionFile "${descriptionFile}")
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${descriptionFile})

It would be nice if this is the default behavior for all backends.

Regards,

Erik

--

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
Reply | Threaded
Open this post in threaded view
|

Re: CPACK_PACKAGE_DESCRIPTION_FILE for debian

Eric Noulard
2011/11/1 Erik Hofman <[hidden email]>:
>
> Hi,
>
> I'm new to this list and just recently started to use CMake and CPack.
> So far I'm very pleased but there's one thing that I think could use
> some improvement;
>
> As far as I van see (from Wiki) the RPM generating backend of CPack use

You can get up to date doc with

cmake --help-module CPackRPM
same for
cmake --help-module CPackDeb

> CPACK_PACKAGE_DESCRIPTION_FILE if CPACK_RPM_PACKAGE_DESCRIPTION is not
> provided, but the Debian backend does not use
> PACK_PACKAGE_DESCRIPTION_FILE in any way although adding it is just a
> three line patch:
>
>  file(STRINGS description descriptionFile)
>  STRING(REGEX REPLACE ";" " " descriptionFile "${descriptionFile}")
>  SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${descriptionFile})

You could even do this is a single line:

file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_PACKAGE_DESCRIPTION_SUMMARY)

Your point is good,
Could you open a bug report,
http://public.kitware.com/Bug/bug_report_page.php

then attach your proposed patch (probably from withing CPackDeb.cmake)

I'll review it and probably merge it soon, since this looks reasonable.
Note however that with CPackRPM you have both

CPACK_RPM_PACKAGE_SUMMARY
and
CPACK_RPM_PACKAGE_DESCRIPTION

whereas for DEB you don't have summary, just:
CPACK_DEBIAN_PACKAGE_DESCRIPTION

thus the difference

> It would be nice if this is the default behavior for all backends.

We would have to review other CPack generators behavior w.r.t.
CPACK_PACKAGE_DESCRIPTION_SUMMARY
CPACK_PACKAGE_DESCRIPTION_FILE

as you can see with RPM and Deb some may use both for the same meaning
some really wants separate usage.

Waiting for your patch :-]
--
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
Reply | Threaded
Open this post in threaded view
|

Re: CPACK_PACKAGE_DESCRIPTION_FILE for debian

Erik Hofman
On Tue, 2011-11-01 at 11:47 +0100, Eric Noulard wrote:

> I'll review it and probably merge it soon, since this looks reasonable.
> Note however that with CPackRPM you have both
>
> CPACK_RPM_PACKAGE_SUMMARY
> and
> CPACK_RPM_PACKAGE_DESCRIPTION
>
> whereas for DEB you don't have summary, just:
> CPACK_DEBIAN_PACKAGE_DESCRIPTION
>
> thus the difference
>
> > It would be nice if this is the default behavior for all backends.
>
> We would have to review other CPack generators behavior w.r.t.
> CPACK_PACKAGE_DESCRIPTION_SUMMARY
> CPACK_PACKAGE_DESCRIPTION_FILE
>
> as you can see with RPM and Deb some may use both for the same meaning
> some really wants separate usage.

I seems even more complicated, according to the wikie there is:
CPACK_PACKAGE_DESCRIPTION_SUMMARY * Package short description

CPACK_PACKAGE_DESCRIPTION
* Package long description

But the DEBIAN backend uses CPACK_PACKAGE_DESCRIPTION_SUMMARY for the
long description.

I was going to take a look at it but now I'm afraid there is no
consistent way to handle this without braking backwards compatibility.

What I was aiming for was:
CPACK_PACKAGE_DESCRIPTION_SUMMARY * Package short description

CPACK_PACKAGE_DESCRIPTION
* Package long description

CPACK_PACKAGE_DESCRIPTION_FILE
* file containing the package long description

if PACK_PACKAGE_DESCRIPTION was not set but
CPACK_PACKAGE_DESCRIPTION_FILE was then do:

file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_PACKAGE_DESCRIPTION)

But as I said, that would break backward compatibility (change in
behavior).

Erik




--

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
Reply | Threaded
Open this post in threaded view
|

Re: CPACK_PACKAGE_DESCRIPTION_FILE for debian

Eric Noulard
2011/11/2 Erik Hofman <[hidden email]>:

> On Tue, 2011-11-01 at 11:47 +0100, Eric Noulard wrote:
>> I'll review it and probably merge it soon, since this looks reasonable.
>> Note however that with CPackRPM you have both
>>
>> CPACK_RPM_PACKAGE_SUMMARY
>> and
>> CPACK_RPM_PACKAGE_DESCRIPTION
>>
>> whereas for DEB you don't have summary, just:
>> CPACK_DEBIAN_PACKAGE_DESCRIPTION
>>
>> thus the difference
>>
>> > It would be nice if this is the default behavior for all backends.
>>
>> We would have to review other CPack generators behavior w.r.t.
>> CPACK_PACKAGE_DESCRIPTION_SUMMARY
>> CPACK_PACKAGE_DESCRIPTION_FILE
>>
>> as you can see with RPM and Deb some may use both for the same meaning
>> some really wants separate usage.
>
> I seems even more complicated, according to the wikie there is:
> CPACK_PACKAGE_DESCRIPTION_SUMMARY       * Package short description
>
> CPACK_PACKAGE_DESCRIPTION
> * Package long description
>
> But the DEBIAN backend uses CPACK_PACKAGE_DESCRIPTION_SUMMARY for the
> long description.
>
> I was going to take a look at it but now I'm afraid there is no
> consistent way to handle this without braking backwards compatibility.
>
> What I was aiming for was:
> CPACK_PACKAGE_DESCRIPTION_SUMMARY       * Package short description
>
> CPACK_PACKAGE_DESCRIPTION
> * Package long description
>
> CPACK_PACKAGE_DESCRIPTION_FILE
> * file containing the package long description
>
> if PACK_PACKAGE_DESCRIPTION was not set but
> CPACK_PACKAGE_DESCRIPTION_FILE was then do:
>
> file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_PACKAGE_DESCRIPTION)
>
> But as I said, that would break backward compatibility (change in
> behavior).

I think this one is acceptable since it may be considered a bug
(you may open one exactly for that purpose)
 to use summary when you  expect full 'description'.

The then almost backward compatible algorithm would be:

1) use CPACK_PACKAGE_DESCRIPTION if it is defined
2) if not use CPACK_PACKAGE_DESCRIPTION_FILE if it is defined
3) if not use CPACK_PACKAGE_DESCRIPTION_SUMMARY

I bet that most people that do use CPACK_PACKAGE_DESCRIPTION_[FILE]
won't mind having it replace the CPACK_PACKAGE_DESCRIPTION_SUMMARY
in deb package description.

Those not using the previous will keep their current
CPACK_PACKAGE_DESCRIPTION_SUMMARY usage.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: CPACK_PACKAGE_DESCRIPTION_FILE for debian

Erik Hofman
On Wed, 2011-11-02 at 10:59 +0100, Eric Noulard wrote:

> I think this one is acceptable since it may be considered a bug
> (you may open one exactly for that purpose)
>  to use summary when you  expect full 'description'.
>
> The then almost backward compatible algorithm would be:
>
> 1) use CPACK_PACKAGE_DESCRIPTION if it is defined
> 2) if not use CPACK_PACKAGE_DESCRIPTION_FILE if it is defined
> 3) if not use CPACK_PACKAGE_DESCRIPTION_SUMMARY
>
> I bet that most people that do use CPACK_PACKAGE_DESCRIPTION_[FILE]
> won't mind having it replace the CPACK_PACKAGE_DESCRIPTION_SUMMARY
> in deb package description.
>
> Those not using the previous will keep their current
> CPACK_PACKAGE_DESCRIPTION_SUMMARY usage.

Okay, I'll look into this.

Erik


--

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