# # Copyright (c) 2022 Genexis B.V. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License 2.0 which is available at # https://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 # # Contributors: # Erik Karlsson - initial implementation # include $(TOPDIR)/rules.mk PKG_NAME:=mosquitto-auth-plugin PKG_VERSION:=1.3.0 PKG_MAINTAINER:=Erik Karlsson PKG_LICENSE:=EPL-2.0 PKG_BUILD_PARALLEL:=1 PKG_CONFIG_DEPENDS:=CONFIG_MOSQUITTO_AUTH_PAM_SUPPORT CONFIG_MOSQUITTO_AUTH_SUBNET_ACL_SUPPORT include $(INCLUDE_DIR)/package.mk define Package/mosquitto-auth-plugin SECTION:=net CATEGORY:=Network TITLE:=mosquitto - /etc/shadow authentication plugin DEPENDS:=+mosquitto-ssl +MOSQUITTO_AUTH_PAM_SUPPORT:libpam USERID:=mosquitto=200:mosquitto=200 mosquitto=200:shadow=11 endef define Package/mosquitto-auth-plugin/description Plugin for the mosquitto MQTT message broker that authenticates users using /etc/shadow endef define Package/mosquitto-auth-plugin/config source "$(SOURCE)/Config.in" endef ifeq ($(CONFIG_MOSQUITTO_AUTH_PAM_SUPPORT),y) TARGET_CFLAGS+=-DENABLE_PAM_SUPPORT endif define Package/mosquitto-auth-plugin/install $(INSTALL_DIR) $(1)/usr/lib $(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto_auth_plugin.so $(1)/usr/lib/ ifeq ($(CONFIG_MOSQUITTO_AUTH_SUBNET_ACL_SUPPORT),y) $(INSTALL_DIR) $(1)/usr/share/mosquitto $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DATA) ./files/usr/share/mosquitto/generate-subnet-acl.sh $(1)/usr/share/mosquitto/ $(INSTALL_DATA) ./files/etc/init.d/mosquitto-auth-plugin $(1)/etc/init.d/ endif $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DATA) ./files/etc/uci-defaults/14_set-shadow-permissions $(1)/etc/uci-defaults/ endef $(eval $(call BuildPackage,mosquitto-auth-plugin))