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