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