fix cbtt compile
[openwrt/svn-archive/archive.git] / net / cbtt / Makefile
1 # Copyright (C) 2006 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6 # $Id$
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=cbtt
11 PKG_VERSION:=20060727
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)80-$(PKG_VERSION)-src.tar.gz
15 PKG_SOURCE_URL:=@SF/bnbtusermods
16 PKG_MD5SUM:=d6edf0a11d7e68fa3d121e91308f22f5
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)80-$(PKG_VERSION)-src
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/cbtt/Default
23 SUBMENU:=BitTorrent
24 SECTION:=net
25 CATEGORY:=Network
26 DEPENDS:=+libpthread +uclibcxx +zlib
27 TITLE:=Bittorrent tracker
28 URL:=http://bnbtusermods.sourceforge.net/
29 endef
30
31 define Package/cbtt
32 $(call Package/cbtt/Default)
33 endef
34
35 define Package/cbtt-mysql
36 $(call Package/cbtt/Default)
37 DEPENDS+= +libmysqlclient
38 TITLE+= (with mysql support)
39 endef
40
41
42 define Build/Template
43
44 $(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
45 $(MAKE) -C $(PKG_BUILD_DIR) \
46 $(TARGET_CONFIGURE_OPTS) \
47 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/uClibc++ -fno-builtin -nostdinc++" \
48 LFLAGS="$(TARGET_LDFLAGS) -L. -nodefaultlibs $(4) -lz -luClibc++ -lm -lpthread -lgcc" \
49 $(3)
50 touch $$@
51
52 $(STAMP_BUILT): $(STAMP_BUILT)-$(2)
53
54 define Package/$(1)/install
55 $(INSTALL_DIR) $$(1)/usr/bin
56 $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(3) $$(1)/usr/bin/
57 endef
58
59 endef
60
61 define Build/Configure
62 endef
63
64 define Build/Compile
65 endef
66
67 ifneq ($(SDK)$(CONFIG_PACKAGE_cbtt),)
68 define Build/without-mysql
69 $(call Build/Template,cbtt,without-mysql,bnbt,)
70 endef
71 endif
72 $(eval $(Build/without-mysql))
73
74 ifneq ($(SDK)$(CONFIG_PACKAGE_cbtt-mysql),)
75 define Build/with-mysql
76 $(call Build/Template,cbtt-mysql,with-mysql,bnbtmysql, \
77 -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient \
78 )
79 endef
80 endif
81 $(eval $(Build/with-mysql))
82
83 $(eval $(call BuildPackage,cbtt))
84 $(eval $(call BuildPackage,cbtt-mysql))