Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/mosquitto mosquitto: Various SunOS fixes and impro...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a44cd507f832
branches:  trunk
changeset: 429133:a44cd507f832
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Thu Apr 16 15:19:11 2020 +0000

description:
mosquitto: Various SunOS fixes and improvements.

Includes SMF support.  Submitted by Jorge Schrauwen in NetBSD/pkgsrc#59.
While here fix a hardcoded /var.

diffstat:

 net/mosquitto/Makefile                         |   6 +++-
 net/mosquitto/distinfo                         |   6 ++--
 net/mosquitto/files/smf/manifest.xml           |  33 ++++++++++++++++++++++++++
 net/mosquitto/files/smf/mosquitto.sh           |  14 +++++++++++
 net/mosquitto/patches/patch-mosquitto.conf     |   4 +-
 net/mosquitto/patches/patch-src_CMakeLists.txt |  18 +++++++++++--
 6 files changed, 71 insertions(+), 10 deletions(-)

diffs (154 lines):

diff -r 987e71a15fde -r a44cd507f832 net/mosquitto/Makefile
--- a/net/mosquitto/Makefile    Thu Apr 16 15:10:34 2020 +0000
+++ b/net/mosquitto/Makefile    Thu Apr 16 15:19:11 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2020/02/29 18:29:01 gdt Exp $
+# $NetBSD: Makefile,v 1.10 2020/04/16 15:19:11 jperkin Exp $
 
 VERSION=       1.6.9
 DISTNAME=      mosquitto-${VERSION}
@@ -18,6 +18,7 @@
 USE_CMAKE=     yes
 USE_TOOLS+=    gmake
 
+LDFLAGS.SunOS+=        -lsocket -lnsl
 CMAKE_ARGS+=   -DCMAKE_INSTALL_SYSCONFDIR=${PREFIX}/share/examples
 
 MOSQUITTO_USER=                mosquitto
@@ -35,9 +36,10 @@
 SUBST_STAGE.paths=     post-configure
 SUBST_MESSAGE.paths=   Substituting paths
 SUBST_FILES.paths=     mosquitto.conf
-SUBST_VARS.paths=      SSLCERTS
+SUBST_VARS.paths=      SSLCERTS VARBASE
 
 RCD_SCRIPTS=   mosquitto
+SMF_METHODS=   mosquitto
 FILES_SUBST+=  MOSQUITTO_USER=${MOSQUITTO_USER}
 FILES_SUBST+=  MOSQUITTO_GROUP=${MOSQUITTO_GROUP}
 FILES_SUBST+=  PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
diff -r 987e71a15fde -r a44cd507f832 net/mosquitto/distinfo
--- a/net/mosquitto/distinfo    Thu Apr 16 15:10:34 2020 +0000
+++ b/net/mosquitto/distinfo    Thu Apr 16 15:19:11 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2020/02/29 18:29:01 gdt Exp $
+$NetBSD: distinfo,v 1.8 2020/04/16 15:19:11 jperkin Exp $
 
 SHA1 (mosquitto-1.6.9.tar.gz) = 424686c7cc3e0a9eced4875bef23ed666537d890
 RMD160 (mosquitto-1.6.9.tar.gz) = f10560110d223861d35c7d22f620282028a8241e
@@ -6,5 +6,5 @@
 Size (mosquitto-1.6.9.tar.gz) = 610934 bytes
 SHA1 (patch-lib_CMakeLists.txt) = cddb8803a759820c8059028f924b56c22689ee54
 SHA1 (patch-lib_net__mosq.c) = a38294cdfea98f2da0879ea93373c5f04aebdb20
