port libdnet to buildroot-ng
[openwrt/svn-archive/archive.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_BUILD_DIR:=$(BUILD_DIR)/libdnet-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
18 PKG_MD5SUM:=416b765e9d9961501ac85e9a366fd219
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libdnet
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Low-level network library
29 DESCRIPTION:=Low-level network library.\\\
30 libdnet is a library of simplified, portable interface to several \\\
31 low-level networking routines.
32 URL:=http://sourceforge.net/projects/libdnet/
33 endef
34
35 define Build/Configure
36 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
37 touch configure.in; \
38 touch include.m4; \
39 touch aclocal.m4; \
40 touch Makefile.in; \
41 touch configure; \
42 $(TARGET_CONFIGURE_OPTS) \
43 CFLAGS="$(TARGET_CFLAGS)" \
44 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
45 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
46 ./configure \
47 --target=$(GNU_TARGET_NAME) \
48 --host=$(GNU_TARGET_NAME) \
49 --build=$(GNU_HOST_NAME) \
50 --program-prefix="" \
51 --program-suffix="" \
52 --prefix=/usr \
53 --exec-prefix=/usr \
54 --bindir=/usr/bin \
55 --datadir=/usr/share \
56 --includedir=/usr/include \
57 --infodir=/usr/share/info \
58 --libdir=/usr/lib \
59 --libexecdir=/usr/lib \
60 --localstatedir=/var/run \
61 --mandir=/usr/share/man \
62 --sbindir=/usr/sbin \
63 --sysconfdir=/etc \
64 $(DISABLE_NLS) \
65 $(DISABLE_LARGEFILE) \
66 --enable-shared \
67 --enable-static \
68 );
69 endef
70
71 define Build/Compile
72 rm -rf $(PKG_INSTALL_DIR)
73 mkdir -p $(PKG_INSTALL_DIR)
74 $(MAKE) -C $(PKG_BUILD_DIR) \
75 $(TARGET_CONFIGURE_OPTS) \
76 CFLAGS="$(TARGET_CFLAGS)" \
77 DESTDIR="$(PKG_INSTALL_DIR)" \
78 all install
79 endef
80
81 define Package/libdnet/install
82 install -m0755 -d $(1)/usr/lib
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* $(1)/usr/lib/
84 install -m0755 -d $(1)/usr/sbin
85 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnet $(1)/usr/sbin/
86 endef
87
88 define Build/InstallDev
89 mkdir -p $(STAGING_DIR)/usr/bin
90 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnet-config $(STAGING_DIR)/usr/bin/
91 mkdir -p $(STAGING_DIR)/usr/include
92 $(CP) $(PKG_INSTALL_DIR)/usr/include/dnet.h $(STAGING_DIR)/usr/include/
93 $(CP) $(PKG_INSTALL_DIR)/usr/include/dnet $(STAGING_DIR)/usr/include/
94 mkdir -p $(STAGING_DIR)/usr/lib
95 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnet.{a,so*} $(STAGING_DIR)/usr/lib/
96 endef
97
98 define Build/UninstallDev
99 rm -rf \
100 $(STAGING_DIR)/usr/bin/dnet-config \
101 $(STAGING_DIR)/usr/include/dnet.h \
102 $(STAGING_DIR)/usr/include/dnet \
103 $(STAGING_DIR)/usr/lib/libdnet.{a,so*}
104 endef
105
106 $(eval $(call BuildPackage,libdnet))