replace lots of manual install commands with INSTALL_* variables
[openwrt/svn-archive/archive.git] / libs / libevent / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libevent
12 PKG_VERSION:=1.1
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://www.monkey.org/~provos/
18 PKG_MD5SUM:=a5bd281aeb41bdaa48fbbf0495423d20
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libevent
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Event notification library
29 DESCRIPTION:=\
30 The libevent API provides a mechanism to execute a callback function \\\
31 when a specific event occurs on a file descriptor or after a timeout \\\
32 has been reached. Furthermore, libevent also support callbacks due \\\
33 to signals or regular timeouts.\\\
34 \\\
35 libevent is meant to replace the event loop found in event driven \\\
36 network servers. An application just needs to call event_dispatch() \\\
37 and then add or remove events dynamically without having to change \\\
38 the event loop.
39 URL:=http://www.monkey.org/~provos/libevent/
40 endef
41
42 define Build/Configure
43 $(call Build/Configure/Default, \
44 --enable-shared \
45 --enable-static \
46 )
47 endef
48
49 define Build/Compile
50 $(MAKE) -C $(PKG_BUILD_DIR) \
51 DESTDIR="$(PKG_INSTALL_DIR)" \
52 all install
53 endef
54
55 define Build/InstallDev
56 mkdir -p $(STAGING_DIR)/usr/include
57 $(CP) $(PKG_INSTALL_DIR)/usr/include/event.h $(STAGING_DIR)/usr/include/
58 mkdir -p $(STAGING_DIR)/usr/lib
59 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent.{a,so} $(STAGING_DIR)/usr/lib/
60 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-$(PKG_VERSION).so* $(STAGING_DIR)/usr/lib/
61 endef
62
63 define Build/UninstallDev
64 rm -rf \
65 $(STAGING_DIR)/usr/include/event.h \
66 $(STAGING_DIR)/usr/lib/libevent.{a,so} \
67 $(STAGING_DIR)/usr/lib/libevent-$(PKG_VERSION).so*
68 endef
69
70 define Package/libevent/install
71 $(INSTALL_DIR) $(1)/usr/lib
72 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-$(PKG_VERSION).so.* $(1)/usr/lib/
73 endef
74
75 $(eval $(call BuildPackage,libevent))