1#
2# Copyright (C) 2012 Jo-Philipp Wich <jow@openwrt.org>
3#
4# This is free software, licensed under the Apache 2 license.
5#
6
7include $(TOPDIR)/rules.mk
8
9PKG_NAME:=owipcalc
10PKG_RELEASE:=3
11PKG_LICENSE:=Apache-2.0
12
13include $(INCLUDE_DIR)/package.mk
14
15
16define Package/owipcalc
17  SECTION:=utils
18  CATEGORY:=Utilities
19  TITLE:=Simple IPv4/IPv6 address calculator
20  MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
21endef
22
23define Package/owipcalc/description
24  The owipcalc utility supports a number of calculations and tests to work
25  with ip-address ranges, this is useful for scripts that e.g. need to
26  partition ipv6-prefixes into small subnets or to calculate address ranges
27  for dhcp pools.
28endef
29
30
31define Build/Prepare
32	$(INSTALL_DIR) $(PKG_BUILD_DIR)
33	$(CP) ./src/* $(PKG_BUILD_DIR)/
34endef
35
36define Build/Configure
37endef
38
39define Build/Compile
40	$(TARGET_CC) $(TARGET_CFLAGS) \
41		-o $(PKG_BUILD_DIR)/owipcalc $(PKG_BUILD_DIR)/owipcalc.c
42endef
43
44
45define Package/owipcalc/install
46	$(INSTALL_DIR) $(1)/usr/bin
47	$(INSTALL_BIN) $(PKG_BUILD_DIR)/owipcalc $(1)/usr/bin/owipcalc
48endef
49
50$(eval $(call BuildPackage,owipcalc))
51