Port mtr to -ng
[openwrt/svn-archive/archive.git] / net / mtr / 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:=mtr
12 PKG_VERSION:=0.69
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=58904d6d8d70114195cdeb653d56914c
15
16 PKG_SOURCE_URL:=ftp://ftp.bitwizard.nl/mtr/
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_CAT:=zcat
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/mtr
25 SECTION:=net
26 CATEGORY:=Network
27 DEPENDS:=+libncurses
28 TITLE:=Full screen ncurses traceroute tool
29 DESCRIPTION:=mtr combines the functionality of the 'traceroute' and 'ping' programs\\\
30 in a single network diagnostic tool.\\\
31 As mtr starts, it investigates the network connection between the host\\\
32 mtr runs on and a user-specified destination host. After it\\\
33 determines the address of each network hop between the machines,\\\
34 it sends a sequence ICMP ECHO requests to each one to determine the\\\
35 quality of the link to each machine. As it does this, it prints\\\
36 running statistics about each machine.\\\
37 URL:=http://www.bitwizard.nl/mtr/
38 endef
39
40 define Build/Configure
41 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
42 touch configure.in; \
43 touch aclocal.m4; \
44 touch Makefile.in; \
45 touch img/Makefile.in; \
46 touch stamp-h.in; \
47 touch config.h.in; \
48 touch configure; \
49 $(TARGET_CONFIGURE_OPTS) \
50 CFLAGS="$(TARGET_CFLAGS)" \
51 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
52 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
53 ac_cv_lib_resolv_res_mkquery=yes \
54 ./configure \
55 --target=$(GNU_TARGET_NAME) \
56 --host=$(GNU_TARGET_NAME) \
57 --build=$(GNU_HOST_NAME) \
58 --program-prefix="" \
59 --program-suffix="" \
60 --prefix=/usr \
61 --exec-prefix=/usr \
62 --bindir=/usr/bin \
63 --datadir=/usr/share \
64 --includedir=/usr/include \
65 --infodir=/usr/share/info \
66 --libdir=/usr/lib \
67 --libexecdir=/usr/lib \
68 --localstatedir=/var \
69 --mandir=/usr/share/man \
70 --sbindir=/usr/sbin \
71 --sysconfdir=/etc \
72 $(DISABLE_LARGEFILE) \
73 $(DISABLE_NLS) \
74 --without-gtk \
75 );
76 endef
77
78 define Build/Compile
79 rm -rf $(PKG_INSTALL_DIR)
80 mkdir -p $(PKG_INSTALL_DIR)
81 $(MAKE) -C $(PKG_BUILD_DIR) \
82 DESTDIR="$(PKG_INSTALL_DIR)" \
83 CFLAGS="$(TARGET_CFLAGS)" \
84 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
85 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
86 all install
87 endef
88
89 define Package/mtr/install
90 install -d -m0755 $(1)/usr/sbin
91 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/mtr $(1)/usr/sbin/
92 endef
93
94 $(eval $(call BuildPackage,mtr))