-SHA1 (patch-mosquitto.conf) = 0ea671cfe3a332e9f0027b2410b212797fc1db17
-SHA1 (patch-src_CMakeLists.txt) = 2346ee3f13ab7f7e2c34492a4271e0b1adcae4fb
+SHA1 (patch-mosquitto.conf) = ca82a8a1bdc59d5e6f4121d8474693245b923789
+SHA1 (patch-src_CMakeLists.txt) = 66571704d96c672b8c1537794cf492e9cfce2e0c
diff -r 987e71a15fde -r a44cd507f832 net/mosquitto/files/smf/manifest.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/mosquitto/files/smf/manifest.xml      Thu Apr 16 15:19:11 2020 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type='manifest' name='@SMF_NAME@'>
+  <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'>
+    <create_default_instance enabled='false' />
+    <single_instance />
+
+    <!-- dependencies -->
+    <dependency name='fs-root' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/system/filesystem/root' />
+    </dependency>
+    <dependency name='network-service' grouping='require_all' restart_on='none' type='service'>
+      <service_fmri value='svc:/network/service'/>
+    </dependency>
+    <dependency name='config-file' grouping='require_all' restart_on='none' type='path'>
+      <service_fmri value='file://localhost/@PKG_SYSCONFDIR@/mosquitto.conf' />
+    </dependency>
+
+    <method_context></method_context>
+    <exec_method type='method' name='start' exec='@PREFIX@/@SMF_METHOD_FILE.mosquitto@ -d -c @PKG_SYSCONFDIR@/mosquitto.conf' timeout_seconds='60' />
+    <exec_method type='method' name='stop' exec=':kill' timeout_seconds='30' />
+
+    <template>
+      <common_name>
+        <loctext xml:lang='C'>Mosquitto MQTT Broker</loctext>
+      </common_name>
+      <documentation>
+        <doc_link name='Mosquitto' uri='https://mosquitto.org/'/>
+        <manpage title='mosquitto' section='8M' manpath='man' />
+      </documentation>
+    </template>
+  </service>
+</service_bundle>
diff -r 987e71a15fde -r a44cd507f832 net/mosquitto/files/smf/mosquitto.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/mosquitto/files/smf/mosquitto.sh      Thu Apr 16 15:19:11 2020 +0000
@@ -0,0 +1,14 @@
+#!@SMF_METHOD_SHELL@
+#
+# $NetBSD: mosquitto.sh,v 1.1 2020/04/16 15:19:11 jperkin Exp $
+#
+
+. /lib/svc/share/smf_include.sh
+
+if [ ! -d @VARBASE@/run/mosquitto ]; then
+       @MKDIR@ @VARBASE@/run/mosquitto
+       @CHMOD@ 0750 @VARBASE@/run/mosquitto
+       @CHOWN@ @MOSQUITTO_USER@:@MOSQUITTO_GROUP@ @VARBASE@/run/mosquitto
+fi
+
+@PREFIX@/sbin/mosquitto "$@"
diff -r 987e71a15fde -r a44cd507f832 net/mosquitto/patches/patch-mosquitto.conf
--- a/net/mosquitto/patches/patch-mosquitto.conf        Thu Apr 16 15:10:34 2020 +0000
+++ b/net/mosquitto/patches/patch-mosquitto.conf        Thu Apr 16 15:19:11 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-mosquitto.conf,v 1.1 2019/07/20 23:09:27 gdt Exp $
+$NetBSD: patch-mosquitto.conf,v 1.2 2020/04/16 15:19:11 jperkin Exp $
 
 Log to syslog, instead of (perhaps) not logging.
 
@@ -16,7 +16,7 @@
 +
 +### PKGSRC ADJUSTMENTS FOR TRADITIONAL UNIX NORMS
 +
-+pid_file /var/run/mosquitto/mosquitto.pid
++pid_file @VARBASE@/run/mosquitto/mosquitto.pid
 +
 +log_dest syslog
 +
diff -r 987e71a15fde -r a44cd507f832 net/mosquitto/patches/patch-src_CMakeLists.txt
--- a/net/mosquitto/patches/patch-src_CMakeLists.txt    Thu Apr 16 15:10:34 2020 +0000
+++ b/net/mosquitto/patches/patch-src_CMakeLists.txt    Thu Apr 16 15:19:11 2020 +0000
@@ -1,12 +1,12 @@
-$NetBSD: patch-src_CMakeLists.txt,v 1.1 2019/07/20 23:09:27 gdt Exp $
+$NetBSD: patch-src_CMakeLists.txt,v 1.2 2020/04/16 15:19:11 jperkin Exp $
 
 On NetBSD, don't use -ldl (why?).
 
 Sent upstream via email 20190427.
 
---- src/CMakeLists.txt.orig    2019-04-17 19:54:00.000000000 +0000
+--- src/CMakeLists.txt.orig    2020-02-27 23:49:51.000000000 +0000
 +++ src/CMakeLists.txt
-@@ -146,6 +146,8 @@ endif (HAVE_GETADDRINFO_A)
+@@ -151,6 +151,8 @@ endif (HAVE_GETADDRINFO_A AND WITH_ADNS)
  if (UNIX)
        if (APPLE)
                set (MOSQ_LIBS ${MOSQ_LIBS} dl m)
@@ -15,3 +15,15 @@
      elseif(QNX)
          set(MOSQ_LIBS ${MOSQ_LIBS} m socket)
      else(APPLE)
+@@ -184,9 +186,9 @@ target_link_libraries(mosquitto ${MOSQ_L
+ if (UNIX)
+       if (APPLE)
+               set_target_properties(mosquitto PROPERTIES LINK_FLAGS "-Wl,-exported_symbols_list -Wl,${mosquitto_SOURCE_DIR}/src/linker-macosx.syms")
+-      else (APPLE)
++      elseif (NOT CMAKE_SYSTEM_NAME STREQUAL SunOS)
+               set_target_properties(mosquitto PROPERTIES LINK_FLAGS "-Wl,-dynamic-list=${mosquitto_SOURCE_DIR}/src/linker.syms")
+-      endif (APPLE)
++      endif ()
+ endif (UNIX)
+ 
+ install(TARGETS mosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_SBINDIR}")



Home | Main Index | Thread Index | Old Index