]> Raphaƫl G. Git Repositories - youtubedl/blob - Makefile
Merge tag 'upstream/2014.08.05'
[youtubedl] / Makefile
1 all: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion
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
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 PYTHON=/usr/bin/env python
13
14 # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
15 ifeq ($(PREFIX),/usr)
16 SYSCONFDIR=/etc
17 else
18 ifeq ($(PREFIX),/usr/local)
19 SYSCONFDIR=/etc
20 else
21 SYSCONFDIR=$(PREFIX)/etc
22 endif
23 endif
24
25 install: youtube-dl youtube-dl.1 youtube-dl.bash-completion
26 install -d $(DESTDIR)$(BINDIR)
27 install -m 755 youtube-dl $(DESTDIR)$(BINDIR)
28 install -d $(DESTDIR)$(MANDIR)/man1
29 install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1
30 install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
31 install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl
32
33 test:
34 #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test
35 nosetests --verbose test
36
37 tar: youtube-dl.tar.gz
38
39 .PHONY: all clean install test tar bash-completion pypi-files
40
41 pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1
42
43 youtube-dl: youtube_dl/*.py youtube_dl/*/*.py
44 zip --quiet youtube-dl youtube_dl/*.py youtube_dl/*/*.py
45 zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py
46 echo '#!$(PYTHON)' > youtube-dl
47 cat youtube-dl.zip >> youtube-dl
48 rm youtube-dl.zip
49 chmod a+x youtube-dl
50
51 README.md: youtube_dl/*.py youtube_dl/*/*.py
52 COLUMNS=80 python -m youtube_dl --help | python devscripts/make_readme.py
53
54 README.txt: README.md
55 pandoc -f markdown -t plain README.md -o README.txt
56
57 youtube-dl.1: README.md
58 python devscripts/prepare_manpage.py >youtube-dl.1.temp.md
59 pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1
60 rm -f youtube-dl.1.temp.md
61
62 youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in
63 python devscripts/bash-completion.py
64
65 bash-completion: youtube-dl.bash-completion
66
67 youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion
68 @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
69 --exclude '*.DS_Store' \
70 --exclude '*.kate-swp' \
71 --exclude '*.pyc' \
72 --exclude '*.pyo' \
73 --exclude '*~' \
74 --exclude '__pycache' \
75 --exclude '.git' \
76 --exclude 'testdata' \
77 --exclude 'docs/_build' \
78 -- \
79 bin devscripts test youtube_dl docs \
80 LICENSE README.md README.txt \
81 Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion setup.py \
82 youtube-dl