]>
Commit | Line | Data |
---|---|---|
1 | all: youtube-dl README.md CONTRIBUTING.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish | |
2 | ||
3 | clean: | |
4 | rm -rf youtube-dl.1.temp.md youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dl.tar.gz youtube-dl.zsh youtube-dl.fish *.dump *.part *.info.json CONTRIBUTING.md.tmp | |
5 | ||
6 | cleanall: clean | |
7 | rm -f youtube-dl youtube-dl.exe | |
8 | ||
9 | PREFIX ?= /usr/local | |
10 | BINDIR ?= $(PREFIX)/bin | |
11 | MANDIR ?= $(PREFIX)/man | |
12 | SHAREDIR ?= $(PREFIX)/share | |
13 | PYTHON ?= /usr/bin/env python | |
14 | ||
15 | # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local | |
16 | ifeq ($(PREFIX),/usr) | |
17 | SYSCONFDIR=/etc | |
18 | else | |
19 | ifeq ($(PREFIX),/usr/local) | |
20 | SYSCONFDIR=/etc | |
21 | else | |
22 | SYSCONFDIR=$(PREFIX)/etc | |
23 | endif | |
24 | endif | |
25 | ||
26 | install: youtube-dl youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish | |
27 | install -d $(DESTDIR)$(BINDIR) | |
28 | install -m 755 youtube-dl $(DESTDIR)$(BINDIR) | |
29 | install -d $(DESTDIR)$(MANDIR)/man1 | |
30 | install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1 | |
31 | install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d | |
32 | install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl | |
33 | install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions | |
34 | install -m 644 youtube-dl.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dl | |
35 | install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions | |
36 | install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish | |
37 | ||
38 | test: | |
39 | #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test | |
40 | nosetests --verbose test | |
41 | ||
42 | tar: youtube-dl.tar.gz | |
43 | ||
44 | .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion | |
45 | ||
46 | pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish | |
47 | ||
48 | youtube-dl: youtube_dl/*.py youtube_dl/*/*.py | |
49 | zip --quiet youtube-dl youtube_dl/*.py youtube_dl/*/*.py | |
50 | zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py | |
51 | echo '#!$(PYTHON)' > youtube-dl | |
52 | cat youtube-dl.zip >> youtube-dl | |
53 | rm youtube-dl.zip | |
54 | chmod a+x youtube-dl | |
55 | ||
56 | README.md: youtube_dl/*.py youtube_dl/*/*.py | |
57 | COLUMNS=80 python -m youtube_dl --help | python devscripts/make_readme.py | |
58 | ||
59 | CONTRIBUTING.md: README.md | |
60 | python devscripts/make_contributing.py README.md CONTRIBUTING.md | |
61 | ||
62 | README.txt: README.md | |
63 | pandoc -f markdown -t plain README.md -o README.txt | |
64 | ||
65 | youtube-dl.1: README.md | |
66 | python devscripts/prepare_manpage.py >youtube-dl.1.temp.md | |
67 | pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1 | |
68 | rm -f youtube-dl.1.temp.md | |
69 | ||
70 | youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in | |
71 | python devscripts/bash-completion.py | |
72 | ||
73 | bash-completion: youtube-dl.bash-completion | |
74 | ||
75 | youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in | |
76 | python devscripts/zsh-completion.py | |
77 | ||
78 | zsh-completion: youtube-dl.zsh | |
79 | ||
80 | youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in | |
81 | python devscripts/fish-completion.py | |
82 | ||
83 | fish-completion: youtube-dl.fish | |
84 | ||
85 | youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish | |
86 | @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \ | |
87 | --exclude '*.DS_Store' \ | |
88 | --exclude '*.kate-swp' \ | |
89 | --exclude '*.pyc' \ | |
90 | --exclude '*.pyo' \ | |
91 | --exclude '*~' \ | |
92 | --exclude '__pycache' \ | |
93 | --exclude '.git' \ | |
94 | --exclude 'testdata' \ | |
95 | --exclude 'docs/_build' \ | |
96 | -- \ | |
97 | bin devscripts test youtube_dl docs \ | |
98 | LICENSE README.md README.txt \ | |
99 | Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \ | |
100 | youtube-dl.zsh youtube-dl.fish setup.py \ | |
101 | youtube-dl |