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