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.

53 lines
1.6 KiB

  1. #
  2. # Copyright (C) 2015 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:=youtube-dl
  9. PKG_VERSION:=2017.09.11
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://yt-dl.org/downloads/$(PKG_VERSION)/
  13. PKG_HASH:=8b6defdd7cb9a8228eca2ef03a8c203a3ccba1ed97cb700f11b40a3af548212a
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
  15. PKG_LICENSE:=Unlicense
  16. PKG_LICENSE_FILES:=LICENSE
  17. PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
  18. PKG_BUILD_DEPENDS:=python/host zip/host
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/youtube-dl
  21. SECTION:=multimedia
  22. CATEGORY:=Multimedia
  23. TITLE:=utility to download videos from YouTube.com
  24. DEPENDS:=+python-openssl +python-email +python-xml +python-codecs +python-ctypes +ca-certificates
  25. URL:=https://youtube-dl.org
  26. endef
  27. define Package/youtube-dl/description
  28. youtube-dl is a small command-line program to download videos
  29. from YouTube.com and a few more sites.
  30. It requires the Python interpreter.
  31. endef
  32. define Package/youtube-dl/install
  33. $(INSTALL_DIR) $(1)/usr/bin
  34. python -m compileall $(PKG_BUILD_DIR)/youtube_dl/
  35. cd $(PKG_BUILD_DIR) && zip --quiet youtube-dl-c.zip youtube_dl/*.pyc youtube_dl/*/*.pyc
  36. cd $(PKG_BUILD_DIR) && zip --quiet --junk-paths youtube-dl-c.zip youtube_dl/__main__.pyc
  37. echo '#!/usr/bin/env python' > $(PKG_BUILD_DIR)/youtube-dl-c
  38. cat $(PKG_BUILD_DIR)/youtube-dl-c.zip >> $(PKG_BUILD_DIR)/youtube-dl-c
  39. $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/youtube-dl-c $(1)/usr/bin/youtube-dl
  40. endef
  41. $(eval $(call BuildPackage,youtube-dl))