From: jiung-yu Date: Sun, 7 Aug 2022 23:30:14 +0000 (+0900) Subject: Enable tizen build X-Git-Tag: accepted/tizen/unified/20220808.044207^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F54%2F279354%2F3;p=platform%2Fupstream%2Fmosquitto.git Enable tizen build Change-Id: Icbd30fea18127c4d2725526cc589b882613f5c6e Signed-off-by: Yu jiung --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e11959c..e3fc805 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ else (WITH_THREADING) set (PTHREAD_INCLUDE_DIR "") endif (WITH_THREADING) -option(DOCUMENTATION "Build documentation?" ON) +option(DOCUMENTATION "Build documentation?" OFF) option(WITH_DLT "Include DLT support?" OFF) message(STATUS "WITH_DLT = ${WITH_DLT}") diff --git a/config.mk b/config.mk index 51e36e0..7abe9df 100644 --- a/config.mk +++ b/config.mk @@ -71,7 +71,7 @@ WITH_WEBSOCKETS:=no WITH_EC:=yes # Build man page documentation by default. -WITH_DOCS:=yes +WITH_DOCS:=no # Build with client support for SOCK5 proxy. WITH_SOCKS:=yes @@ -288,7 +288,7 @@ ifeq ($(WITH_WEBSOCKETS),static) endif INSTALL?=install -prefix?=/usr/local +prefix?=/usr incdir?=${prefix}/include libdir?=${prefix}/lib${LIB_SUFFIX} localedir?=${prefix}/share/locale diff --git a/mosquitto.conf b/mosquitto.conf index c12193f..fe62eb8 100644 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -195,7 +195,7 @@ # If run as a non-root user, this setting has no effect. # Note that on Windows this has no effect and so mosquitto should # be started by the user you wish it to run as. -#user mosquitto +user root # ================================================================= # Default listener @@ -545,7 +545,7 @@ # subscriptions, currently in-flight messages and retained # messages. # retained_persistence is a synonym for this option. -#persistence false +persistence false # The filename to use for the persistent database, not including # the path. @@ -648,7 +648,7 @@ # username/password or TLS-PSK checks, then `allow_anonymous` defaults to # false. # -#allow_anonymous true +allow_anonymous true # ----------------------------------------------------------------- # Default authentication and topic access control diff --git a/packaging/mosquitto.manifest b/packaging/mosquitto.manifest new file mode 100755 index 0000000..a76fdba --- /dev/null +++ b/packaging/mosquitto.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/mosquitto.service b/packaging/mosquitto.service new file mode 100755 index 0000000..e59a395 --- /dev/null +++ b/packaging/mosquitto.service @@ -0,0 +1,14 @@ +[Unit] +Description=Mosquitto MQTT broker service +After=net-config.service +DefaultDependencies=no + +[Service] +Type=simple +SmackProcessLabel=System +ExecStart=/usr/sbin/mosquitto -v -c /etc/mosquitto/mosquitto.conf +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/packaging/mosquitto.spec b/packaging/mosquitto.spec new file mode 100755 index 0000000..ce36d25 --- /dev/null +++ b/packaging/mosquitto.spec @@ -0,0 +1,73 @@ +Name: mosquitto +Summary: MQTT version 5.0/3.1.1/3.1 compatible message broker +Version: 1.6.8 +Release: 1 +Group: Network & Connectivity/Other +License: EPL-1.0 and EDL-1.0 +Source0: %{name}-%{version}.tar.gz +Source1001: %{name}.manifest +Source1002: %{name}.service + +BuildRequires: pkgconfig(libcares) +BuildRequires: pkgconfig(openssl1.1) +BuildRequires: pkgconfig(libwebsockets) +BuildRequires: systemd-devel + +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig + +%description +This is a message broker that supports version 5.0, 3.1 and 3.1.1 of the MQTT +protocol. + +MQTT provides a method of carrying out messaging using a publish/subscribe +model. It is lightweight, both in terms of bandwidth usage and ease of +implementation. This makes it particularly useful at the edge of the network +where a sensor or other simple device may be implemented using an arduino for +example. + +%package devel +Summary: Development files for Mosquitto +Group: Development/Libraries + +%description devel +Development headers and libraries for %{name} + +%prep +%setup -q +cp %{SOURCE1001} ./%{name}.manifest + +%build +export CFLAGS+=" -Wno-error=shadow -Wno-error=sign-compare -Wno-error=format=" +make all %{?_smp_mflags} + +%install +%if "%{_lib}" == "lib64" +export LIB_SUFFIX=64 +%endif +%make_install + +mkdir -p %{buildroot}%{_unitdir} +install -p -m 0644 %{SOURCE1002} %{buildroot}%{_unitdir}/%{name}.service +%install_service multi-user.target.wants %{name}.service +mv %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf.example %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf + +%post + +%files +%manifest %{name}.manifest +%license LICENSE.txt epl-v10 edl-v10 +%{_bindir}/%{name}* +%{_sbindir}/%{name} +%{_libdir}/*.so.* +%dir %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf +%config %{_sysconfdir}/%{name}/*.example +%{_unitdir}/%{name}.service +%{_unitdir}/multi-user.target.wants/%{name}.service + +%files devel +%license LICENSE.txt epl-v10 edl-v10 +%{_includedir}/*.h +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc diff --git a/service/upstart/mosquitto.conf b/service/upstart/mosquitto.conf index 993b4c7..2f81782 100644 --- a/service/upstart/mosquitto.conf +++ b/service/upstart/mosquitto.conf @@ -5,4 +5,4 @@ start on net-device-up respawn -exec /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf +exec /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7898ff5..f5b34a8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -184,7 +184,7 @@ if (UNIX) endif (APPLE) endif (UNIX) -install(TARGETS mosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_SBINDIR}") +install(TARGETS mosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") install(FILES mosquitto_broker.h mosquitto_plugin.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") if (WITH_TLS)