You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
6.2 KiB

  1. #
  2. # Copyright (C) 2009-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=transmission
  9. PKG_VERSION:=2.93
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://github.com/transmission/transmission-releases/raw/master
  13. PKG_HASH:=8815920e0a4499bcdadbbe89a4115092dab42ce5199f71ff9a926cfd12b9b90b
  14. PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_LICENSE:=GPL-2.0+
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/transmission/template
  23. SUBMENU:=BitTorrent
  24. SECTION:=net
  25. CATEGORY:=Network
  26. TITLE:=BitTorrent client
  27. URL:=http://www.transmissionbt.com
  28. endef
  29. define Package/transmission-daemon/Default
  30. $(call Package/transmission/template)
  31. DEPENDS:=+libcurl +libpthread +libevent2 +librt +zlib
  32. USERID:=transmission=224:transmission=224
  33. endef
  34. define Package/transmission-daemon-openssl
  35. $(call Package/transmission-daemon/Default)
  36. TITLE+= (with OpenSSL)
  37. DEPENDS+=+libopenssl
  38. VARIANT:=openssl
  39. endef
  40. define Package/transmission-daemon-mbedtls
  41. $(call Package/transmission-daemon/Default)
  42. TITLE+= (with mbed TLS)
  43. DEPENDS+=+libmbedtls
  44. VARIANT:=mbedtls
  45. endef
  46. define Package/transmission-cli/Default
  47. $(call Package/transmission/template)
  48. DEPENDS:=+libcurl +libpthread +libevent2 +librt +zlib
  49. endef
  50. define Package/transmission-cli-openssl
  51. $(call Package/transmission-cli/Default)
  52. TITLE+= (with OpenSSL)
  53. DEPENDS+=+libopenssl
  54. VARIANT:=openssl
  55. endef
  56. define Package/transmission-cli-mbedtls
  57. $(call Package/transmission-cli/Default)
  58. TITLE+= (with mbed TLS)
  59. DEPENDS+=+libmbedtls
  60. VARIANT:=mbedtls
  61. endef
  62. define Package/transmission-remote/Default
  63. $(call Package/transmission/template)
  64. DEPENDS:=+libcurl +libpthread +libevent2 +librt +zlib
  65. endef
  66. define Package/transmission-remote-openssl
  67. $(call Package/transmission-remote/Default)
  68. TITLE+= (with OpenSSL)
  69. DEPENDS+=+libopenssl
  70. VARIANT:=openssl
  71. endef
  72. define Package/transmission-remote-mbedtls
  73. $(call Package/transmission-remote/Default)
  74. TITLE+= (with mbed TLS)
  75. DEPENDS+=+libmbedtls
  76. VARIANT:=mbedtls
  77. endef
  78. define Package/transmission-web
  79. $(call Package/transmission/template)
  80. TITLE+= (webinterface)
  81. DEPENDS:=@(PACKAGE_transmission-daemon-openssl||PACKAGE_transmission-daemon-mbedtls)
  82. endef
  83. define Package/transmission-daemon/Default/description
  84. Transmission is a simple BitTorrent client.
  85. It features a very simple, intuitive interface
  86. on top on an efficient, cross-platform back-end.
  87. This package contains the daemon itself.
  88. endef
  89. Package/transmission-daemon-openssl/description = $(Package/transmission-daemon/Default/description)
  90. Package/transmission-daemon-mbedtls/description = $(Package/transmission-daemon/Default/description)
  91. define Package/transmission-cli/Default/description
  92. CLI utilities for transmission.
  93. endef
  94. Package/transmission-cli-openssl/description = $(Package/transmission-cli/Default/description)
  95. Package/transmission-cli-mbedtls/description = $(Package/transmission-cli/Default/description)
  96. define Package/transmission-remote/Default/description
  97. CLI remote interface for transmission.
  98. endef
  99. Package/transmission-remote-openssl/description = $(Package/transmission-remote/Default/description)
  100. Package/transmission-remote-mbedtls/description = $(Package/transmission-remote/Default/description)
  101. define Package/transmission-web/description
  102. Webinterface resources for transmission.
  103. endef
  104. define Package/transmission-daemon-openssl/conffiles
  105. /etc/config/transmission
  106. endef
  107. Package/transmission-daemon-mbedtls/conffiles = $(Package/transmission-daemon-openssl/conffiles)
  108. CONFIGURE_VARS += \
  109. LIBEVENT_LIBS="$(STAGING_DIR)/usr/lib/libevent-2.0.so.5"
  110. CONFIGURE_ARGS += \
  111. --enable-daemon \
  112. --enable-cli \
  113. --without-gtk \
  114. --enable-largefile \
  115. --enable-lightweight
  116. ifeq ($(BUILD_VARIANT),openssl)
  117. CONFIGURE_ARGS += \
  118. --with-crypto=openssl
  119. endif
  120. ifeq ($(BUILD_VARIANT),mbedtls)
  121. CONFIGURE_ARGS += \
  122. --with-crypto=polarssl
  123. CONFIGURE_VARS += \
  124. MBEDTLS_CFLAGS="-I$(STAGING_DIR)/usr/include/mbedtls" \
  125. MBEDTLS_LIBS="-lmbedtls -lmbedcrypto"
  126. endif
  127. MAKE_FLAGS += \
  128. CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE"
  129. TARGET_CFLAGS += -std=gnu99
  130. define Build/Configure
  131. ( cd $(PKG_BUILD_DIR); ./autogen.sh $(CONFIGURE_ARGS))
  132. $(call Build/Configure/Default,$CONFIGURE_ARGS)
  133. endef
  134. define Package/transmission-daemon-openssl/install
  135. $(INSTALL_DIR) $(1)/usr/bin
  136. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-daemon $(1)/usr/bin/
  137. $(INSTALL_DIR) $(1)/etc/init.d/
  138. $(INSTALL_BIN) files/transmission.init $(1)/etc/init.d/transmission
  139. $(INSTALL_DIR) $(1)/etc/config
  140. $(INSTALL_CONF) files/transmission.config $(1)/etc/config/transmission
  141. $(INSTALL_DIR) $(1)/etc/sysctl.d/
  142. $(INSTALL_CONF) files/transmission.sysctl $(1)/etc/sysctl.d/20-transmission.conf
  143. endef
  144. Package/transmission-daemon-mbedtls/install = $(Package/transmission-daemon-openssl/install)
  145. define Package/transmission-cli-openssl/install
  146. $(INSTALL_DIR) $(1)/usr/bin
  147. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-cli \
  148. $(PKG_INSTALL_DIR)/usr/bin/transmission-create \
  149. $(PKG_INSTALL_DIR)/usr/bin/transmission-edit \
  150. $(PKG_INSTALL_DIR)/usr/bin/transmission-show \
  151. $(1)/usr/bin/
  152. endef
  153. Package/transmission-cli-mbedtls/install = $(Package/transmission-cli-openssl/install)
  154. define Package/transmission-remote-openssl/install
  155. $(INSTALL_DIR) $(1)/usr/bin
  156. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/transmission-remote $(1)/usr/bin/
  157. endef
  158. Package/transmission-remote-mbedtls/install = $(Package/transmission-remote-openssl/install)
  159. define Package/transmission-web/install
  160. $(INSTALL_DIR) $(1)/usr/share/transmission
  161. $(CP) $(PKG_INSTALL_DIR)/usr/share/transmission/web $(1)/usr/share/transmission/
  162. endef
  163. $(eval $(call BuildPackage,transmission-daemon-openssl))
  164. $(eval $(call BuildPackage,transmission-daemon-mbedtls))
  165. $(eval $(call BuildPackage,transmission-cli-openssl))
  166. $(eval $(call BuildPackage,transmission-cli-mbedtls))
  167. $(eval $(call BuildPackage,transmission-remote-openssl))
  168. $(eval $(call BuildPackage,transmission-remote-mbedtls))
  169. $(eval $(call BuildPackage,transmission-web))