Package with CMAKE based C library

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

Package with CMAKE based C library

Werner Detter-2
Hi everybody,

I want to package a library, developed in C (libcmime) which is based on cmake. If I'm
right - there should be

a) the main package "libcmime"
/usr/lib/libcmime.so.0.1 (symlink to the next one)
/usr/lib/libcmime.so.0.1.14

b) the dev package "libcmime-dev"
/usr/lib/libcmime.so (symlink to 0.1.19)
/usr/include/cmime/*.h
/usr/lib/pkgconfig/cmime.pc

As this package is the first one with a C library, based on CMAKE for me it would be great if
anyone could point me to a similar package to stud debian/rules

Thanks and cheers,
Werner


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/5446CFC2.90007@...

Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

KI7MT
Hi Werner,

I just finished working up a CMAKE package that has it's own install
target and creates the appropriate directories, manpages etc. I used the
basic dh_* Makefile, and did a couple overrides to account for things
that were performed by the CMakeLists.txt file.

It really depends on what the CMAKE project does as to what your rules
file will end up looking like. This particular project accounts for
Debian builds, as well as Mac OSX and RPM. I used my own version of the
control file though. Im not sure I've done this 100% correct, but It's
building without any Lintian errors or warnings.

You can also use CDBS, but I found it just as easy to use dh_*. I'm sure
the the Debian Mentors can get you sorted out on this. Maybe they can
help me out as well, as I could be out in left field here :-)

Rules File -- I added the comments just so i could see it easy in the
build log

DH_VERBOSE = 1
export DH_OPTIONS=-v

%:
     dh $@ --parallel

# CMakeLists.txt install target creates all the appropriate dir's
override_dh_install:
     @echo
'---------------------------------------------------------------------'
     @echo ' Overiding: dh_install to NULL'
     @echo
'--------------------------------------------------------------------'

# Manpages are build by a Cmake target
override_dh_installman:
     @echo
'---------------------------------------------------------------------'
     @echo ' Overiding: dh_installman to NULL'
     @echo
'---------------------------------------------------------------------'

# Manpages are already compressed
override_dh_compress:
     @echo
'---------------------------------------------------------------------'
     @echo ' Overiding: dh_compress to exclude *.1.gz files'
     @echo
'---------------------------------------------------------------------'
     dh_compress -X1.gz

73's
Greg, KI7MT


On 10/21/2014 03:27 PM, Werner Detter wrote:

> Hi everybody,
>
> I want to package a library, developed in C (libcmime) which is based on cmake. If I'm
> right - there should be
>
> a) the main package "libcmime"
> /usr/lib/libcmime.so.0.1 (symlink to the next one)
> /usr/lib/libcmime.so.0.1.14
>
> b) the dev package "libcmime-dev"
> /usr/lib/libcmime.so (symlink to 0.1.19)
> /usr/include/cmime/*.h
> /usr/lib/pkgconfig/cmime.pc
>
> As this package is the first one with a C library, based on CMAKE for me it would be great if
> anyone could point me to a similar package to stud debian/rules
>
> Thanks and cheers,
> Werner
>
>


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/5446D6DE.7070206@...

Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

Leopold Palomo-Avellaneda
In reply to this post by Werner Detter-2
El Dimarts, 21 d'octubre de 2014, a les 23:27:30, Werner Detter va escriure:

> Hi everybody,
>
> I want to package a library, developed in C (libcmime) which is based on
> cmake. If I'm right - there should be
>
> a) the main package "libcmime"
> /usr/lib/libcmime.so.0.1 (symlink to the next one)
> /usr/lib/libcmime.so.0.1.14
>
> b) the dev package "libcmime-dev"
> /usr/lib/libcmime.so (symlink to 0.1.19)
> /usr/include/cmime/*.h
> /usr/lib/pkgconfig/cmime.pc
>
> As this package is the first one with a C library, based on CMAKE for me it
> would be great if anyone could point me to a similar package to stud
> debian/rules
>
> Thanks and cheers,
> Werner
http://anonscm.debian.org/cgit/debian-science/packages/fcl.git/tree/debian

it's c++ but it could be similar.

Regards,


Leopold

--
--
Linux User 152692     PGP: 05F4A7A949A2D9AA
Catalonia
-------------------------------------
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

Werner Detter-2
In reply to this post by KI7MT
Hi KI7MT,
hi everybody

thanks for your reply - I'm currently building the package with cdbs, debian/rules
right now implements:

#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
#include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/class/cmake.mk
#export DH_VERBOSE = 1

binary-post-install/%::
        dh_installchangelogs CHANGELOG

It build's the package. So far, so good. But I'm still wondering what
needs to be done to split the package into "libcmime" and "libcmime-dev" :)

In other words: how do i tell the packaging process to create two packages and
to put:

/usr/lib/libcmime.so.0.1
/usr/lib/libcmime.so.0.1.14

into the "main" package, and

/usr/lib/libcmime.so (symlink to 0.1.14)
/usr/include/cmime/*.h
/usr/lib/pkgconfig/cmime.pc

into the -dev package


Cheers,
Werner



[1] Currently only one package is created, wich installs the following files:
*) /usr/lib
lrwxrwxrwx  1 root root          15 Oct 21 23:08 libcmime.so -> libcmime.so.0.1
lrwxrwxrwx  1 root root          18 Oct 21 23:08 libcmime.so.0.1 -> libcmime.so.0.1.14
-rw-r--r--  1 root root       89320 Oct 21 23:08 libcmime.so.0.1.14

*) /usr/include/cmime
-rw-r--r--  1 root root  4424 Sep 23 15:55 cmime_address.h
-rw-r--r--  1 root root  3273 Sep 23 15:55 cmime_base64.h
-rw-r--r--  1 root root  1913 Oct 21 23:08 cmime_config.h
-rw-r--r--  1 root root  3716 Sep 23 15:55 cmime_header.h
-rw-r--r--  1 root root  7077 Sep 23 15:55 cmime_list.h
-rw-r--r--  1 root root 19017 Sep 23 15:55 cmime_message.h
-rw-r--r--  1 root root  6872 Sep 23 15:55 cmime_part.h
-rw-r--r--  1 root root  3166 Sep 23 15:55 cmime_qp.h
-rw-r--r--  1 root root  3894 Sep 23 15:55 cmime_string.h
-rw-r--r--  1 root root  2942 Sep 23 15:55 cmime_util.h

*) /usr/lib/pkgconfig/libcmime.pc


Am 21.10.14 23:57, schrieb ki7mt:

> Hi Werner,
>
> I just finished working up a CMAKE package that has it's own install
> target and creates the appropriate directories, manpages etc. I used the
> basic dh_* Makefile, and did a couple overrides to account for things
> that were performed by the CMakeLists.txt file.
>
> It really depends on what the CMAKE project does as to what your rules
> file will end up looking like. This particular project accounts for
> Debian builds, as well as Mac OSX and RPM. I used my own version of the
> control file though. Im not sure I've done this 100% correct, but It's
> building without any Lintian errors or warnings.
>
> You can also use CDBS, but I found it just as easy to use dh_*. I'm sure
> the the Debian Mentors can get you sorted out on this. Maybe they can
> help me out as well, as I could be out in left field here :-)
>
> Rules File -- I added the comments just so i could see it easy in the
> build log
>
> DH_VERBOSE = 1
> export DH_OPTIONS=-v
>
> %:
>     dh $@ --parallel
>
> # CMakeLists.txt install target creates all the appropriate dir's
> override_dh_install:
>     @echo
> '---------------------------------------------------------------------'
>     @echo ' Overiding: dh_install to NULL'
>     @echo
> '--------------------------------------------------------------------'
>
> # Manpages are build by a Cmake target
> override_dh_installman:
>     @echo
> '---------------------------------------------------------------------'
>     @echo ' Overiding: dh_installman to NULL'
>     @echo
> '---------------------------------------------------------------------'
>
> # Manpages are already compressed
> override_dh_compress:
>     @echo
> '---------------------------------------------------------------------'
>     @echo ' Overiding: dh_compress to exclude *.1.gz files'
>     @echo
> '---------------------------------------------------------------------'
>     dh_compress -X1.gz
>
> 73's
> Greg, KI7MT
>
>
> On 10/21/2014 03:27 PM, Werner Detter wrote:
>> Hi everybody,
>>
>> I want to package a library, developed in C (libcmime) which is based
>> on cmake. If I'm
>> right - there should be
>>
>> a) the main package "libcmime"
>> /usr/lib/libcmime.so.0.1 (symlink to the next one)
>> /usr/lib/libcmime.so.0.1.14
>>
>> b) the dev package "libcmime-dev"
>> /usr/lib/libcmime.so (symlink to 0.1.19)
>> /usr/include/cmime/*.h
>> /usr/lib/pkgconfig/cmime.pc
>>
>> As this package is the first one with a C library, based on CMAKE for
>> me it would be great if
>> anyone could point me to a similar package to stud debian/rules
>>
>> Thanks and cheers,
>> Werner
>>
>>
>
>


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/5446D9C5.60505@...

Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

Johan Van de Wauw
Werner,

I'd recommend using debhelper for a new package and not cdbs.

Cmake is recognised normally, try with the minimal rules file:

#!/usr/bin/make -f
%:
    dh $@

Johan


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/CAJOp35naSXEp61Or40AMzpYDFBoBMecsKidxx-8jp9O9Q4_RWg@...

Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

Jakub Wilk-4
In reply to this post by KI7MT
* ki7mt <[hidden email]>, 2014-10-21, 15:57:
># CMakeLists.txt install target creates all the appropriate dir's
>override_dh_install:
>    @echo '---------------------------------------------------------------------'
>    @echo ' Overiding: dh_install to NULL'
>    @echo '--------------------------------------------------------------------'

This override seems unnecessary. dh_install is a no-op by default. It
won't do anything unless you specifically instruct it what to do (either
by providing command line arguments, or by creating *.install files).

># Manpages are build by a Cmake target
>override_dh_installman:
>    @echo '---------------------------------------------------------------------'
>    @echo ' Overiding: dh_installman to NULL'
>    @echo '---------------------------------------------------------------------'

Similarly, dh_installman is mostly no-op by default.

># Manpages are already compressed
>override_dh_compress:
>    @echo '---------------------------------------------------------------------'
>    @echo ' Overiding: dh_compress to exclude *.1.gz files'
>    @echo '---------------------------------------------------------------------'
>    dh_compress -X1.gz

dh_compress doesn't touch any *.gz files by default, so this override is
superfluous, too.

--
Jakub Wilk


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/20141022103617.GA3676@...

Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

Johan Van de Wauw
In reply to this post by Werner Detter-2
On Wed, Oct 22, 2014 at 12:10 AM, Werner Detter
<[hidden email]> wrote:

> It build's the package. So far, so good. But I'm still wondering what
> needs to be done to split the package into "libcmime" and "libcmime-dev" :)
Add both to the debian/control file.

Then add files libcmime.install and libcmime-dev.install which contain
the files you would like to have in each package.
Check libharu for a simple example:
http://anonscm.debian.org/cgit/collab-maint/libharu.git/tree/debian?id=01f51df5a7424f4dba53aa63eb1545ee78c1e715

Johan


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/CAJOp35keyrQCBn_Emd=EEvgwaTsvUYQuTYVJ2rWceCDW8c5v=A@...

Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

Werner Detter-2
Hi John,

thanks for your comments and your help. I'll switch back to dh
and create the install files tonight and see if everything works
as expected.

Cheers,
Werner


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/544794A9.9090109@...

Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

KI7MT
In reply to this post by Jakub Wilk-4
Hi Jakub,

Thank you for the feedback.

At present, this is a development package for testing, static linking to
a custom built library (from an External CMake Project section in the
main CMakeLists.txt ), which, dh_install was including at the install
phases. The only way I could find to prevent it from pulling in the libs
was to override dh_install. This is non-issue for the formal release
package as it will link against a shared libs.

The manpages was a real pain. The projects uses AsciiDoc to build the
pages as part of the CMake install target. If I didn't
overide_dh_installman and dh_compress, I ended up with double
extensions: <package-name.1.gz.gz> in the .deb file

I can look at this again closer to the time when the libs have been
formally published and the main package is ready for release from
upstream. Hopefully, I wont have to override anything at that point.

Greg, KI7MT

On 10/22/2014 10:36, Jakub Wilk wrote:

> * ki7mt <[hidden email]>, 2014-10-21, 15:57:
>> # CMakeLists.txt install target creates all the appropriate dir's
>> override_dh_install:
>>    @echo
>> '---------------------------------------------------------------------'
>>    @echo ' Overiding: dh_install to NULL'
>>    @echo
>> '--------------------------------------------------------------------'
>
> This override seems unnecessary. dh_install is a no-op by default. It
> won't do anything unless you specifically instruct it what to do (either
> by providing command line arguments, or by creating *.install files).
>
>> # Manpages are build by a Cmake target
>> override_dh_installman:
>>    @echo
>> '---------------------------------------------------------------------'
>>    @echo ' Overiding: dh_installman to NULL'
>>    @echo
>> '---------------------------------------------------------------------'
>
> Similarly, dh_installman is mostly no-op by default.
>
>> # Manpages are already compressed
>> override_dh_compress:
>>    @echo
>> '---------------------------------------------------------------------'
>>    @echo ' Overiding: dh_compress to exclude *.1.gz files'
>>    @echo
>> '---------------------------------------------------------------------'
>>    dh_compress -X1.gz
>
> dh_compress doesn't touch any *.gz files by default, so this override is
> superfluous, too.
>


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/5447DF9B.2050007@...

Reply | Threaded
Open this post in threaded view
|

Re: Package with CMAKE based C library

Peter Spiess-Knafl-2
In reply to this post by Leopold Palomo-Avellaneda
I recently packaged a C++ library:

http://mentors.debian.net/package/libjson-rpc-cpp

Perhaps it helps.

Regards,
Peter

On 10/21/2014 11:05 PM, Leopold Palomo-Avellaneda wrote:

> El Dimarts, 21 d'octubre de 2014, a les 23:27:30, Werner Detter va escriure:
>> Hi everybody,
>>
>> I want to package a library, developed in C (libcmime) which is based on
>> cmake. If I'm right - there should be
>>
>> a) the main package "libcmime"
>> /usr/lib/libcmime.so.0.1 (symlink to the next one)
>> /usr/lib/libcmime.so.0.1.14
>>
>> b) the dev package "libcmime-dev"
>> /usr/lib/libcmime.so (symlink to 0.1.19)
>> /usr/include/cmime/*.h
>> /usr/lib/pkgconfig/cmime.pc
>>
>> As this package is the first one with a C library, based on CMAKE for me it
>> would be great if anyone could point me to a similar package to stud
>> debian/rules
>>
>> Thanks and cheers,
>> Werner
> http://anonscm.debian.org/cgit/debian-science/packages/fcl.git/tree/debian
>
> it's c++ but it could be similar.
>
> Regards,
>
>
> Leopold
>


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]
Archive: https://lists.debian.org/5494B9F6.1070801@...