dev-ros/roslaunch: Initial import. Ebuild by me.
authorAlexis Ballier <aballier@gentoo.org>
Tue, 22 Sep 2015 13:31:50 +0000 (15:31 +0200)
committerAlexis Ballier <aballier@gentoo.org>
Tue, 22 Sep 2015 14:36:25 +0000 (16:36 +0200)
Package-Manager: portage-2.2.21

dev-ros/roslaunch/Manifest [new file with mode: 0644]
dev-ros/roslaunch/files/40roslaunch [new file with mode: 0644]
dev-ros/roslaunch/files/roscore.confd [new file with mode: 0644]
dev-ros/roslaunch/files/roscore.initd [new file with mode: 0755]
dev-ros/roslaunch/files/roscore.xml.in [new file with mode: 0644]
dev-ros/roslaunch/files/roslaunch.confd [new file with mode: 0644]
dev-ros/roslaunch/files/roslaunch.initd [new file with mode: 0755]
dev-ros/roslaunch/files/timeout.patch [new file with mode: 0644]
dev-ros/roslaunch/metadata.xml [new file with mode: 0644]
dev-ros/roslaunch/roslaunch-1.11.14.ebuild [new file with mode: 0644]
dev-ros/roslaunch/roslaunch-9999.ebuild [new file with mode: 0644]

