Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosquitto: fix build on illumos #59

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions net/mosquitto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ USE_LANGUAGES+= c c++
USE_CMAKE= yes
USE_TOOLS+= gmake

LDFLAGS.SunOS+= -lsocket -lnsl
CMAKE_ARGS+= -DCMAKE_INSTALL_SYSCONFDIR=${PREFIX}/share/examples

MOSQUITTO_USER= mosquitto
Expand All @@ -38,6 +39,7 @@ SUBST_FILES.paths= mosquitto.conf
SUBST_VARS.paths= SSLCERTS

RCD_SCRIPTS= mosquitto
SMF_METHODS= mosquitto
FILES_SUBST+= MOSQUITTO_USER=${MOSQUITTO_USER}
FILES_SUBST+= MOSQUITTO_GROUP=${MOSQUITTO_GROUP}
FILES_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
Expand Down
2 changes: 1 addition & 1 deletion net/mosquitto/distinfo
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ 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-src_CMakeLists.txt) = 66571704d96c672b8c1537794cf492e9cfce2e0c
33 changes: 33 additions & 0 deletions net/mosquitto/files/smf/manifest.xml
Original file line number Diff line number Diff line change
@@ -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>
14 changes: 14 additions & 0 deletions net/mosquitto/files/smf/mosquitto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!@SMF_METHOD_SHELL@
#
# $NetBSD: mosquitto.sh,v 1.1 2020/04/11 16:17:42 ??? 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 "$@"
16 changes: 14 additions & 2 deletions net/mosquitto/patches/patch-src_CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ 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)
Expand All @@ -15,3 +15,15 @@ Sent upstream via email 20190427.
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}")