diff --git a/fix-undefined-symbols-in-plugins.patch b/fix-undefined-symbols-in-plugins.patch new file mode 100644 index 0000000..d40e4ec --- /dev/null +++ b/fix-undefined-symbols-in-plugins.patch @@ -0,0 +1,52 @@ +Index: mosquitto-2.0.8/plugins/auth-by-ip/CMakeLists.txt +=================================================================== +--- mosquitto-2.0.8.orig/plugins/auth-by-ip/CMakeLists.txt ++++ mosquitto-2.0.8/plugins/auth-by-ip/CMakeLists.txt +@@ -1,7 +1,7 @@ + include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/include + ${STDBOOL_H_PATH} ${STDINT_H_PATH}) + +-add_library(mosquitto_auth_by_ip SHARED mosquitto_auth_by_ip.c) ++add_library(mosquitto_auth_by_ip MODULE mosquitto_auth_by_ip.c) + set_target_properties(mosquitto_auth_by_ip PROPERTIES + POSITION_INDEPENDENT_CODE 1 + ) +Index: mosquitto-2.0.8/plugins/dynamic-security/CMakeLists.txt +=================================================================== +--- mosquitto-2.0.8.orig/plugins/dynamic-security/CMakeLists.txt ++++ mosquitto-2.0.8/plugins/dynamic-security/CMakeLists.txt +@@ -12,7 +12,7 @@ if (CJSON_FOUND AND WITH_TLS) + include_directories(${CLIENT_INC}) + link_directories(${CLIENT_DIR} ${mosquitto_SOURCE_DIR}) + +- add_library(mosquitto_dynamic_security SHARED ++ add_library(mosquitto_dynamic_security MODULE + acl.c + auth.c + clients.c +Index: mosquitto-2.0.8/plugins/message-timestamp/CMakeLists.txt +=================================================================== +--- mosquitto-2.0.8.orig/plugins/message-timestamp/CMakeLists.txt ++++ mosquitto-2.0.8/plugins/message-timestamp/CMakeLists.txt +@@ -1,7 +1,7 @@ + include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/include + ${STDBOOL_H_PATH} ${STDINT_H_PATH}) + +-add_library(mosquitto_message_timestamp SHARED mosquitto_message_timestamp.c) ++add_library(mosquitto_message_timestamp MODULE mosquitto_message_timestamp.c) + set_target_properties(mosquitto_message_timestamp PROPERTIES + POSITION_INDEPENDENT_CODE 1 + ) +Index: mosquitto-2.0.8/plugins/payload-modification/CMakeLists.txt +=================================================================== +--- mosquitto-2.0.8.orig/plugins/payload-modification/CMakeLists.txt ++++ mosquitto-2.0.8/plugins/payload-modification/CMakeLists.txt +@@ -2,7 +2,7 @@ include_directories(${mosquitto_SOURCE_D + ${STDBOOL_H_PATH} ${STDINT_H_PATH}) + link_directories(${mosquitto_SOURCE_DIR}) + +-add_library(mosquitto_payload_modification SHARED mosquitto_payload_modification.c) ++add_library(mosquitto_payload_modification MODULE mosquitto_payload_modification.c) + set_target_properties(mosquitto_payload_modification PROPERTIES + POSITION_INDEPENDENT_CODE 1 + ) diff --git a/mosquitto-1.4.1_apparmor.patch b/mosquitto-1.4.1_apparmor.patch index 1640a44..a495c87 100644 --- a/mosquitto-1.4.1_apparmor.patch +++ b/mosquitto-1.4.1_apparmor.patch @@ -1,11 +1,15 @@ ---- a/security/mosquitto.apparmor -+++ b/security/mosquitto.apparmor -@@ -1,3 +1,5 @@ +Index: mosquitto-2.0.8/security/mosquitto.apparmor +=================================================================== +--- mosquitto-2.0.8.orig/security/mosquitto.apparmor ++++ mosquitto-2.0.8/security/mosquitto.apparmor +@@ -1,4 +1,6 @@ +-/usr/sbin/mosquitto { +#include + - /usr/sbin/mosquitto { ++profile mosquitto /usr/sbin/mosquitto { #include #include + @@ -6,6 +8,7 @@ /etc/mosquitto/mosquitto.conf r, /etc/mosquitto/ca_certificates/* r, @@ -14,7 +18,7 @@ /etc/mosquitto/conf.d/* r, /var/lib/mosquitto/ r, /var/lib/mosquitto/mosquitto.db rwk, -@@ -24,4 +27,5 @@ +@@ -25,4 +28,5 @@ /lib{,32,64}/libwrap.so* rm, /etc/hosts.allow r, /etc/hosts.deny r, diff --git a/mosquitto-1.6.8-config.patch b/mosquitto-1.6.8-config.patch index ce00d44..4e23976 100644 --- a/mosquitto-1.6.8-config.patch +++ b/mosquitto-1.6.8-config.patch @@ -1,6 +1,8 @@ ---- mosquitto-1.6.8.orig/mosquitto.conf -+++ mosquitto-1.6.8/mosquitto.conf -@@ -985,4 +985,4 @@ +Index: mosquitto-2.0.8/mosquitto.conf +=================================================================== +--- mosquitto-2.0.8.orig/mosquitto.conf ++++ mosquitto-2.0.8/mosquitto.conf +@@ -871,4 +871,4 @@ # alphabetical order, with capital letters ordered first. If this option is # given multiple times, all of the files from the first instance will be # processed before the next instance. See the man page for examples. diff --git a/mosquitto.changes b/mosquitto.changes index c4068fd..5ec84b3 100644 --- a/mosquitto.changes +++ b/mosquitto.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Thu Mar 11 12:27:06 UTC 2021 - Marcus Rueckert + +- Convert some of the BuildRequires from package names to + pkgconfig(): libcares, libcjson, libwebsockets + +------------------------------------------------------------------- +Thu Mar 11 12:25:55 UTC 2021 - Marcus Rueckert + +- Fix linking of modules: + - Add fix-undefined-symbols-in-plugins.patch + - revert old workaround of settings -DCMAKE_SHARED_LINKER_FLAGS= + +------------------------------------------------------------------- +Thu Mar 11 12:22:47 UTC 2021 - Marcus Rueckert + +- Update mosquitto-1.6.8-config.patch: + Set a short profilename for a cleaner ps aufxZ output +- Refreshed mosquitto-1.6.8-config.patch to apply cleanly again + ------------------------------------------------------------------- Sun Feb 28 12:56:09 UTC 2021 - Martin Hauke diff --git a/mosquitto.spec b/mosquitto.spec index 8d7a4b6..37aa75b 100644 --- a/mosquitto.spec +++ b/mosquitto.spec @@ -35,6 +35,7 @@ Source98: https://mosquitto.org/files/source/mosquitto-%{version}.tar.gz.a Source99: %{name}.keyring Patch0: mosquitto-1.4.1_apparmor.patch Patch1: mosquitto-1.6.8-config.patch +Patch2: fix-undefined-symbols-in-plugins.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: libxslt-tools @@ -115,11 +116,11 @@ Client for Mosquitto. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 find misc -type f -exec chmod a-x "{}" "+" %build %cmake \ - -DCMAKE_SHARED_LINKER_FLAGS="" \ -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \ -DWITH_WEBSOCKETS=ON \ -DUSE_LIBWRAP=OFF