Move directory creation to postinst script (#3841)
[openwrt/svn-archive/archive.git] / net / iptraf / 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:=iptraf
12 PKG_VERSION:=3.0.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://iptraf.seul.org/pub/iptraf/ \
17 ftp://the.wiretapped.net/pub/security/network-monitoring/iptraf/
18 PKG_MD5SUM:=377371c28ee3c21a76f7024920649ea8
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/iptraf
25 SECTION:=net
26 CATEGORY:=Network
27 DEPENDS:=+libncurses
28 TITLE:=A console-based network monitoring program
29 URL:=http://iptraf.seul.org/
30 endef
31
32 define Package/iptraf/description
33 IPTraf is a console-based network statistics utility for Linux. It gathers
34 a variety of figures such as TCP connection packet and byte counts,
35 interface statistics and activity indicators, TCP/UDP traffic breakdowns,
36 and LAN station packet and byte counts.
37 endef
38
39 define Package/iptraf/postinst
40 #!/bin/sh
41 if [ -z "$${IPKG_INSTROOT}" ]; then
42 mkdir -p $${IPKG_INSTROOT}/var/log/iptraf $${IPKG_INSTROOT}/var/run/iptraf $${IPKG_INSTROOT}/var/lib/iptraf/
43 fi
44 endef
45
46 define Build/Compile
47 $(MAKE) -C $(PKG_BUILD_DIR)/src \
48 $(TARGET_CONFIGURE_OPTS) \
49 CFLAGS="$(TARGET_CFLAGS)" \
50 DEBUG="" \
51 INCLUDEDIR="-I../support -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
52 LDOPTS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
53 PLATFORM="-DPLATFORM=\\\"Linux/$(ARCH)\\\"" \
54 TARGET="/usr/bin" \
55 WORKDIR="/var/lib/iptraf" \
56 all
57 endef
58
59 define Package/iptraf/install
60 $(INSTALL_DIR) $(1)/usr/bin
61 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iptraf $(1)/usr/bin/
62 endef
63
64 $(eval $(call BuildPackage,iptraf))