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