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