f842364cca07c8bd3e68db5a1fec6b027a7bbd89
[openwrt/svn-archive/archive.git] / libs / libdnet / Makefile
1 #
2 # Copyright (C) 2006-2008 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:=libdnet
12 PKG_VERSION:=1.10
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
17 PKG_MD5SUM:=416b765e9d9961501ac85e9a366fd219
18 PKG_FIXUP:=libtool
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/libdnet
23 SECTION:=libs
24 CATEGORY:=Libraries
25 TITLE:=Low-level network library
26 URL:=http://sourceforge.net/projects/libdnet/
27 endef
28
29 define Package/libdnet/description
30 libdnet is a library of simplified, portable interface to several
31 low-level networking routines.
32 endef
33
34 define Package/pydnet
35 SECTION:=libs
36 DEPENDS:=libdnet +python-mini
37 CATEGORY:=Libraries
38 TITLE:=Low-level network library
39 URL:=http://sourceforge.net/projects/libdnet/
40 endef
41
42 define Package/pydnet/description
43 libdnet is a library of simplified, portable interface to several
44 low-level networking routines.
45 endef
46
47 TARGET_CFLAGS += $(FPIC)
48
49 CONFIGURE_ARGS += \
50 --enable-shared \
51 --enable-static \
52 --without-check \
53 --without-python
54
55 CONFIGURE_VARS += \
56 ac_cv_dnet_bsd_bpf=no
57
58 MAKE_FLAGS += \
59 DESTDIR="$(PKG_INSTALL_DIR)" \
60 all install
61
62 define Build/InstallDev
63 $(INSTALL_DIR) $(2)/bin
64 $(INSTALL_BIN) \
65 $(PKG_INSTALL_DIR)/usr/bin/dnet-config \
66 $(2)/bin/
67 $(SED) \
68 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
69 $(2)/bin/dnet-config
70
71 $(INSTALL_DIR) $(1)/usr/include
72 $(INSTALL_DATA)\
73 $(PKG_INSTALL_DIR)/usr/include/dnet.h \
74 $(1)/usr/include/
75 $(CP) \
76 $(PKG_INSTALL_DIR)/usr/include/dnet \
77 $(1)/usr/include/
78
79 $(INSTALL_DIR) $(1)/usr/lib
80 $(CP) \
81 $(PKG_INSTALL_DIR)/usr/lib/libdnet.{la,a,so*} \
82 $(1)/usr/lib/
83 endef
84
85 define Package/libdnet/install
86 $(INSTALL_DIR) $(1)/usr/lib
87 $(CP) \
88 $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* \
89 $(1)/usr/lib/
90
91 $(INSTALL_DIR) $(1)/usr/sbin
92 $(INSTALL_BIN) \
93 $(PKG_INSTALL_DIR)/usr/sbin/dnet \
94 $(1)/usr/sbin/
95 endef
96
97 define Package/pydnet/install
98 $(INSTALL_DIR) $(1)/usr/lib
99 cd $(PKG_BUILD_DIR)/python; \
100 CFLAGS="$(TARGET_CFLAGS)" \
101 $(STAGING_DIR)/usr/bin/hostpython ./setup.py install \
102 --no-compile --prefix $(PKG_INSTALL_DIR)/usr
103 cp -a $(PKG_INSTALL_DIR)/usr/lib/python* $(1)/usr/lib/
104 endef
105
106
107 $(eval $(call BuildPackage,libdnet))
108 $(eval $(call BuildPackage,pydnet))