0
$\begingroup$

Rosanswers logo

Hi there, Can anyone provide a tutorial to generate a .deb of a ROS package step by step so that the others can use it to install the package without source code.

Many thanks, Rickardo


Originally posted by rikardo on ROS Answers with karma: 31 on 2016-08-13

Post score: 3


Original comments

Comment by tanasis on 2018-01-03:
Hey Rikardo, did you solve this?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

If you want to build a ROS package into a deb, you can do it just like any debian package manually I highly recommend reading through the Debian documentation. There's a relatively steep learning curve unfortunately.

A few starting points are:

I don't know what your use case is, but if you're building ROS packages privately you can still use bloom to generate a lot of the boilerplate needed above. And you can use git-buildpackage to build the resultant debian packages locally in approximately one line.

A simpler approach that can fill many use cases is to use the checkinstall tool. You can use checkinstall with the install target for a catkin workspace.


Originally posted by tfoote with karma: 58457 on 2016-08-14

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

The easiest way I have found to do this is by using CPack which is a CMake module.

https://cmake.org/cmake/help/v3.0/module/CPack.html

In one of your CMakeLists.txt files you can add the following to generate a .deb

set(CPACK_PACKAGE_NAME ${PACKAGE_NAME})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE_NAME} debian package")
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_CONTACT "${${PROJECT_NAME}_MAINTAINER}")
set(CPACK_PACKAGE_VENDOR "${${PROJECT_NAME}_MAINTAINER}")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})

include(CPack)

Note that this will create a debian from your entire catkin workspace as all of the CMakeLists.txt files are merged into one when using catkin (although it might be possible to get round this using catkin_make_isolated).


Originally posted by Michael Johnson with karma: 154 on 2016-08-15

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.