编译支持 websocket 的 Mosquitto MQTT 1.4.8

Compiling Mosquitto MQTT 1.4.8 with websocket support

我目前正在尝试在 RHEL6.7 机器上编译支持 websocket 的 v1.4.8。

采取的步骤:

 - yum groupinstall "Development Tools"'
 - yum install wget mercurial cmake openssl-devel c-ares-devel libuuid-devel
 - wget https://github.com/warmcat/libwebsockets/archive/v1.3-chrome37-firefox30.tar.gz
 - tar zxvf v1.3-chrome37-firefox30.tar.gz
 - cd libwebsockets-1.3-chrome37-firefox30
 - mkdir build; cd build;
 - cmake .. -DLIB_SUFFIX=64
 - make install
 - git clone https://git.eclipse.org/r/mosquitto/org.eclipse.mosquitto
 - cd org.eclipse.mosquitto/
 - git checkout tags/v1.4.8
 - //edited config.mk ==> WITH_SRV=no, WITH_WEBSOCKETS:=yes
 - make binary
 - make install

但是在最后一步(安装)我得到一个错误(输出如下所示)。进行一些搜索后出现 。但是我是从发布的标签构建的,所以我不确定为什么我会遇到同样的错误。

任何信息将不胜感激,谢谢!

错误

set -e; for d in lib client src; do make -C ${d}; done
make[1]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/lib'
make -C cpp
make[2]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/lib/cpp'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/lib/cpp'
make[1]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/lib'
make[1]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/client'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/client'
make[1]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/src'
set -e; for d in lib client src; do make -C ${d} install; done
make[1]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/lib'
make -C cpp
make[2]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/lib/cpp'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/lib/cpp'
install -d /usr/local/lib/
install -s --strip-program=strip libmosquitto.so.1 /usr/local/lib/libmosquitto.so.1
ln -sf libmosquitto.so.1 /usr/local/lib/libmosquitto.so
install -d /usr/local/include/
install mosquitto.h /usr/local/include/mosquitto.h
make -C cpp install
make[2]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/lib/cpp'
install -d /usr/local/lib/
install -s --strip-program=strip libmosquittopp.so.1 /usr/local/lib/libmosquittopp.so.1
ln -sf libmosquittopp.so.1 /usr/local/lib/libmosquittopp.so
install -d /usr/local/include/
install mosquittopp.h /usr/local/include/mosquittopp.h
make[2]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/lib/cpp'
make[1]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/lib'
make[1]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/client'
install -d /usr/local/bin
install -s --strip-program=strip mosquitto_pub /usr/local/bin/mosquitto_pub
install -s --strip-program=strip mosquitto_sub /usr/local/bin/mosquitto_sub
make[1]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/client'
make[1]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/src'
install -d /usr/local/sbin
install -s --strip-program=strip mosquitto /usr/local/sbin/mosquitto
install mosquitto_plugin.h /usr/local/include/mosquitto_plugin.h
install -s --strip-program=strip mosquitto_passwd /usr/local/bin/mosquitto_passwd
make[1]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/src'
set -e; for d in man; do make -C ${d} install; done
make[1]: Entering directory `/root/org.eclipse.mosquitto-1.4.8/man'
install -d /usr/local/share/man/man8
install -m 644 mosquitto.8 /usr/local/share/man/man8/mosquitto.8
install: cannot stat `mosquitto.8': No such file or directory
make[1]: *** [install] Error 1
make[1]: Leaving directory `/root/org.eclipse.mosquitto-1.4.8/man'
make: *** [install] Error 2

git 存储库不包含生成的手册页,只有发布的 tar 球包含。当您使用 "make binary" 时,不会生成手册页 - 由于所需 xslt 文件的文件路径不同,它们也不会出现在 RHEL 上。安装失败,因为没有手册页。

尝试使用已发布的 tar 球,这是面向最终用户的规范版本。

我也建议不要使用过时版本的 libwebsockets。

make binary 没有构建手册页,make install 假设它们已经构建并正在尝试安装它们。

Redhat/Fedora 发行版构建手册页时出现问题。我以前见过这个,它与一个 docbook 宏有关。

我过去已经修复过这个问题,我只需要找到我所做的更改即可。

编辑:解决方法是从以下位置编辑 man/manpage.xsl 的第 3 行:

<xsl:import href="/usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl"/>

<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets-1.78.1/manpages/docbook.xsl"/>

然后运行make在运行ning之前的man目录下make install

您可能需要安装 docbook-style-xsl