The instructions are based on this answers.ros.org thread.
You may need the latest pip, follow the official instructions.
Install bloom:
sudo apt-get install python-bloom
or (recommended)
sudo pip install -U bloom
Install fakeroot:
sudo apt-get install fakeroot
To make a debian folder structure from the ROS package you must cd into
the package to be in the same folder where package.xml
file is.
bloom-generate rosdebian --os-name ubuntu --os-version trusty --ros-distro indigo
You can also let the tool guess some stuff:
bloom-generate rosdebian --ros-distro indigo
You'll get something like this:
~/audio_ws/src/audio_file_player$ bloom-generate rosdebian --os-name ubuntu --os-version trusty --ros-distro indigo
==> Generating debs for ubuntu:trusty for package(s) ['audio_file_player']
No homepage set, defaulting to ''
No historical releaser history, using current maintainer name and email for each versioned changelog entry.
No CHANGELOG.rst found for package 'audio_file_player'
Package 'audio-file-player' has dependencies:
Run Dependencies:
rosdep key => trusty key
rospy => ['ros-indigo-rospy']
actionlib_msgs => ['ros-indigo-actionlib-msgs']
Build and Build Tool Dependencies:
rosdep key => trusty key
rospy => ['ros-indigo-rospy']
actionlib_msgs => ['ros-indigo-actionlib-msgs']
catkin => ['ros-indigo-catkin']
==> Placing templates files in the 'debian' folder.
==> In place processing templates in 'debian' folder.
Expanding 'debian/control.em' -> 'debian/control'
Expanding 'debian/changelog.em' -> 'debian/changelog'
Expanding 'debian/compat.em' -> 'debian/compat'
Expanding 'debian/rules.em' -> 'debian/rules'
~/audio_ws/src/audio_file_player$ ls
action assets CMakeLists.txt debian launch package.xml README.md scripts
~/audio_ws/src/audio_file_player$ ls debian
changelog compat control rules source
Having sourced the necessary dependencies (most probably source /opt/ros/indigo/setup.bash
) execute:
fakeroot debian/rules binary
If you get the error:
dh: Command not found
You need to install:
sudo apt-get install dpkg-dev debhelper
In the end you'll get a line like:
dpkg-deb: building package `ros-indigo-audio-file-player' in `../ros-indigo-audio-file-player_0.0.1-0trusty_amd64.deb'.
Hi @awesomebytes,
Thanks for sharing this information.
I had been wondering about building a ROS package using debuild and reached your guide.
The problem I seem to be facing is that the tools only allows a single package to be built at a time which limits packaging my project.
I tried create my own debian/rules file by overwriting the debian build system to use to colcon build. This, unfortunately did not work.
Using your guide, I was able to generate a rules file which shows the following.
%:$@ -v --buildsystem=cmake --builddirectory=.obj-$ (DEB_HOST_GNU_TYPE)
dh
I, however, would like to use something similiar to
%:
dh $@ --buildsystem=colcon
override_dh_auto_build:
dh_auto_build -- colcon build --packages-up-to my_package.
Do you perhaps know if such modification is possible?
Thanks!