ee9dfa0c4e8b001a5b76a518ff6ffaedf661929c
[openwrt/svn-archive/archive.git] / net / rrs / 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:=rrs
12 PKG_VERSION:=1.70
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.cycom.se/uploads/36/19
17 PKG_MD5SUM:=b400d03c0e39e3e78a7327ba78f789f0
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/rrs/Default
22 SECTION:=net
23 CATEGORY:=Network
24 MENU:=1
25 TITLE:=A reverse (connecting) remote shell
26 URL:=http://www.cycom.se/dl/rrs/
27 endef
28
29 define Package/rrs
30 $(call Package/rrs/Default)
31 DEPENDS:=+uclibcxx
32 TITLE+= (with SSL support)
33 endef
34
35 define Package/rrs-nossl
36 $(call Package/rrs/Default)
37 DEPENDS:=rrs
38 TITLE+= (without SSL support)
39 endef
40
41 ifneq ($(SDK),)
42 CONFIG_PACKAGE_rrs:=m
43 CONFIG_PACKAGE_rrs-nossl:=m
44 endif
45
46 define Build/Compile/Template
47 $(MAKE) -C $(PKG_BUILD_DIR) \
48 CC="$(TARGET_CC)" \
49 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include -fno-builtin -fno-rtti -nostdinc++" \
50 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic $(3) -lutil -lm -lc" \
51 $(2)
52 ( cd $(PKG_BUILD_DIR); mv rrs rrs-$(1); )
53 endef
54
55 ifneq ($(CONFIG_PACKAGE_rrs),)
56 define Build/Compile/with-ssl
57 $(call Build/Compile/Template,ssl,generic,-lcrypto -lssl)
58 endef
59 endif
60
61 ifneq ($(CONFIG_PACKAGE_rrs-nossl),)
62 define Build/Compile/without-ssl
63 $(call Build/Compile/Template,nossl,generic-nossl,)
64 endef
65 endif
66
67 define Build/Compile
68 $(call Build/Compile/with-ssl)
69 $(call Build/Compile/without-ssl)
70 endef
71
72 define Package/rrs/install
73 $(INSTALL_DIR) $(1)/usr/bin
74 $(INSTALL_BIN) $(PKG_BUILD_DIR)/rrs-ssl $(1)/usr/bin/rrs
75 endef
76
77 define Package/rrs-nossl/install
78 $(INSTALL_DIR) $(1)/usr/bin
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/rrs-nossl $(1)/usr/bin/rrs
80 endef
81
82 $(eval $(call BuildPackage,rrs))
83 $(eval $(call BuildPackage,rrs-nossl))