$ git clone https://github.com/eclipse/paho.mqtt.c.git
$ cd paho.mqtt.c
# Check version from Paho MQTT Cpp too
$ git checkout v1.3.1
Then run
# To install in /usr/local
$ cmake -Bbuild -H. -DPAHO_WITH_SSL=ON -DPAHO_ENABLE_TESTING=OFF
$ sudo cmake --build build/ --target install
# To install in a custom path (paho.mqtt.c/install)
$ cmake -Bbuild -H. -DPAHO_WITH_SSL=ON -DPAHO_ENABLE_TESTING=OFF -DCMAKE_INSTALL_PREFIX=install
$ cmake --build build/ --target install
# To create a package
$ cmake -Bbuild -H. -DPAHO_WITH_SSL=ON -DPAHO_ENABLE_TESTING=OFF -DPAHO_BUILD_DEB_PACKAGE=ON
$ sudo cmake --build build/ --target package
Update link path
$ sudo ldconfig
Run
$ git clone https://github.com/eclipse/paho.mqtt.cpp
$ cd paho.mqtt.cpp
$ cmake -Bbuild -H. -DPAHO_BUILD_DOCUMENTATION=TRUE -DPAHO_BUILD_SAMPLES=TRUE -DPAHO_BUILD_DEB_PACKAGE=TRUE
$ cd build
$ dh_make -p paho-mqtt-cpp_0.1.1 --createorig -s -y
Copy the following file to debian/rules
%:
dh $@
override_dh_usrlocal:
dh $@
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
Bear in mind that there are TABS instead of spaces
Then run
$ dpkg-buildpackage -b -uc
Depending on the build, one could have the following rules
# Install in /usr/local/
$ cmake -Bbuild -H. -DPAHO_BUILD_DOCUMENTATION=TRUE -DPAHO_BUILD_SAMPLES=TRUE
$ sudo cmake --build build/ --target install
$ sudo ldconfig
# to generate tar.gz
$ cmake -Bbuild -H. -DPAHO_BUILD_DOCUMENTATION=TRUE -DPAHO_BUILD_SAMPLES=TRUE -DPAHO_BUILD_DEB_PACKAGE=TRUE
$ sudo cmake --build build/ --target package
$ sudo ldconfig
$ sudo apt install checkinstall
$ cd build
$ sudo checkinstall -t debian -y --pkgname=libpaho-mqtt-cpp --pkgversion=1.3.6
Check install may not bring all files Alien could be one option, but may have some issues according to the previous link
$ sudo apt-get install alien
$ sudo alien -d tarball.tar.gz