]>
Commit | Line | Data |
---|---|---|
cefecac1 | 1 | all: youtube-dlc README.md CONTRIBUTING.md README.txt youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish supportedsites |
4618f3da | 2 | |
85f76ac9 | 3 | clean: |
cefecac1 | 4 | rm -rf youtube-dlc.1.temp.md youtube-dlc.1 youtube-dlc.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dlc.tar.gz youtube-dlc.zsh youtube-dlc.fish youtube_dlc/extractor/lazy_extractors.py *.dump *.part* *.ytdl *.info.json *.mp4 *.m4a *.flv *.mp3 *.avi *.mkv *.webm *.3gp *.wav *.ape *.swf *.jpg *.png CONTRIBUTING.md.tmp youtube-dlc youtube-dlc.exe |
8e678af4 | 5 | find . -name "*.pyc" -delete |
101067de | 6 | find . -name "*.class" -delete |
4618f3da | 7 | |
df866e7f | 8 | PREFIX ?= /usr/local |
9 | BINDIR ?= $(PREFIX)/bin | |
10 | MANDIR ?= $(PREFIX)/man | |
24f7fb5e | 11 | SHAREDIR ?= $(PREFIX)/share |
df866e7f | 12 | PYTHON ?= /usr/bin/env python |
e79e8b7d | 13 | |
5738240e | 14 | # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local |
8204c733 | 15 | SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi) |
5738240e | 16 | |
af751350 S |
17 | # set markdown input format to "markdown-smart" for pandoc version 2 and to "markdown" for pandoc prior to version 2 |
18 | MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d" " -f2 | head -c1` = "2" ]; then echo markdown-smart; else echo markdown; fi) | |
19 | ||
cefecac1 | 20 | install: youtube-dlc youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish |
e79e8b7d | 21 | install -d $(DESTDIR)$(BINDIR) |
cefecac1 | 22 | install -m 755 youtube-dlc $(DESTDIR)$(BINDIR) |
e79e8b7d | 23 | install -d $(DESTDIR)$(MANDIR)/man1 |
cefecac1 | 24 | install -m 644 youtube-dlc.1 $(DESTDIR)$(MANDIR)/man1 |
e79e8b7d | 25 | install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d |
cefecac1 | 26 | install -m 644 youtube-dlc.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dlc |
24f7fb5e | 27 | install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions |
cefecac1 | 28 | install -m 644 youtube-dlc.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dlc |
56d1912f | 29 | install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions |
cefecac1 | 30 | install -m 644 youtube-dlc.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dlc.fish |
dce10884 | 31 | |
a0ab29f8 | 32 | codetest: |
dc9a441b | 33 | flake8 . |
a0ab29f8 | 34 | |
a7b5c8d6 | 35 | test: |
cefecac1 | 36 | #nosetests --with-coverage --cover-package=youtube_dlc --cover-html --verbose --processes 4 test |
fedb6816 | 37 | nosetests --verbose test |
a0ab29f8 PH |
38 | $(MAKE) codetest |
39 | ||
40 | ot: offlinetest | |
41 | ||
82a62de1 | 42 | # Keep this list in sync with devscripts/run_tests.sh |
a0ab29f8 | 43 | offlinetest: codetest |
82a62de1 YCH |
44 | $(PYTHON) -m nose --verbose test \ |
45 | --exclude test_age_restriction.py \ | |
46 | --exclude test_download.py \ | |
47 | --exclude test_iqiyi_sdk_interpreter.py \ | |
48 | --exclude test_socks.py \ | |
49 | --exclude test_subtitles.py \ | |
50 | --exclude test_write_annotations.py \ | |
51 | --exclude test_youtube_lists.py \ | |
52 | --exclude test_youtube_signature.py | |
a7b5c8d6 | 53 | |
cefecac1 | 54 | tar: youtube-dlc.tar.gz |
039dc61b | 55 | |
416c7fcb | 56 | .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites |
434eb6f2 | 57 | |
cefecac1 | 58 | pypi-files: youtube-dlc.bash-completion README.txt youtube-dlc.1 youtube-dlc.fish |
dce10884 | 59 | |
cefecac1 | 60 | youtube-dlc: youtube_dlc/*.py youtube_dlc/*/*.py |
305d99f0 | 61 | mkdir -p zip |
cefecac1 | 62 | for d in youtube_dlc youtube_dlc/downloader youtube_dlc/extractor youtube_dlc/postprocessor ; do \ |
305d99f0 | 63 | mkdir -p zip/$$d ;\ |
c75c384f | 64 | cp -pPR $$d/*.py zip/$$d/ ;\ |
305d99f0 | 65 | done |
cefecac1 U |
66 | touch -t 200001010101 zip/youtube_dlc/*.py zip/youtube_dlc/*/*.py |
67 | mv zip/youtube_dlc/__main__.py zip/ | |
68 | cd zip ; zip -q ../youtube-dlc youtube_dlc/*.py youtube_dlc/*/*.py __main__.py | |
305d99f0 | 69 | rm -rf zip |
cefecac1 U |
70 | echo '#!$(PYTHON)' > youtube-dlc |
71 | cat youtube-dlc.zip >> youtube-dlc | |
72 | rm youtube-dlc.zip | |
73 | chmod a+x youtube-dlc | |
dce10884 | 74 | |
cefecac1 U |
75 | README.md: youtube_dlc/*.py youtube_dlc/*/*.py |
76 | COLUMNS=80 $(PYTHON) youtube_dlc/__main__.py --help | $(PYTHON) devscripts/make_readme.py | |
4618f3da | 77 | |
e56190b3 | 78 | CONTRIBUTING.md: README.md |
8639f89f | 79 | $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md |
e56190b3 | 80 | |
cefecac1 | 81 | issuetemplates: devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE_tmpl/4_bug_report.md .github/ISSUE_TEMPLATE_tmpl/5_feature_request.md youtube_dlc/version.py |
eefa0f21 S |
82 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE/1_broken_site.md |
83 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE/2_site_support_request.md | |
84 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md | |
85 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/4_bug_report.md .github/ISSUE_TEMPLATE/4_bug_report.md | |
86 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/5_feature_request.md .github/ISSUE_TEMPLATE/5_feature_request.md | |
7710bdf4 | 87 | |
416c7fcb | 88 | supportedsites: |
8639f89f | 89 | $(PYTHON) devscripts/make_supportedsites.py docs/supportedsites.md |
416c7fcb | 90 | |
cc51a7d4 | 91 | README.txt: README.md |
af751350 | 92 | pandoc -f $(MARKDOWN) -t plain README.md -o README.txt |
cc51a7d4 | 93 | |
cefecac1 U |
94 | youtube-dlc.1: README.md |
95 | $(PYTHON) devscripts/prepare_manpage.py youtube-dlc.1.temp.md | |
96 | pandoc -s -f $(MARKDOWN) -t man youtube-dlc.1.temp.md -o youtube-dlc.1 | |
97 | rm -f youtube-dlc.1.temp.md | |
cfcec693 | 98 | |
cefecac1 | 99 | youtube-dlc.bash-completion: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/bash-completion.in |
8639f89f | 100 | $(PYTHON) devscripts/bash-completion.py |
23109d6a | 101 | |
cefecac1 | 102 | bash-completion: youtube-dlc.bash-completion |
434eb6f2 | 103 | |
cefecac1 | 104 | youtube-dlc.zsh: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/zsh-completion.in |
8639f89f | 105 | $(PYTHON) devscripts/zsh-completion.py |
24f7fb5e | 106 | |
cefecac1 | 107 | zsh-completion: youtube-dlc.zsh |
24f7fb5e | 108 | |
cefecac1 | 109 | youtube-dlc.fish: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/fish-completion.in |
8639f89f | 110 | $(PYTHON) devscripts/fish-completion.py |
56d1912f | 111 | |
cefecac1 | 112 | fish-completion: youtube-dlc.fish |
56d1912f | 113 | |
cefecac1 | 114 | lazy-extractors: youtube_dlc/extractor/lazy_extractors.py |
779822d9 | 115 | |
cefecac1 U |
116 | _EXTRACTOR_FILES = $(shell find youtube_dlc/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py') |
117 | youtube_dlc/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES) | |
779822d9 JMF |
118 | $(PYTHON) devscripts/make_lazy_extractors.py $@ |
119 | ||
cefecac1 U |
120 | youtube-dlc.tar.gz: youtube-dlc README.md README.txt youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish ChangeLog AUTHORS |
121 | @tar -czf youtube-dlc.tar.gz --transform "s|^|youtube-dlc/|" --owner 0 --group 0 \ | |
039dc61b PH |
122 | --exclude '*.DS_Store' \ |
123 | --exclude '*.kate-swp' \ | |
124 | --exclude '*.pyc' \ | |
125 | --exclude '*.pyo' \ | |
126 | --exclude '*~' \ | |
4f90d2ae | 127 | --exclude '__pycache__' \ |
814eed0e | 128 | --exclude '.git' \ |
2c8a4ba6 | 129 | --exclude 'docs/_build' \ |
814eed0e | 130 | -- \ |
cefecac1 | 131 | bin devscripts test youtube_dlc docs \ |
3e191da6 | 132 | ChangeLog AUTHORS LICENSE README.md README.txt \ |
cefecac1 U |
133 | Makefile MANIFEST.in youtube-dlc.1 youtube-dlc.bash-completion \ |
134 | youtube-dlc.zsh youtube-dlc.fish setup.py setup.cfg \ | |
135 | youtube-dlc |