757fe12f66bf1e09d9d4573c7a12b7f31b113a75
[openwrt/svn-archive/archive.git] / ipv6 / gw6c / Makefile
1 #
2 # Copyright (C) 2008-2009 OpenWrt.org
3 #
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=gw6c
8 PKG_VERSION:=5.0
9 PKG_RELEASE:=1
10
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
12
13 include $(INCLUDE_DIR)/package.mk
14
15 define Package/gw6c
16 SECTION:=ipv6
17 CATEGORY:=IPv6
18 DEPENDS:=+libpthread +ip +kmod-tun +kmod-ipv6 +uclibcxx +radvd
19 TITLE:=IPv6 tunnel client software
20 URL:=http://www.go6.net
21 endef
22
23 define Package/gw6c/description
24 Client to configure an IPv6 tunnel to
25 Hexago/freenet6/go6.net's migration broker.
26 endef
27
28 define Build/Prepare
29 wget -t1 --timeout=20 -O $(DL_DIR)/$(PKG_NAME)-$(PKG_VERSION).tar.bz2 "http://go6.net/4105/file.asp?file_id=136"
30 $(INSTALL_DIR) $(PKG_BUILD_DIR)
31 bzcat $(DL_DIR)/$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | $(TAR) -C $(PKG_BUILD_DIR) -xvf -
32 $(CP) $(PKG_BUILD_DIR)/gw6c/src/gw6c-config/gw6cconfig/gw6c_c_wrapper.h $(PKG_BUILD_DIR)/gw6c/src/gw6c/include
33 endef
34
35 GW6C_OPTS:= \
36 C_COMPILER="$(TARGET_CC) -c -DNO_STDLIBCXX" \
37 COMPILER="$(TARGET_CROSS)g++ -c -DNO_STDLIBCXX" \
38 CPP_FLAGS="$(TARGET_CFLAGS) -fno-builtin -nostdinc++ -I. -Wall -DNDEBUG -I$(STAGING_DIR)/usr/include/uClibc++ $(TARGET_CPPFLAGS)" \
39 RANLIB="$(TARGET_CROSS)ranlib" \
40 ARCHIVER="$(TARGET_CROSS)ar" \
41 C_LINKER="$(TARGET_CC)" \
42 LINKER="$(TARGET_CROSS)g++" \
43 exportdir=$(PKG_BUILD_DIR)/gw6c/src/gw6c \
44 export
45
46 define Build/Compile
47 $(MAKE) -C $(PKG_BUILD_DIR)/gw6c/src/gw6c-config \
48 $(GW6C_OPTS)
49 $(MAKE) -C $(PKG_BUILD_DIR)/gw6c/src/gw6c-messaging \
50 $(GW6C_OPTS)
51 $(MAKE) -C $(PKG_BUILD_DIR)/gw6c/src/gw6c \
52 CC="$(TARGET_CC)" \
53 CFLAGS="$(TARGET_CFLAGS) -fno-builtin -Wall -I$(PKG_BUILD_DIR)/gw6c/src/gw6c/include \
54 -I$(PKG_BUILD_DIR)/gw6c/src/gw6c/platform/openwrt -I$(PKG_BUILD_DIR)/gw6c/src/gw6c" \
55 LDFLAGS="-L$(PKG_BUILD_DIR)/gw6c/src/gw6c/gw6cconfig \
56 -L$(PKG_BUILD_DIR)/gw6c/src/gw6c/gw6cmessaging \
57 $(TARGET_LDFLAGS) -nodefaultlibs -luClibc++ $(LIBGCC_S)" \
58 target="openwrt" \
59 installdir="$(PKG_INSTALL_DIR)"
60 endef
61
62 define Package/gw6c/install
63 $(INSTALL_DIR) $(1)/usr/sbin
64 $(INSTALL_BIN) $(PKG_BUILD_DIR)/gw6c/src/gw6c/bin/$(PKG_NAME) $(1)/usr/sbin
65 $(INSTALL_DIR) $(1)/usr/share/gw6c/template
66 $(CP) ./files/openwrt.sh $(1)/usr/share/gw6c/template
67 $(INSTALL_DIR) $(1)/etc/init.d
68 $(INSTALL_BIN) ./files/gw6c.init $(1)/etc/init.d/gw6c
69 $(INSTALL_DIR) $(1)/etc/config
70 $(INSTALL_CONF) ./files/gw6c.config $(1)/etc/config/gw6c
71 endef
72
73 $(eval $(call BuildPackage,gw6c))