42ec94d166c044502d99769ee82ac33397c50377
[15.05/openwrt.git] / package / libs / libevent2 / Makefile
1 #
2 # Copyright (C) 2011-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libevent2
11 PKG_VERSION:=2.0.21
12 PKG_RELEASE:=1
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/libevent-$(PKG_VERSION)-stable
15 PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz
16 PKG_SOURCE_URL:=http://www.monkey.org/~provos/ \
17         @SF/levent
18 PKG_MD5SUM:=b2405cc9ebf264aa47ff615d9de527a2
19 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
20
21 PKG_FIXUP:=autoreconf
22 PKG_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/libevent2/Default
28   SECTION:=libs
29   CATEGORY:=Libraries
30   TITLE:=Event notification
31   URL:=http://www.monkey.org/~provos/libevent/
32 endef
33
34 define Package/libevent2/Default/description
35         The libevent API provides a mechanism to execute a callback function
36         when a specific event occurs on a file descriptor or after a timeout
37         has been reached. Furthermore, libevent also support callbacks due
38         to signals or regular timeouts.
39
40         libevent is meant to replace the event loop found in event driven
41         network servers. An application just needs to call event_dispatch()
42         and then add or remove events dynamically without having to change
43         the event loop.
44 endef
45
46 define Package/libevent2
47   $(call Package/libevent2/Default)
48   TITLE+= library (version 2.0)
49 endef
50
51 define Package/libevent2/description
52         $(call Package/libevent2/Default/description)
53
54         This package contains the libevent shared library historically
55         containing both the core & extra libraries.
56 endef
57
58 define Package/libevent2-core
59   $(call Package/libevent2/Default)
60   TITLE+= core library (version 2.0)
61 endef
62
63 define Package/libevent2-core/description
64         $(call Package/libevent2/Default/description)
65
66         This package contains the libevent core shared library for the event,
67         buffer & utility functions.
68 endef
69
70 define Package/libevent2-extra
71   $(call Package/libevent2/Default)
72   TITLE+= extra library (version 2.0)
73 endef
74
75 define Package/libevent2-extra/description
76         $(call Package/libevent2/Default/description)
77
78         This package contains the libevent extra shared library for specific
79         protocols including HTTP, DNS & RPC.
80 endef
81
82 define Package/libevent2-openssl
83   $(call Package/libevent2/Default)
84   TITLE+= OpenSSL library (version 2.0)
85   DEPENDS+=+libopenssl
86 endef
87
88 define Package/libevent2-openssl/description
89         $(call Package/libevent2/Default/description)
90
91         This package contains the libevent OpenSSL shared library for encrypted
92         bufferevents.
93 endef
94
95 define Package/libevent2-pthreads
96   $(call Package/libevent2/Default)
97   TITLE+= Pthreads library (version 2.0)
98   DEPENDS+=+libpthread
99 endef
100
101 define Package/libevent2-pthreads/description
102         $(call Package/libevent2/Default/description)
103
104         This package contains the libevent Pthreads shared library for
105         threading & locking.
106 endef
107
108 TARGET_CFLAGS += $(FPIC)
109
110 CONFIGURE_ARGS += \
111         --enable-shared \
112         --enable-static \
113         --disable-debug-mode
114
115 MAKE_FLAGS += \
116         CFLAGS="$(TARGET_CFLAGS)"
117
118 define Build/InstallDev
119         $(INSTALL_DIR) $(1)/usr/include
120         $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
121         $(INSTALL_DIR) $(1)/usr/lib
122         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent*.{la,a,so} $(1)/usr/lib/
123         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent*-2.0.so* $(1)/usr/lib/
124         $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
125         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libevent*.pc $(1)/usr/lib/pkgconfig/
126 endef
127
128 define Package/libevent2/install
129         $(INSTALL_DIR) $(1)/usr/lib
130         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-2.0.so.* $(1)/usr/lib/
131 endef
132
133 define Package/libevent2-core/install
134         $(INSTALL_DIR) $(1)/usr/lib
135         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_core-2.0.so.* $(1)/usr/lib/
136 endef
137
138 define Package/libevent2-extra/install
139         $(INSTALL_DIR) $(1)/usr/lib
140         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_extra-2.0.so.* $(1)/usr/lib/
141 endef
142
143 define Package/libevent2-openssl/install
144         $(INSTALL_DIR) $(1)/usr/lib
145         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_openssl-2.0.so.* $(1)/usr/lib/
146 endef
147
148 define Package/libevent2-pthreads/install
149         $(INSTALL_DIR) $(1)/usr/lib
150         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent_pthreads-2.0.so.* $(1)/usr/lib/
151 endef
152
153 $(eval $(call BuildPackage,libevent2))
154 $(eval $(call BuildPackage,libevent2-core))
155 $(eval $(call BuildPackage,libevent2-extra))
156 $(eval $(call BuildPackage,libevent2-openssl))
157 $(eval $(call BuildPackage,libevent2-pthreads))