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.

78 lines
2.3 KiB

12 years ago
12 years ago
  1. all: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion
  2. clean:
  3. rm -rf youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dl.tar.gz
  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. test:
  28. #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test
  29. nosetests --verbose test
  30. tar: youtube-dl.tar.gz
  31. .PHONY: all clean install test tar bash-completion pypi-files
  32. pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1
  33. youtube-dl: youtube_dl/*.py
  34. zip --quiet youtube-dl youtube_dl/*.py
  35. zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py
  36. echo '#!$(PYTHON)' > youtube-dl
  37. cat youtube-dl.zip >> youtube-dl
  38. rm youtube-dl.zip
  39. chmod a+x youtube-dl
  40. README.md: youtube_dl/*.py
  41. COLUMNS=80 python -m youtube_dl --help | python devscripts/make_readme.py
  42. README.txt: README.md
  43. pandoc -f markdown -t plain README.md -o README.txt
  44. youtube-dl.1: README.md
  45. pandoc -s -f markdown -t man README.md -o youtube-dl.1
  46. youtube-dl.bash-completion: youtube_dl/*.py devscripts/bash-completion.in
  47. python devscripts/bash-completion.py
  48. bash-completion: youtube-dl.bash-completion
  49. youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion
  50. @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
  51. --exclude '*.DS_Store' \
  52. --exclude '*.kate-swp' \
  53. --exclude '*.pyc' \
  54. --exclude '*.pyo' \
  55. --exclude '*~' \
  56. --exclude '__pycache' \
  57. --exclude '.git' \
  58. -- \
  59. bin devscripts test youtube_dl \
  60. CHANGELOG LICENSE README.md README.txt \
  61. Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion setup.py \
  62. youtube-dl