remove PKG_CAT from packages
[packages.git] / libs / libdnet / 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:=libdnet
12 PKG_VERSION:=1.10
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
17 PKG_MD5SUM:=416b765e9d9961501ac85e9a366fd219
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/libdnet-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libdnet
25   SECTION:=libs
26   CATEGORY:=Libraries
27   TITLE:=Low-level network library
28   URL:=http://sourceforge.net/projects/libdnet/
29 endef
30
31 define Package/libdnet/description
32         libdnet is a library of simplified, portable interface to several 
33         low-level networking routines.
34 endef
35
36 define Package/pydnet
37   SECTION:=libs
38   DEPENDS:=libdnet +python
39   CATEGORY:=Libraries
40   TITLE:=Low-level network library
41   URL:=http://sourceforge.net/projects/libdnet/
42 endef
43
44 define Package/pydnet/description
45         libdnet is a library of simplified, portable interface to several 
46         low-level networking routines.
47 endef
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         mkdir -p $(1)/usr/bin
64         $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnet-config $(1)/usr/bin/
65         mkdir -p $(1)/usr/include
66         $(CP) $(PKG_INSTALL_DIR)/usr/include/dnet.h $(1)/usr/include/
67         $(CP) $(PKG_INSTALL_DIR)/usr/include/dnet $(1)/usr/include/
68         mkdir -p $(1)/usr/lib
69         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnet.{a,so*} $(1)/usr/lib/
70 endef
71
72 define Build/UninstallDev
73         rm -rf \
74                 $(STAGING_DIR)/usr/bin/dnet-config \
75                 $(STAGING_DIR)/usr/include/dnet.h  \
76                 $(STAGING_DIR)/usr/include/dnet  \
77                 $(STAGING_DIR)/usr/lib/libdnet.{a,so*}
78 endef
79
80 define Package/libdnet/install
81         $(INSTALL_DIR) $(1)/usr/lib
82         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* $(1)/usr/lib/
83         $(INSTALL_DIR) $(1)/usr/sbin
84         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnet $(1)/usr/sbin/
85 endef
86
87 define Package/pydnet/install
88         $(INSTALL_DIR) $(1)/usr/lib
89         cd $(PKG_BUILD_DIR)/python; \
90         CFLAGS="$(TARGET_CFLAGS)" \
91         $(STAGING_DIR)/usr/bin/hostpython ./setup.py install \
92                 --no-compile --prefix $(PKG_INSTALL_DIR)/usr
93         cp -a $(PKG_INSTALL_DIR)/usr/lib/python* $(1)/usr/lib/
94 endef
95
96
97 $(eval $(call BuildPackage,libdnet))
98 $(eval $(call BuildPackage,pydnet))