diff --git a/dev-ros/roslaunch/Manifest b/dev-ros/roslaunch/Manifest
new file mode 100644 (file)
index 0000000..84bda76
--- /dev/null
@@ -0,0 +1 @@
+DIST ros_comm-1.11.14.tar.gz 945041 SHA256 8e7beff35711b1918501c69cca4f29648d4d4207878edab069bcd59d515c78f3 SHA512 be768faa0a2f45c464e963934a95dc617cac6c3fcec2388602a27846774c25b882b5139099ce10d1d051a21d5938819942e079836d14618071bc7ad90ee78bab WHIRLPOOL e047ce984086655294c20dbf0715cc29f51ec358f075f02de80c5de0d4ef8059990dc8312d78d7a7fa91c4a974dc21cba15d6eacafe02fd3df527770e50f75a5
diff --git a/dev-ros/roslaunch/files/40roslaunch b/dev-ros/roslaunch/files/40roslaunch
new file mode 100644 (file)
index 0000000..49bb426
--- /dev/null
@@ -0,0 +1,4 @@
+CATKIN_PREFIX_PATH=/usr
+ROS_ROOT=/usr/share/ros
+ROS_PACKAGE_PATH=/usr/share
+ROS_MASTER_URI="http://localhost:11311/"
diff --git a/dev-ros/roslaunch/files/roscore.confd b/dev-ros/roslaunch/files/roscore.confd
new file mode 100644 (file)
index 0000000..3c689cd
--- /dev/null
@@ -0,0 +1 @@
+LC_ALL=C
diff --git a/dev-ros/roslaunch/files/roscore.initd b/dev-ros/roslaunch/files/roscore.initd
new file mode 100755 (executable)
index 0000000..7efd846
--- /dev/null
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+       after net
+}
+
+start() {
+       ebegin "Starting ROS server roscore"
+       start-stop-daemon --start \
+               --user ros --group ros \
+               -m --pidfile /var/run/roscore.pid \
+               --exec "/usr/bin/roscore" --background
+       eend $? "Failed to start roscore"
+}
+
+stop() {
+       ebegin "Stopping roscore"
+       start-stop-daemon --stop \
+               --pidfile /var/run/roscore.pid \
+               --exec "/usr/bin/roscore"
+       eend $? "Failed to stop roscore"
+}
diff --git a/dev-ros/roslaunch/files/roscore.xml.in b/dev-ros/roslaunch/files/roscore.xml.in
new file mode 100644 (file)
index 0000000..1730d42
--- /dev/null
@@ -0,0 +1,13 @@
+<!-- 
+  ROS Core Stack definition
+
+  Before making any modifications to this file, please read:
+  http://ros.org/wiki/roscore
+  -->
+<launch>
+  <group ns="/">
+    <param name="rosversion" value="@PKG_VERSION@" />
+    <param name="rosdistro" value="Gentoo" />
+    <node pkg="rosout" type="rosout" name="rosout" respawn="true"/>
+  </group>
+</launch>
diff --git a/dev-ros/roslaunch/files/roslaunch.confd b/dev-ros/roslaunch/files/roslaunch.confd
new file mode 100644 (file)
index 0000000..4d7bd63
--- /dev/null
@@ -0,0 +1,2 @@
+LC_ALL=C
+ROSLAUNCH_FILE="/etc/ros/ros.launch"
diff --git a/dev-ros/roslaunch/files/roslaunch.initd b/dev-ros/roslaunch/files/roslaunch.initd
new file mode 100755 (executable)
index 0000000..3a15bbc
--- /dev/null
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+       need roscore
+}
+
+checkconfig() {
+       [ -f "${ROSLAUNCH_FILE}" ]
+       eend $? "You need to define ROSLAUNCH_FILE and point it to a correct location (${ROSLAUNCH_FILE} does not exist)"
+}
+
+start() {
+       checkconfig || exit 1
+       ebegin "Waiting for roscore"
+
+       val=${ROS_MASTER_URI#http://}
+       dest=$(echo ${val%/} | tr ':' ' ')
+       while ! echo exit | nc ${dest} &> /dev/null; do sleep 1; done
+
+       ebegin "Starting ROS via roslaunch"
+       start-stop-daemon --start \
+               --user ros --group ros \
+               -m --pidfile /var/run/roslaunch.pid \
+               --exec "/usr/bin/roslaunch" --background \
+               -- ${ROSLAUNCH_FILE}
+       eend $? "Failed to start ROS"
+}
+
+stop() {
+       ebegin "Stopping roslaunch"
+       start-stop-daemon --stop \
+               --pidfile /var/run/roslaunch.pid \
+               --exec "/usr/bin/roslaunch"
+       eend $? "Failed to stop roslaunch"
+}
diff --git a/dev-ros/roslaunch/files/timeout.patch b/dev-ros/roslaunch/files/timeout.patch
new file mode 100644 (file)
index 0000000..169b128
--- /dev/null
@@ -0,0 +1,18 @@
+Slow HW like the raspberry pi easily hit this timeout over NFS.
+Increase it to 1 min.
+
+diff --git a/tools/roslaunch/src/roslaunch/launch.py b/tools/roslaunch/src/roslaunch/launch.py
+index 9a3b931..8e33c0c 100644
+--- a/tools/roslaunch/src/roslaunch/launch.py
++++ b/tools/roslaunch/src/roslaunch/launch.py
+@@ -57,8 +57,8 @@ from roslaunch.pmon import start_process_monitor, ProcessListener
+ from roslaunch.rlutil import update_terminal_name
+-_TIMEOUT_MASTER_START = 10.0 #seconds
+-_TIMEOUT_MASTER_STOP  = 10.0 #seconds
++_TIMEOUT_MASTER_START = 60.0 #seconds
++_TIMEOUT_MASTER_STOP  = 60.0 #seconds
+ _ID = '/roslaunch'
diff --git a/dev-ros/roslaunch/metadata.xml b/dev-ros/roslaunch/metadata.xml
new file mode 100644 (file)
index 0000000..c42ea5b
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ros</herd>
+</pkgmetadata>
diff --git a/dev-ros/roslaunch/roslaunch-1.11.14.ebuild b/dev-ros/roslaunch/roslaunch-1.11.14.ebuild
new file mode 100644 (file)
index 0000000..a7e9913
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+ROS_REPO_URI="https://github.com/ros/ros_comm"
+KEYWORDS="~amd64 ~arm"
+ROS_SUBDIR=tools/${PN}
+PYTHON_COMPAT=( python2_7 )
+
+inherit ros-catkin user
+
+DESCRIPTION="Tool for easily launching multiple ROS nodes"
+LICENSE="BSD"
+SLOT="0"
+IUSE=""
+
+RDEPEND="
+       dev-ros/roslib[${PYTHON_USEDEP}]
+       dev-python/rospkg[${PYTHON_USEDEP}]
+       dev-ros/rosclean[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-ros/rosgraph_msgs[${CATKIN_MESSAGES_PYTHON_USEDEP}]
+       dev-ros/rosparam[${PYTHON_USEDEP}]
+       dev-ros/rosmaster[${PYTHON_USEDEP}]
+       dev-ros/rosout
+"
+DEPEND="${RDEPEND}
+       test? (
+               dev-util/rosdep[${PYTHON_USEDEP}]
+               dev-python/nose[${PYTHON_USEDEP}]
+               dev-ros/test_rosmaster
+       )"
+PATCHES=( "${FILESDIR}/timeout.patch" )
+
+src_test() {
+       rosdep update
+       ros-catkin_src_test
+}
+
+src_install() {
+       ros-catkin_src_install
+
+       dodir /etc/ros
+       sed -e "s/@PKG_VERSION@/${PV}/" "${FILESDIR}/roscore.xml.in" > "${ED}/etc/ros/roscore.xml" || die
+
+       newinitd "${FILESDIR}/roscore.initd" roscore
+       newconfd "${FILESDIR}/roscore.confd" roscore
+
+       newinitd "${FILESDIR}/roslaunch.initd" roslaunch
+       newconfd "${FILESDIR}/roslaunch.confd" roslaunch
+
+       doenvd "${FILESDIR}/40roslaunch"
+}
+
+pkg_preinst() {
+       enewgroup ros
+       enewuser ros -1 -1 /home/ros ros
+}
diff --git a/dev-ros/roslaunch/roslaunch-9999.ebuild b/dev-ros/roslaunch/roslaunch-9999.ebuild
new file mode 100644 (file)
index 0000000..a7e9913
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+ROS_REPO_URI="https://github.com/ros/ros_comm"
+KEYWORDS="~amd64 ~arm"
+ROS_SUBDIR=tools/${PN}
+PYTHON_COMPAT=( python2_7 )
+
+inherit ros-catkin user
+
+DESCRIPTION="Tool for easily launching multiple ROS nodes"
+LICENSE="BSD"
+SLOT="0"
+IUSE=""
+
+RDEPEND="
+       dev-ros/roslib[${PYTHON_USEDEP}]
+       dev-python/rospkg[${PYTHON_USEDEP}]
+       dev-ros/rosclean[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-ros/rosgraph_msgs[${CATKIN_MESSAGES_PYTHON_USEDEP}]
+       dev-ros/rosparam[${PYTHON_USEDEP}]
+       dev-ros/rosmaster[${PYTHON_USEDEP}]
+       dev-ros/rosout
+"
+DEPEND="${RDEPEND}
+       test? (
+               dev-util/rosdep[${PYTHON_USEDEP}]
+               dev-python/nose[${PYTHON_USEDEP}]
+               dev-ros/test_rosmaster
+       )"
+PATCHES=( "${FILESDIR}/timeout.patch" )
+
+src_test() {
+       rosdep update
+       ros-catkin_src_test
+}
+
+src_install() {
+       ros-catkin_src_install
+
+       dodir /etc/ros
+       sed -e "s/@PKG_VERSION@/${PV}/" "${FILESDIR}/roscore.xml.in" > "${ED}/etc/ros/roscore.xml" || die
+
+       newinitd "${FILESDIR}/roscore.initd" roscore
+       newconfd "${FILESDIR}/roscore.confd" roscore
+
+       newinitd "${FILESDIR}/roslaunch.initd" roslaunch
+       newconfd "${FILESDIR}/roslaunch.confd" roslaunch
+
+       doenvd "${FILESDIR}/40roslaunch"
+}
+
+pkg_preinst() {
+       enewgroup ros
+       enewuser ros -1 -1 /home/ros ros
+}