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.

90 lines
2.9 KiB

12 years ago
12 years ago
  1. all: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.fish
  2. clean:
  3. rm -rf youtube-dl.1.temp.md youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dl.tar.gz youtube-dl.fish
  4. cleanall: clean
  5. rm -f youtube-dl youtube-dl.exe
  6. PREFIX ?= /usr/local
  7. BINDIR ?= $(PREFIX)/bin
  8. MANDIR ?= $(PREFIX)/man
  9. PYTHON ?= /usr/bin/env python
  10. # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
  11. ifeq ($(PREFIX),/usr)
  12. SYSCONFDIR=/etc
  13. else
  14. ifeq ($(PREFIX),/usr/local)
  15. SYSCONFDIR=/etc
  16. else
  17. SYSCONFDIR=$(PREFIX)/etc
  18. endif
  19. endif
  20. install: youtube-dl youtube-dl.1 youtube-dl.bash-completion
  21. install -d $(DESTDIR)$(BINDIR)
  22. install -m 755 youtube-dl $(DESTDIR)$(BINDIR)
  23. install -d $(DESTDIR)$(MANDIR)/man1
  24. install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1
  25. install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
  26. install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl
  27. install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions
  28. install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish
  29. test:
  30. #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test
  31. nosetests --verbose test
  32. tar: youtube-dl.tar.gz
  33. .PHONY: all clean install test tar bash-completion pypi-files fish-completion
  34. pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish
  35. youtube-dl: youtube_dl/*.py youtube_dl/*/*.py
  36. zip --quiet youtube-dl youtube_dl/*.py youtube_dl/*/*.py
  37. zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py
  38. echo '#!$(PYTHON)' > youtube-dl
  39. cat youtube-dl.zip >> youtube-dl
  40. rm youtube-dl.zip
  41. chmod a+x youtube-dl
  42. README.md: youtube_dl/*.py youtube_dl/*/*.py
  43. COLUMNS=80 python -m youtube_dl --help | python devscripts/make_readme.py
  44. README.txt: README.md
  45. pandoc -f markdown -t plain README.md -o README.txt
  46. youtube-dl.1: README.md
  47. python devscripts/prepare_manpage.py >youtube-dl.1.temp.md
  48. pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1
  49. rm -f youtube-dl.1.temp.md
  50. youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in
  51. python devscripts/bash-completion.py
  52. bash-completion: youtube-dl.bash-completion
  53. youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in
  54. python devscripts/fish-completion.py
  55. fish-completion: youtube-dl.fish
  56. youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.fish
  57. @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
  58. --exclude '*.DS_Store' \
  59. --exclude '*.kate-swp' \
  60. --exclude '*.pyc' \
  61. --exclude '*.pyo' \
  62. --exclude '*~' \
  63. --exclude '__pycache' \
  64. --exclude '.git' \
  65. --exclude 'testdata' \
  66. --exclude 'docs/_build' \
  67. -- \
  68. bin devscripts test youtube_dl docs \
  69. LICENSE README.md README.txt \
  70. Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \
  71. youtube-dl.fish setup.py \
  72. youtube-dl