[patchteam] - New Package - Deluge - with daemon, console and web ui
[openwrt/svn-archive/archive.git] / net / deluge / Makefile
1 #
2 # Copyright (C) 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:=deluge
11 PKG_VERSION:=1.2.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://download.deluge-torrent.org/source/
16 PKG_MD5SUM:=cec6b48f0abd79ea2cff3815a1124192
17
18 include $(INCLUDE_DIR)/package.mk
19 $(call include_mk, python-package.mk)
20
21 define Package/deluge
22 SUBMENU:=BitTorrent
23 SECTION:=net
24 CATEGORY:=Network
25 TITLE:=deluge-daemon
26 URL:=http://deluge-torrent.org/
27 DEPENDS:=+python +rblibtorrent +python2-chardet +pyxdg +twisted +twisted-web +pyopenssl +distribute
28 endef
29
30 define Package/deluge/config
31 config DELUGE_WITH_WEBUI
32 bool "Include the web interface"
33 select PACKAGE_mako
34 default n
35
36 config DELUGE_WITH_GTKUI
37 bool "Include the GTK interface"
38 depends PACKAGE_pygame
39 depends PACKAGE_pygobject
40 depends PACKAGE_pygtk
41 depends PACKAGE_librsvg
42 default n
43 endef
44
45 define Package/deluge/description
46 BitTorrent client with a client/server model.
47 endef
48
49 define Package/deluge/conffiles
50 /etc/config/deluge
51 endef
52
53 define Build/Prepare
54 $(call Build/Prepare/Default)
55 $(CP) -a files $(PKG_BUILD_DIR)
56 find $(PKG_BUILD_DIR)/files -name 'CVS' -o -name '.svn' -o -name '*~' | $(XARGS) rm -rf
57 endef
58
59 define Build/Compile
60 $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
61
62 $(if $(CONFIG_DELUGE_WITH_WEBUI),,$(RM) "$(PKG_INSTALL_DIR)/usr/bin/deluge-web" ; \
63 $(RM) "$(PKG_INSTALL_DIR)/usr/share/man/man1/deluge-web.1" ; \
64 $(RM) -r "$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/deluge/ui/web")
65
66 $(if $(CONFIG_DELUGE_WITH_GTKUI),,$(RM) "$(PKG_INSTALL_DIR)/usr/bin/deluge-gtk" ; \
67 $(RM) "$(PKG_INSTALL_DIR)/usr/share/man/man1/deluge-gtk.1" ; \
68 $(RM) -r "$(PKG_INSTALL_DIR)/usr/share/applications" ; \
69 $(RM) -r "$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/deluge/ui/gtkui")
70 endef
71
72 define Package/deluge/install
73 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) $(1)/usr/bin $(1)/etc/config $(1)/etc/init.d
74 $(CP) \
75 $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
76 $(1)$(PYTHON_PKG_DIR)
77
78 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
79
80 $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/deluge.init $(1)/etc/init.d/deluge
81 $(INSTALL_CONF) $(PKG_BUILD_DIR)/files/deluge.config $(1)/etc/config/deluge
82
83 $(SED) 's,#!$(STAGING_DIR)/host/bin/$(PYTHON),#!/usr/bin/$(PYTHON),' $(1)/usr/bin/*
84 endef
85
86 $(eval $(call BuildPackage,deluge))