Enable tizen build 54/279354/3 accepted/tizen/unified/20220808.044207 submit/tizen/20220808.043405
authorjiung-yu <jiung.yu@samsung.com>
Sun, 7 Aug 2022 23:30:14 +0000 (08:30 +0900)
committerjiung-yu <jiung.yu@samsung.com>
Mon, 8 Aug 2022 00:31:15 +0000 (09:31 +0900)
Change-Id: Icbd30fea18127c4d2725526cc589b882613f5c6e
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
CMakeLists.txt
config.mk
mosquitto.conf
packaging/mosquitto.manifest [new file with mode: 0755]
packaging/mosquitto.service [new file with mode: 0755]
packaging/mosquitto.spec [new file with mode: 0755]
service/upstart/mosquitto.conf
src/CMakeLists.txt

index e11959c..e3fc805 100644 (file)
@@ -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}")
index 51e36e0..7abe9df 100644 (file)
--- 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
index c12193f..fe62eb8 100644 (file)
 # 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
 # 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.
 # 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 (executable)
index 0000000..a76fdba
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_" />
+       </request>
+</manifest>
diff --git a/packaging/mosquitto.service b/packaging/mosquitto.service
new file mode 100755 (executable)
index 0000000..e59a395
--- /dev/null
@@ -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 (executable)
index 0000000..ce36d25
--- /dev/null
@@ -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
index 993b4c7..2f81782 100644 (file)
@@ -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
index 7898ff5..f5b34a8 100644 (file)
@@ -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)