86f94bbfe0eff52810caf01aec0a316c116ccce1
[openwrt/svn-archive/archive.git] / net / stun / Makefile
1 #
2 # Copyright (C) 2008 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:=stund
12 PKG_VERSION:=0.96
13
14 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_Aug13.tgz
15 PKG_SOURCE_URL:=@SF/stun
16 PKG_MD5SUM:=3273abb1a6f299f4e611b658304faefa
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/stun/Default
23 SECTION:=net
24 CATEGORY:=Network
25 DEPENDS:=+uclibcxx
26 URL:=http://sourceforge.net/projects/stun
27 endef
28
29 define Package/stun/Default/description
30 The STUN protocol (Simple Traversal of UDP through NATs) is described in the
31 IETF RFC 3489, available at http://www.ietf.org/rfc/rfc3489.txt. It's used to
32 help clients behind NAT to tunnel incoming calls through. This server is the
33 counterpart to help the client identify the NAT and have it open the proper
34 ports for it.
35 endef
36
37 define Package/stund
38 $(call Package/stun/Default)
39 TITLE:=STUN server
40 endef
41
42 define Package/stund/description
43 $(call Package/stun/Default/description)
44 endef
45
46 define Package/stun-client
47 $(call Package/stun/Default)
48 TITLE:=STUN test client
49 endef
50
51 define Package/stun-client/description
52 $(call Package/stun/Default/description)
53 endef
54
55 define Build/Compile
56 $(MAKE) -C $(PKG_BUILD_DIR) \
57 CXX="$(TARGET_CXX)" \
58 CFLAGS="$(TARGET_CFLAGS)" \
59 DESTDIR="$(PKG_INSTALL_DIR)" \
60 CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
61 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++ -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
62 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -L$(TOOLCHAIN_DIR)/usr/lib \
63 -nodefaultlibs -luClibc++ $(LIBGCC_S)" \
64 all
65 endef
66
67
68 define Package/stund/install
69 $(INSTALL_DIR) $(1)/usr/sbin
70 $(INSTALL_BIN) $(PKG_BUILD_DIR)/server $(1)/usr/sbin/stund
71 $(INSTALL_DIR) $(1)/etc/init.d
72 $(INSTALL_BIN) ./files/stund.init $(1)/etc/init.d/
73 $(INSTALL_DIR) $(1)/etc/config
74 $(INSTALL_DATA) ./files/stund.config $(1)/etc/config/stund
75 endef
76
77 define Package/stun-client/install
78 $(INSTALL_DIR) $(1)/usr/sbin
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client $(1)/usr/sbin/stun-client
80 endef
81
82 $(eval $(call BuildPackage,stund))
83 $(eval $(call BuildPackage,stun-client))