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.

39 lines
1.4 KiB

  1. all: compile exe readme man-page bash-completion update-latest
  2. update-latest:
  3. ./youtube-dl --version > LATEST_VERSION
  4. readme:
  5. @options=$$(COLUMNS=80 ./youtube-dl --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/## \1/') && \
  6. header=$$(sed -e '/.*# OPTIONS/,$$ d' README.md) && \
  7. footer=$$(sed -e '1,/.*# FAQ/ d' README.md) && \
  8. echo "$${header}" > README.md && \
  9. echo >> README.md && \
  10. echo '# OPTIONS' >> README.md && \
  11. echo "$${options}" >> README.md&& \
  12. echo >> README.md && \
  13. echo '# FAQ' >> README.md && \
  14. echo "$${footer}" >> README.md
  15. man-page:
  16. pandoc -s -w man README.md -o youtube-dl.1
  17. bash-completion:
  18. @options=`egrep -o '(--[a-z-]+) ' README.md | sort -u | xargs echo` && \
  19. content=`sed "s/opts=\"[^\"]*\"/opts=\"$${options}\"/g" youtube-dl.bash-completion` && \
  20. echo "$${content}" > youtube-dl.bash-completion
  21. compile:
  22. zip --quiet --junk-paths youtube-dl youtube_dl/*.py
  23. echo '#!/usr/bin/env python' > youtube-dl
  24. cat youtube-dl.zip >> youtube-dl
  25. rm youtube-dl.zip
  26. exe:
  27. bash devscripts/wine-py2exe.sh build_exe.py
  28. install:
  29. install -m 755 --owner root --group root youtube-dl /usr/local/bin/
  30. install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1
  31. install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl
  32. .PHONY: all update-latest readme man-page bash-completion compile exe install