youtube-dl-2017.03.26.ebuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=(python{2_7,3_4,3_5})
  5. inherit bash-completion-r1 distutils-r1 eutils
  6. DESCRIPTION="Download videos from YouTube.com (and more sites...)"
  7. HOMEPAGE="https://rg3.github.com/youtube-dl/"
  8. SRC_URI="http://youtube-dl.org/downloads/${PV}/${P}.tar.gz"
  9. LICENSE="public-domain"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
  12. IUSE="+offensive test"
  13. RDEPEND="
  14. dev-python/setuptools[${PYTHON_USEDEP}]
  15. "
  16. DEPEND="
  17. ${RDEPEND}
  18. test? ( dev-python/nose[coverage(+)] )
  19. "
  20. S="${WORKDIR}/${PN}"
  21. python_prepare_all() {
  22. if ! use offensive; then
  23. sed -i -e "/__version__/s|'$|-gentoo_no_offensive_sites'|g" \
  24. youtube_dl/version.py || die
  25. # these have single line import statements
  26. local xxx=(
  27. alphaporno anysex behindkink camwithher chaturbate eporner
  28. eroprofile extremetube fourtube foxgay goshgay hellporno
  29. hentaistigma hornbunny keezmovies lovehomeporn mofosex motherless
  30. myvidster porn91 porncom pornflip pornhd pornotube pornovoisines
  31. pornoxo ruleporn sexu slutload spankbang spankwire sunporno thisav
  32. tube8 vporn watchindianporn xbef xnxx xtube xvideos xxxymovies
  33. youjizz youporn
  34. )
  35. # these have multi-line import statements
  36. local mxxx=(
  37. drtuber pornhub redtube tnaflix xhamster
  38. )
  39. # do single line imports
  40. sed -i \
  41. -e $( printf '/%s/d;' ${xxx[@]} ) \
  42. youtube_dl/extractor/extractors.py \
  43. || die
  44. # do multiple line imports
  45. sed -i \
  46. -e $( printf '/%s/,/)/d;' ${mxxx[@]} ) \
  47. youtube_dl/extractor/extractors.py \
  48. || die
  49. sed -i \
  50. -e $( printf '/%s/d;' ${mxxx[@]} ) \
  51. youtube_dl/extractor/generic.py \
  52. || die
  53. rm \
  54. $( printf 'youtube_dl/extractor/%s.py ' ${xxx[@]} ) \
  55. $( printf 'youtube_dl/extractor/%s.py ' ${mxxx[@]} ) \
  56. test/test_age_restriction.py \
  57. || die
  58. fi
  59. epatch_user
  60. distutils-r1_python_prepare_all
  61. }
  62. src_compile() {
  63. distutils-r1_src_compile
  64. }
  65. python_test() {
  66. emake test
  67. }
  68. python_install_all() {
  69. dodoc README.txt
  70. doman ${PN}.1
  71. newbashcomp ${PN}.bash-completion ${PN}
  72. insinto /usr/share/zsh/site-functions
  73. newins youtube-dl.zsh _youtube-dl
  74. insinto /usr/share/fish/completions
  75. doins youtube-dl.fish
  76. distutils-r1_python_install_all
  77. rm -r "${ED}"/usr/etc || die
  78. }