lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

Makefile (7003B)


      1 #
      2 # Copyright (C) 2011-2013 OpenWrt.org
      3 # Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
      4 #
      5 # This is free software, licensed under the GNU General Public License v2.
      6 # See /LICENSE for more information.
      7 #
      8 
      9 include $(TOPDIR)/rules.mk
     10 
     11 PKG_NAME:=mosquitto
     12 PKG_VERSION:=1.4.10
     13 PKG_RELEASE:=2
     14 PKG_LICENSE:=BSD-3-Clause
     15 PKG_LICENSE_FILES:=LICENSE.txt
     16 
     17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
     18 PKG_SOURCE_URL:=http://mosquitto.org/files/source/
     19 PKG_MD5SUM:=61839b47b58c5799aab76584f13ed66f
     20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
     21 
     22 include $(INCLUDE_DIR)/package.mk
     23 
     24 define Package/mosquitto/default
     25   SECTION:=net
     26   CATEGORY:=Network
     27   TITLE:=mosquitto - an MQTT message broker
     28   URL:=http://www.mosquitto.org/
     29   MAINTAINER:=Karl Palsson <karlp@etactica.com>
     30   DEPENDS:= +librt +libuuid
     31   USERID:=mosquitto=200:mosquitto=200
     32 endef
     33 
     34 define Package/mosquitto-ssl
     35     $(call Package/mosquitto/default)
     36     TITLE+= (with SSL support)
     37     DEPENDS+= +libopenssl +MOSQUITTO_LWS:libwebsockets-openssl
     38     VARIANT:=ssl
     39     PROVIDES:=mosquitto
     40 endef
     41 
     42 define Package/mosquitto-nossl
     43     $(call Package/mosquitto/default)
     44     TITLE+= (without SSL support)
     45     VARIANT:=nossl
     46     PROVIDES:=mosquitto
     47 endef
     48 
     49 define Package/mosquitto-ssl/config
     50 	source "$(SOURCE)/Config.in"
     51 endef
     52 
     53 define Package/mosquitto/default/description
     54 Mosquitto is an open source (BSD licensed) message broker that implements
     55 the MQTT protocol version 3.1 and 3.1.1. MQTT provides a lightweight
     56 method of carrying out messaging using a publish/subscribe model.
     57 
     58 This package also includes some basic support for configuring via UCI
     59 endef
     60 
     61 define Package/mosquitto-ssl/description
     62 	$(call Package/mosquitto/default/description)
     63 	This package is built with SSL support
     64 endef
     65 
     66 define Package/mosquitto-nossl/description
     67         $(call Package/mosquitto/default/description)
     68         This package is built WITHOUT SSL support.
     69 endef
     70 
     71 
     72 define Package/mosquitto-client/default
     73     $(Package/mosquitto/default)
     74     TITLE:= mosquitto - client tools
     75     DEPENDS+=+libcares
     76 endef
     77 define Package/mosquitto-client
     78     $(call Package/mosquitto-client/default)
     79     TITLE+= (With SSL support)
     80     DEPENDS+=+libmosquitto-ssl
     81     VARIANT:=ssl
     82 endef
     83 define Package/mosquitto-client-nossl
     84     $(call Package/mosquitto-client/default)
     85     TITLE+= (Without SSL support)
     86     DEPENDS+=+libmosquitto-nossl
     87     VARIANT:=nossl
     88 endef
     89 
     90 define Package/mosquitto-client/default/description
     91  Command line client tools for publishing messages to MQTT servers
     92 and subscribing to topics.
     93 endef
     94 
     95 define Package/mosquitto-client/description
     96 $(call Package/mosquitto-client/default/description)
     97         This package is built with SSL support
     98 endef
     99 define Package/mosquitto-client-nossl/description
    100 $(call Package/mosquitto-client/default/description)
    101         This package is built without SSL support
    102 endef
    103 
    104 define Package/libmosquitto/default
    105     $(Package/mosquitto/default)
    106     SECTION:=libs
    107     CATEGORY:=Libraries
    108     DEPENDS:=+libpthread +librt +libcares
    109     TITLE:= mosquitto - client library
    110     PROVIDES:=libmosquitto
    111 endef
    112 
    113 define Package/libmosquitto-ssl
    114     $(call Package/libmosquitto/default)
    115     TITLE+= (With SSL Support)
    116     DEPENDS+= +libopenssl
    117     VARIANT=ssl
    118 endef
    119 define Package/libmosquitto-nossl
    120     $(call Package/libmosquitto/default)
    121     TITLE+= (Without SSL Support)
    122     VARIANT=nossl
    123 endef
    124 
    125 define Package/libmosquitto/default/description
    126  Library required for mosquitto's command line client tools, also for
    127 use by any third party software that wants to communicate with a
    128 mosquitto server.
    129 
    130 Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
    131 server, such as IBM's RSMB, in addition to Mosquitto
    132 endef
    133 
    134 define Package/libmosquitto-ssl/description
    135     $(call Package/libmosquitto/default/description)
    136     This package is built with SSL support
    137 endef
    138 define Package/libmosquitto-nossl/description
    139     $(call Package/libmosquitto/default/description)
    140     This package is built without SSL support
    141 endef
    142 
    143 define Package/libmosquittopp
    144     SECTION:=libs
    145     CATEGORY:=Libraries
    146     DEPENDS:=+libmosquitto-ssl +libstdcpp
    147     TITLE:= mosquitto - client c++ library
    148 endef
    149 
    150 define Package/libmosquittopp/description
    151  C++ Library wrapper for libmosquitto.
    152 endef
    153 
    154 define Package/mosquitto-ssl/conffiles
    155 /etc/mosquitto/mosquitto.conf
    156 /etc/config/mosquitto
    157 endef
    158 
    159 Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles)
    160 
    161 define Package/mosquitto/install/default
    162 	$(INSTALL_DIR) $(1)/usr/sbin
    163 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
    164 	$(INSTALL_DIR) $(1)/etc/mosquitto
    165 	$(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
    166 	$(CP) ./files/* $(1)/
    167 endef
    168 
    169 define Package/mosquitto-nossl/install
    170 	$(call Package/mosquitto/install/default,$(1))
    171 endef
    172 
    173 define Package/mosquitto-ssl/install
    174 	$(call Package/mosquitto/install/default,$(1))
    175 ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
    176 	$(INSTALL_DIR) $(1)/usr/bin
    177 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/bin
    178 endif
    179 endef
    180 
    181 define Package/mosquitto-client/install
    182 	$(INSTALL_DIR) $(1)/usr/bin
    183 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
    184 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
    185 endef
    186 Package/mosquitto-client-nossl/install = $(Package/mosquitto-client/install)
    187 
    188 # This installs files into ./staging_dir/. so that you can cross compile from the host
    189 define Build/InstallDev
    190 	$(INSTALL_DIR) $(1)/usr/include
    191 	$(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
    192 	$(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include
    193 	$(INSTALL_DIR) $(1)/usr/lib
    194 	$(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
    195 	$(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
    196 	$(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
    197 	$(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
    198 endef
    199 
    200 # This installs files on the target.  Compare with Build/InstallDev
    201 define Package/libmosquitto-ssl/install
    202 	$(INSTALL_DIR) $(1)/usr/lib
    203 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
    204 	$(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
    205 endef
    206 Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install)
    207 
    208 define Package/libmosquittopp/install
    209 	$(INSTALL_DIR) $(1)/usr/lib
    210 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
    211 	$(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
    212 endef
    213 
    214 # Applies to all...
    215 MAKE_FLAGS += WITH_DOCS=no UNAME=Linux
    216 ifeq ($(BUILD_VARIANT),nossl)
    217 	MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
    218 else
    219 	MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
    220 endif
    221 
    222 $(eval $(call BuildPackage,mosquitto-ssl))
    223 $(eval $(call BuildPackage,mosquitto-nossl))
    224 $(eval $(call BuildPackage,libmosquitto-ssl))
    225 $(eval $(call BuildPackage,libmosquitto-nossl))
    226 $(eval $(call BuildPackage,libmosquittopp))
    227 $(eval $(call BuildPackage,mosquitto-client))
    228 $(eval $(call BuildPackage,mosquitto-client-nossl))