Skip to content

Instantly share code, notes, and snippets.

@makokal
Last active April 18, 2018 21:42
Show Gist options
  • Save makokal/89ff6617ee372b39509582e4b77426f8 to your computer and use it in GitHub Desktop.
Save makokal/89ff6617ee372b39509582e4b77426f8 to your computer and use it in GitHub Desktop.
# builds a "fixed" libnabo deb package for ros-kinetic
# output will be /tmp/libnabo_1.0.6.deb
cd /tmp
git clone https://github.com/ethz-asl/libnabo.git
mkdir libnabo/build
cd libnabo/build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/ros/kinetic/ ..
make clean && make
sudo make install
files="
opt/ros/kinetic/share/libnabo/package.xml
opt/ros/kinetic/lib/libnabo.a
opt/ros/kinetic/include/nabo/index_heap.h
opt/ros/kinetic/include/nabo/nabo.h
opt/ros/kinetic/include/nabo/nabo_private.h
opt/ros/kinetic/share/doc/libnabo/README.md
opt/ros/kinetic/lib/cmake/nabo/libnaboConfig.cmake
opt/ros/kinetic/lib/cmake/nabo/libnaboConfigVersion.cmake
opt/ros/kinetic/share/libnabo/cmake/libnaboConfig.cmake"
# copy installed files into deb dir
debdir=/tmp/libnabo_1.0.6
rm -rf $debdir
for f in $files; do
mkdir -p $debdir/$(dirname $f)
cp /$f $debdir/$(dirname $f)
done
# fix relative paths to point to ros install
cmakefile=$debdir/opt/ros/kinetic/share/libnabo/cmake/libnaboConfig.cmake
sed -i "s/\/tmp\/libnabo\/build\/libnabo.so/\/opt\/ros\/kinetic\/lib\/libnabo.so/" $cmakefile
# super basic package definition
mkdir -p $debdir/DEBIAN
cat > $debdir/DEBIAN/control <<EOF
Package: libnabo
Version: 1.0.6
Section: libdevel
Priority: extra
Architecture: amd64
Depends:
Maintainer: todo
Description: A modular ICP library
EOF
dpkg-deb --build $debdir
rm -rf /tmp/libnabo
rm -rf $debdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment