replace lots of manual install commands with INSTALL_* variables
[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_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
17 PKG_MD5SUM:=416b765e9d9961501ac85e9a366fd219
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/libdnet-$(PKG_VERSION)
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:=\
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); touch \
37 configure.in \
38 include.m4 \
39 aclocal.m4 \
40 Makefile.in \
41 configure \
42 );
43 $(call Build/Configure/Default, \
44 --enable-shared \
45 --enable-static \
46 , \
47 ac_cv_dnet_bsd_bpf=no \
48 )
49 endef
50
51 define Build/Compile
52 $(MAKE) -C $(PKG_BUILD_DIR) \
53 DESTDIR="$(PKG_INSTALL_DIR)" \
54 all install
55 endef
56
57 define Build/InstallDev
58 mkdir -p $(STAGING_DIR)/usr/bin
59 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnet-config $(STAGING_DIR)/usr/bin/
60 mkdir -p $(STAGING_DIR)/usr/include
61 $(CP) $(PKG_INSTALL_DIR)/usr/include/dnet.h $(STAGING_DIR)/usr/include/
62 $(CP) $(PKG_INSTALL_DIR)/usr/include/dnet $(STAGING_DIR)/usr/include/
63 mkdir -p $(STAGING_DIR)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnet.{a,so*} $(STAGING_DIR)/usr/lib/
65 endef
66
67 define Build/UninstallDev
68 rm -rf \
69 $(STAGING_DIR)/usr/bin/dnet-config \
70 $(STAGING_DIR)/usr/include/dnet.h \
71 $(STAGING_DIR)/usr/include/dnet \
72 $(STAGING_DIR)/usr/lib/libdnet.{a,so*}
73 endef
74
75 define Package/libdnet/install
76 $(INSTALL_DIR) $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* $(1)/usr/lib/
78 $(INSTALL_DIR) $(1)/usr/sbin
79 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnet $(1)/usr/sbin/
80 endef
81
82 $(eval $(call BuildPackage,libdnet))