1#
2# Copyright (C) 2006-2011 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=libevent
11PKG_VERSION:=1.4.14b
12PKG_RELEASE:=2
13
14PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-stable
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-stable.tar.gz
16PKG_SOURCE_URL:=http://www.monkey.org/~provos/
17PKG_MD5SUM:=a00e037e4d3f9e4fe9893e8a2d27918c
18
19PKG_FIXUP:=autoreconf
20PKG_INSTALL:=1
21PKG_BUILD_PARALLEL:=1
22
23include $(INCLUDE_DIR)/package.mk
24
25define Package/libevent
26  SECTION:=libs
27  CATEGORY:=Libraries
28  TITLE:=Event notification library
29  DEPENDS:=+librt
30  URL:=http://www.monkey.org/~provos/libevent/
31endef
32
33define Package/libevent/description
34	The libevent API provides a mechanism to execute a callback function
35	when a specific event occurs on a file descriptor or after a timeout
36	has been reached. Furthermore, libevent also support callbacks due
37	to signals or regular timeouts.
38
39	libevent is meant to replace the event loop found in event driven
40	network servers. An application just needs to call event_dispatch()
41	and then add or remove events dynamically without having to change
42	the event loop.
43endef
44
45TARGET_CFLAGS += $(FPIC)
46
47CONFIGURE_ARGS += \
48	--enable-shared \
49	--enable-static \
50
51MAKE_FLAGS += \
52	CFLAGS="$(TARGET_CFLAGS)" \
53
54define Build/InstallDev
55	$(INSTALL_DIR) $(1)/usr/include/libevent
56	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/libevent/
57	$(INSTALL_DIR) $(1)/usr/lib/libevent
58	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so} $(1)/usr/lib/libevent/
59endef
60
61define Package/libevent/install
62	$(INSTALL_DIR) $(1)/usr/lib
63	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
64endef
65
66$(eval $(call BuildPackage,libevent))
67