libvorbisdec: moved to github
[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:=autoreconf
19 PKG_INSTALL:=1
20
21 PKG_CONFIG_DEPENDS:=\
22         CONFIG_PACKAGE_libdnet \
23         CONFIG_PACKAGE_pydnet
24
25 PKG_BUILD_DEPENDS:=PACKAGE_pydnet:python
26
27 include $(INCLUDE_DIR)/package.mk
28 $(call include_mk, python-package.mk)
29
30 define Package/libdnet/Default
31   SECTION:=libs
32   CATEGORY:=Libraries
33   TITLE:=Low-level network library
34   URL:=http://sourceforge.net/projects/libdnet/
35 endef
36
37 define Package/libdnet/Default/description
38         libdnet is a library of simplified, portable interface to several
39         low-level networking routines.
40 endef
41
42 define Package/libdnet
43   $(call Package/libdnet/Default)
44 endef
45
46 define Package/libdnet/description
47   $(call Package/libdnet/Default/description)
48 endef
49
50 define Package/pydnet
51   $(call Package/libdnet/Default)
52   DEPENDS:=libdnet +python-mini
53 endef
54
55 define Package/pydnet/description
56   $(call Package/libdnet/Default/description)
57   This package contains the python dnet library.
58 endef
59
60 TARGET_CFLAGS += $(FPIC)
61
62 CONFIGURE_ARGS += \
63         --enable-shared \
64         --enable-static \
65         --without-check \
66         --without-python
67
68 CONFIGURE_VARS += \
69         ac_cv_dnet_bsd_bpf=no
70
71 MAKE_FLAGS += \
72         CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE"
73
74 define Build/Configure
75         (cd $(PKG_BUILD_DIR); \
76                 ln -sf config/acinclude.m4 . ; \
77                 autoreconf -v --install || exit 1 \
78         );
79         $(call Build/Configure/Default)
80 endef
81
82 define Build/Compile
83         $(call Build/Compile/Default)
84         $(if $(CONFIG_PACKAGE_pydnet), \
85                 $(call Build/Compile/PyMod, \
86                         python/, \
87                         build \
88                 ) \
89         )
90 endef
91
92 define Build/Install
93         $(call Build/Install/Default)
94         $(if $(CONFIG_PACKAGE_pydnet), \
95                 $(call Build/Compile/PyMod, \
96                         python/, \
97                         install --no-compile --prefix $(PKG_INSTALL_DIR)/usr \
98                 ) \
99         )
100 endef
101
102 define Build/InstallDev
103         $(INSTALL_DIR) $(2)/bin
104         $(INSTALL_BIN) \
105                 $(PKG_INSTALL_DIR)/usr/bin/dnet-config \
106                 $(2)/bin/
107         $(SED) \
108                 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
109                 $(2)/bin/dnet-config
110
111         $(INSTALL_DIR) $(1)/usr/include
112         $(INSTALL_DATA)\
113                 $(PKG_INSTALL_DIR)/usr/include/dnet.h \
114                 $(1)/usr/include/
115         $(CP) \
116                 $(PKG_INSTALL_DIR)/usr/include/dnet \
117                 $(1)/usr/include/
118
119         $(INSTALL_DIR) $(1)/usr/lib
120         $(CP) \
121                 $(PKG_INSTALL_DIR)/usr/lib/libdnet.{la,a,so*} \
122                 $(1)/usr/lib/
123 endef
124
125 define Package/libdnet/install
126         $(INSTALL_DIR) $(1)/usr/lib
127         $(CP) \
128                 $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* \
129                 $(1)/usr/lib/
130
131         $(INSTALL_DIR) $(1)/usr/sbin
132         $(INSTALL_BIN) \
133                 $(PKG_INSTALL_DIR)/usr/sbin/dnet \
134                 $(1)/usr/sbin/
135 endef
136
137 define Package/pydnet/install
138         $(INSTALL_DIR) $(1)/usr/lib
139         $(CP) $(PKG_INSTALL_DIR)/usr/lib/python* $(1)/usr/lib/
140 endef
141
142
143 $(eval $(call BuildPackage,libdnet))
144 $(eval $(call BuildPackage,pydnet))