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.

98 lines
3.0 KiB

  1. #
  2. # Copyright (C) 2012-2018 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:=aria2
  9. PKG_VERSION:=1.34.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_VERSION)/
  13. PKG_HASH:=3a44a802631606e138a9e172a3e9f5bcbaac43ce2895c1d8e2b46f30487e77a3
  14. PKG_INSTALL:=1
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, \
  17. Hsing-Wang Liao <kuoruan@gmail.com>
  18. PKG_LICENSE:=GPLv2
  19. PKG_LICENSE_FILES:=COPYING
  20. PKG_CONFIG_DEPENDS := \
  21. CONFIG_ARIA2_NOSSL \
  22. CONFIG_ARIA2_OPENSSL \
  23. CONFIG_ARIA2_GNUTLS \
  24. CONFIG_ARIA2_NOCRYPTO \
  25. CONFIG_ARIA2_NETTLE \
  26. CONFIG_ARIA2_LIBGCRYPT \
  27. CONFIG_ARIA2_LIBXML2 \
  28. CONFIG_ARIA2_EXPAT \
  29. CONFIG_ARIA2_GMP \
  30. CONFIG_ARIA2_BITTORRENT \
  31. CONFIG_ARIA2_METALINK \
  32. CONFIG_ARIA2_SFTP \
  33. CONFIG_ARIA2_ASYNC_DNS \
  34. CONFIG_ARIA2_COOKIE \
  35. CONFIG_ARIA2_WEBSOCKET
  36. include $(INCLUDE_DIR)/package.mk
  37. define Package/aria2/config
  38. source "$(SOURCE)/Config.in"
  39. endef
  40. define Package/aria2
  41. SECTION:=net
  42. CATEGORY:=Network
  43. SUBMENU:=File Transfer
  44. TITLE:=lightweight download utility
  45. URL:=https://aria2.github.io/
  46. DEPENDS:=+zlib +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls \
  47. +ARIA2_NETTLE:libnettle +ARIA2_LIBGCRYPT:libgcrypt +ARIA2_GMP:libgmp \
  48. +ARIA2_LIBXML2:libxml2 +ARIA2_EXPAT:libexpat +ARIA2_SFTP:libssh2 \
  49. +ARIA2_ASYNC_DNS:libcares +ARIA2_COOKIE:libsqlite3
  50. USERID:=aria2=6800:aria2=6800
  51. endef
  52. define Package/aria2/description
  53. aria2 is a lightweight multi-protocol & multi-source command-line download
  54. utility
  55. endef
  56. CONFIGURE_ARGS += \
  57. --disable-nls \
  58. $(if $(CONFIG_ARIA2_NOSSL),--disable,--enable)-ssl \
  59. $(if $(CONFIG_ARIA2_BITTORRENT),--enable,--disable)-bittorrent \
  60. $(if $(CONFIG_ARIA2_METALINK),--enable,--disable)-metalink \
  61. $(if $(CONFIG_ARIA2_WEBSOCKET),--enable,--disable)-websocket \
  62. $(if $(CONFIG_ARIA2_OPENSSL),--with,--without)-openssl \
  63. $(if $(CONFIG_ARIA2_GNUTLS),--with,--without)-gnutls \
  64. $(if $(CONFIG_ARIA2_NETTLE),--with,--without)-libnettle \
  65. $(if $(CONFIG_ARIA2_LIBGCRYPT),--with,--without)-libgcrypt \
  66. $(if $(CONFIG_ARIA2_GMP),--with,--without)-libgmp \
  67. $(if $(CONFIG_ARIA2_LIBXML2),--with,--without)-libxml2 \
  68. $(if $(CONFIG_ARIA2_EXPAT),--with,--without)-libexpat \
  69. $(if $(CONFIG_ARIA2_SFTP),--with,--without)-libssh2 \
  70. $(if $(CONFIG_ARIA2_ASYNC_DNS),--with,--without)-libcares \
  71. $(if $(CONFIG_ARIA2_COOKIE),--with,--without)-sqlite3 \
  72. --without-libuv \
  73. --with-libz
  74. TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto
  75. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  76. define Package/aria2/install
  77. $(INSTALL_DIR) $(1)/usr/bin
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aria2c $(1)/usr/bin
  79. $(INSTALL_DIR) $(1)/etc/init.d
  80. $(INSTALL_BIN) ./files/aria2.init $(1)/etc/init.d/aria2
  81. $(INSTALL_DIR) $(1)/etc/config
  82. $(INSTALL_CONF) ./files/aria2.conf $(1)/etc/config/aria2
  83. endef
  84. $(eval $(call BuildPackage,aria2))