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