Same thing as for samba, make it nicer in menuconfig
[openwrt/svn-archive/archive.git] / net / miredo / Makefile
1 #
2 # Copyright (C) 2006 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:=miredo
12 PKG_VERSION:=1.0.0
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=b5a51cb98732decc2ada96b2caee5d3c
15
16 PKG_SOURCE_URL:=http://www.remlab.net/files/miredo/
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
18 PKG_CAT:=bzcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/miredo
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+libpthread +uclibcxx +kmod-ipv6 +kmod-tun
29 SUBMENU:=miredo - Teredo (IPv6 tunneling over UDP through NAT) client and relay daemon
30 DESCRIPTION:=miredo - A Teredo (IPv6 tunneling over UDP through NAT) client and relay daemon.
31 URL:=http://www.simphalempin.com/dev/miredo/
32 endef
33
34 define Package/miredo-server
35 $(call Package/miredo)
36 TITLE:=Teredo (IPv6 tunneling over UDP through NAT) server daemon
37 DESCRIPTION:=A Teredo (IPv6 tunneling over UDP through NAT) server daemon.
38 endef
39
40 define Package/miredo-server/conffiles
41 /etc/miredo-server.conf
42 endef
43
44 define Package/miredo-client
45 $(call Package/miredo)
46 TITLE:=Teredo (IPv6 tunneling over UDP through NAT) client and relay daemon
47 DESCRIPTION:=Teredo (IPv6 tunneling over UDP through NAT) client and relay daemon
48 endef
49
50 define Package/miredo-client/conffiles
51 /etc/miredo.conf
52 endef
53
54 define Build/Configure
55 $(call Build/Configure/Default,--disable-shared \
56 --enable-static \
57 --with-gnu-ld \
58 --disable-rpath \
59 --disable-chroot \
60 --enable-teredo-client \
61 --enable-teredo-relay \
62 --enable-teredo-server \
63 --enable-miredo-user=root,CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
64 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
65 LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
66 LIBS="-luClibc++ -lc -lm" \
67 ac_cv_file__proc_self_maps=yes\
68 )
69 endef
70
71 define Build/Compile
72 rm -rf $(PKG_INSTALL_DIR)
73 mkdir -p $(PKG_INSTALL_DIR)
74 $(MAKE) -C $(PKG_BUILD_DIR) \
75 CXXLINK="\$$$$(LINK)" \
76 DESTDIR="$(PKG_INSTALL_DIR)" \
77 all install
78 endef
79
80 define Package/miredo-server/install
81 $(INSTALL_DIR) $(1)/etc/
82 $(CP) $(PKG_INSTALL_DIR)/etc/miredo-server.conf-dist $(1)/etc/miredo-server.conf
83 $(INSTALL_DIR) $(1)/etc/init.d
84 $(INSTALL_BIN) ./files/miredo-server.init $(1)/etc/init.d/miredo-server
85 $(INSTALL_DIR) $(1)/usr/sbin
86 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/miredo-server $(1)/usr/sbin/
87 endef
88
89 define Package/miredo-client/install
90 $(INSTALL_DIR) $(1)/etc
91 $(CP) $(PKG_INSTALL_DIR)/etc/miredo.conf-dist $(1)/etc/miredo.conf
92 $(INSTALL_DIR) $(1)/etc/init.d
93 $(INSTALL_BIN) ./files/miredo.init $(1)/etc/init.d/miredo
94 $(INSTALL_DIR) $(1)/usr/sbin
95 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/miredo $(1)/usr/sbin/
96 endef
97
98 $(eval $(call BuildPackage,miredo-server))
99 $(eval $(call BuildPackage,miredo-client))