Port palantir to -ng
[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:=Event notification library for event-driven network servers.\\\
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 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
44 $(TARGET_CONFIGURE_OPTS) \
45 CFLAGS="$(TARGET_CFLAGS)" \
46 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
47 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
48 ./configure \
49 --target=$(GNU_TARGET_NAME) \
50 --host=$(GNU_TARGET_NAME) \
51 --build=$(GNU_HOST_NAME) \
52 --program-prefix="" \
53 --program-suffix="" \
54 --prefix=/usr \
55 --exec-prefix=/usr \
56 --bindir=/usr/bin \
57 --datadir=/usr/share \
58 --includedir=/usr/include \
59 --infodir=/usr/share/info \
60 --libdir=/usr/lib \
61 --libexecdir=/usr/lib \
62 --localstatedir=/var \
63 --mandir=/usr/share/man \
64 --sbindir=/usr/sbin \
65 --sysconfdir=/etc \
66 $(DISABLE_LARGEFILE) \
67 $(DISABLE_NLS) \
68 --enable-shared \
69 --enable-static \
70 );
71 endef
72
73 define Build/Compile
74 rm -rf $(PKG_INSTALL_DIR)
75 mkdir -p $(PKG_INSTALL_DIR)
76 $(MAKE) -C $(PKG_BUILD_DIR) \
77 DESTDIR="$(PKG_INSTALL_DIR)" \
78 all install
79 endef
80
81 define Package/libevent/install
82 install -d -m0755 $(1)/usr/lib
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-$(PKG_VERSION).so.* $(1)/usr/lib/
84 endef
85
86 define Build/InstallDev
87 mkdir -p $(STAGING_DIR)/usr/include
88 $(CP) $(PKG_INSTALL_DIR)/usr/include/event.h $(STAGING_DIR)/usr/include/
89 mkdir -p $(STAGING_DIR)/usr/lib
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent.{a,so} $(STAGING_DIR)/usr/lib/
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevent-$(PKG_VERSION).so* $(STAGING_DIR)/usr/lib/
92 endef
93
94 define Build/UninstallDev
95 rm -rf \
96 $(STAGING_DIR)/usr/include/event.h \
97 $(STAGING_DIR)/usr/lib/libevent.{a,so} \
98 $(STAGING_DIR)/usr/lib/libevent-$(PKG_VERSION).so*
99 endef
100
101 $(eval $(call BuildPackage,libevent))