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