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