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