Ticket #20367: Makefile

File Makefile, 2.2 KB (added by lxrfvg, 2 years ago)
Line 
1#
2# Copyright (C) 2015 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# This Makefile for ZeroMQ
8#
9
10include $(TOPDIR)/rules.mk
11
12PKG_NAME:=zeromq
13PKG_VERSION:=4.1.1
14PKG_RELEASE:=1
15PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
16PKG_LICENSE:=GPL-3.0+
17PKG_LICENSE_FILES:=LICENCE.txt
18
19PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
20PKG_SOURCE_URL:= http://download.zeromq.org
21PKG_MD5SUM:=0a4b44aa085644f25c177f79dc13f253
22
23PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
24PKG_BUILD_DEPENDS:=libuuid
25
26PKG_FIXUP:=autoreconf
27
28PKG_INSTALL:=1
29
30
31include $(INCLUDE_DIR)/uclibc++.mk
32include $(INCLUDE_DIR)/package.mk
33
34define Package/libzmq/default
35  TITLE:=ZeroMQ - Message Queue engine
36  URL:=http://www.zeromq.org/
37  SECTION:=libs
38  CATEGORY:=Libraries
39  DEPENDS:=+libuuid +libpthread +librt $(CXX_DEPENDS)
40  PROVIDES:=libzmq
41endef
42
43define Package/libzmq-nc
44  $(call Package/libzmq/default)
45  VARIANT:=nc
46endef
47
48define Package/libzmq-curve
49  $(call Package/libzmq/default)
50  VARIANT:=curve
51  TITLE+= (CurveZMQ)
52  DEPENDS+=+libsodium
53endef
54
55define Package/libzmq-nc/description
56 This package contains the ZeroMQ messaging engine shared library.
57endef
58
59define Package/libzmq-curve/description
60 $(call Package/libzmq-nc/description)
61 Includes CurveZMQ security by libsodium.
62endef
63
64# add extra configure flags here
65CONFIGURE_ARGS += \
66        --enable-static \
67        --enable-shared
68
69ifeq ($(BUILD_VARIANT),curve)
70  CONFIGURE_ARGS+= --with-libsodium
71else
72  CONFIGURE_ARGS+= --without-libsodium
73endif
74
75define Build/InstallDev
76        $(INSTALL_DIR) $(1)/usr/include
77        $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq.h $(1)/usr/include
78        $(CP) $(PKG_INSTALL_DIR)/usr/include/zmq_utils.h $(1)/usr/include
79        $(INSTALL_DIR) $(1)/usr/lib
80        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.{a,so*} $(1)/usr/lib/
81        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
82        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libzmq.pc $(1)/usr/lib/pkgconfig/
83endef
84
85define Package/libzmq-nc/install
86        $(INSTALL_DIR) $(1)/usr/lib
87        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzmq.so.* $(1)/usr/lib/
88endef
89
90Package/libzmq-curve/install=$(Package/libzmq-nc/install)
91
92$(eval $(call BuildPackage,libzmq-nc))
93$(eval $(call BuildPackage,libzmq-curve))