]> Raphaƫl G. Git Repositories - youtubedl/blob - Makefile
debian/control: Remove obsolete DMUA flag.
[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 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
44 zip --quiet youtube-dl 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
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 pandoc -s -f markdown -t man README.md -o youtube-dl.1
59
60 youtube-dl.bash-completion: youtube_dl/*.py devscripts/bash-completion.in
61 python devscripts/bash-completion.py
62
63 bash-completion: youtube-dl.bash-completion
64
65 youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion
66 @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
67 --exclude '*.DS_Store' \
68 --exclude '*.kate-swp' \
69 --exclude '*.pyc' \
70 --exclude '*.pyo' \
71 --exclude '*~' \
72 --exclude '__pycache' \
73 --exclude '.git' \
74 -- \
75 bin devscripts test youtube_dl \
76 CHANGELOG LICENSE README.md README.txt \
77 Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion setup.py \
78 youtube-dl