| 1 | # |
| 2 | # Copyright (C) 2011-2012 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.19 |
| 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:=91111579769f46055b0a438f5cc59572 |
| 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 | DEPENDS:=+USE_EGLIBC:librt |
| 33 | endef |
| 34 | |
| 35 | define Package/libevent2/Default/description |
| 36 | The libevent API provides a mechanism to execute a callback function |
| 37 | when a specific event occurs on a file descriptor or after a timeout |
| 38 | has been reached. Furthermore, libevent also support callbacks due |
| 39 | to signals or regular timeouts. |
| 40 | |
| 41 | libevent is meant to replace the event loop found in event driven |
| 42 | network servers. An application just needs to call event_dispatch() |
| 43 | and then add or remove events dynamically without having to change |
| 44 | the event loop. |
| 45 | endef |
| 46 | |
| 47 | define Package/libevent2 |
| 48 | $(call Package/libevent2/Default) |
| 49 | TITLE+= library (version 2.0) |
| 50 | endef |
| 51 | |
| 52 | define Package/libevent2/description |
| 53 | $(call Package/libevent2/Default/description) |
| 54 | |
| 55 | This package contains the libevent shared library historically |
| 56 | containing both the core & extra libraries. |
| 57 | endef |
| 58 | |
| 59 | define Package/libevent2-core |
| 60 | $(call Package/libevent2/Default) |
| 61 | TITLE+= core library (version 2.0) |
| 62 | endef |
| 63 | |
| 64 | define Package/libevent2-core/description |
| 65 | $(call Package/libevent2/Default/description) |
| 66 | |
| 67 | This package contains the libevent core shared library for the event, |
| 68 | buffer & utility functions. |
| 69 | endef |
| 70 | |
| 71 | define Package/libevent2-extra |
| 72 | $(call Package/libevent2/Default) |
| 73 | TITLE+= extra library (version 2.0) |
| 74 | endef |
| 75 | |
| 76 | define Package/libevent2-extra/description |
| 77 | $(call Package/libevent2/Default/description) |
| 78 | |
| 79 | This package contains the libevent extra shared library for specific |
| 80 | protocols including HTTP, DNS & RPC. |
| 81 | endef |
| 82 | |
| 83 | define Package/libevent2-openssl |
| 84 | $(call Package/libevent2/Default) |
| 85 | TITLE+= OpenSSL library (version 2.0) |
| 86 | DEPENDS+=+libopenssl |
| 87 | endef |
| 88 | |
| 89 | define Package/libevent2-openssl/description |
| 90 | $(call Package/libevent2/Default/description) |
| 91 | |
| 92 | This package contains the libevent OpenSSL shared library for encrypted |
| 93 | bufferevents. |
| 94 | endef |
| 95 | |
| 96 | define Package/libevent2-pthreads |
| 97 | $(call Package/libevent2/Default) |
| 98 | TITLE+= Pthreads library (version 2.0) |
| 99 | DEPENDS+=+libpthread |
| 100 | endef |
| 101 | |
| 102 | define Package/libevent2-pthreads/description |
| 103 | $(call Package/libevent2/Default/description) |
| 104 | |
| 105 | This package contains the libevent Pthreads shared library for |
| 106 | threading & locking. |
| 107 | endef |
| 108 | |
| 109 | TARGET_CFLAGS += $(FPIC) |
| 110 | |
| 111 | CONFIGURE_ARGS += \ |
| 112 | --enable-shared \ |
| 113 | --enable-static |
| 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)) |
| 158 | |