switch ctorrent to using the build variants infrastructure
[openwrt/svn-archive/archive.git] / net / ctorrent / Makefile
1 #
2 # Copyright (C) 2006-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:=ctorrent
11 PKG_VERSION:=dnh3.3.2
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/dtorrent \
16 http://www.rahul.net/dholmes/ctorrent/
17 PKG_MD5SUM:=59b23dd05ff70791cd6449effa7fc3b6
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/ctorrent/Default
24 SUBMENU:=BitTorrent
25 SECTION:=net
26 CATEGORY:=Network
27 DEPENDS:=+uclibcxx
28 TITLE:=console-based BitTorrent client
29 URL:=http://www.rahul.net/dholmes/ctorrent/
30 endef
31
32 define Package/ctorrent/Default/description
33 CTorrent is a BitTorrent client written in the C programming language,
34 known to be a very robust and mature programming language, which produces
35 fast and optimized application.
36 endef
37
38 define Package/ctorrent
39 $(call Package/ctorrent/Default)
40 TITLE+= (with OpenSSL support)
41 VARIANT:=ssl
42 endef
43
44 define Package/ctorrent/description
45 $(call Package/ctorrent/Default/description)
46 This package is built with OpenSSL support.
47 endef
48
49 define Package/ctorrent-nossl
50 $(call Package/ctorrent/Default)
51 TITLE+= (with builtin SHA-1)
52 VARIANT:=nossl
53 endef
54
55 define Package/ctorrent-nossl/description
56 $(call Package/ctorrent/Default/description)
57 This package is built with builtin (Steve Reid's public-domain) SHA-1 support
58 endef
59
60 CONFIGURE_VARS += \
61 CXX="g++-uc" \
62 CXXFLAGS="$$$$CXXFLAGS -fno-rtti"
63
64 ifeq ($(BUILD_VARIANT),ssl)
65 CONFIGURE_ARGS += \
66 --with-ssl="$(STAGING_DIR)/usr"
67 endif
68
69 ifeq ($(BUILD_VARIANT),nossl)
70 CONFIGURE_ARGS += \
71 --with-ssl=no
72 endif
73
74 define Package/ctorrent/install
75 $(INSTALL_DIR) $(1)/usr/bin
76 $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME)
77 endef
78
79 Package/ctorrent-nossl/install = $(Package/ctorrent/install)
80
81 $(eval $(call BuildPackage,ctorrent))
82 $(eval $(call BuildPackage,ctorrent-nossl))