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