8df189cc39f0c2ed176bbdc0b94560c2af063ac6
[packages/youtube-dl.git] / youtube-dl.spec
1 # full version number as seen on youtube-dl website
2 %define verlong 2018.04.03
3
4 # transform version so we don't have to bump epoch after four digit upgrades:
5 # 2013.01.17.1 becomes 20130117_1
6 # 2013.01.28   becomes 20130128
7 # $ rpmvercmp 20130117_1 20130128
8 # 20130117_1 < 20130128
9 %define ver     %(echo %{verlong} | awk -F. 'NF == 3 {printf("%s%s%s", $1, $2, $3)} NF == 4 {printf("%s%s%s_%s", $1, $2, $3, $4)}')
10 Summary:        Video extraction utility for YouTube
11 Summary(pl.UTF-8):      Narzędzie do wydobywania filmów z YouTube
12 Name:           youtube-dl
13 Version:        %{ver}
14 Release:        1
15 Epoch:          2
16 License:        Public Domain
17 Group:          Applications/System
18 Source0:        http://youtube-dl.org/downloads/%{verlong}/%{name}-%{verlong}.tar.gz
19 # Source0-md5:  8357a2c1497a37063409bdcc27c4365c
20 Source1:        %{name}.conf
21 # should be downloaded from:
22 # https://github.com/rg3/youtube-dl/pull/10291.diff
23 # but the author removed his repository, so the url is 404
24 # git log -p --reverse pr/10291~3..pr/10291
25 Patch0:         10291.diff
26 URL:            http://youtube-dl.org/
27 BuildRequires:  python-setuptools
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  rpmbuild(macros) >= 1.713
30 Requires:       python-pyxattr >= 0.5.0
31 Requires:       python-setuptools
32 BuildArch:      noarch
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         bash_compdir    %{_datadir}/bash-completion/completions
36 %define         fish_compdir    %{_datadir}/fish/completions
37 %define         zsh_compdir     %{_datadir}/zsh/site-functions
38
39 %description
40 youtube-dl is a small command-line program to download videos from
41 YouTube.com.
42
43 %description -l pl.UTF-8
44 youtube-dl jest programem do ściągania plików video z YouTube.com.
45
46 %package -n bash-completion-%{name}
47 Summary:        Bash completion for youtube-dl command
48 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów polecenia youtube-dl
49 Group:          Applications/Shells
50 Requires:       %{name} = %{epoch}:%{version}-%{release}
51 Requires:       bash-completion >= 2.0
52
53 %description -n bash-completion-%{name}
54 Bash completion for youtube-dl command.
55
56 %description -n bash-completion-%{name} -l pl.UTF-8
57 Bashowe dopełnianie parametrów polecenia youtube-dl.
58
59 %package -n fish-completion-%{name}
60 Summary:        Fish completion for youtube-dl command
61 Summary(pl.UTF-8):      Dopełnianie parametrów w fish dla polecenia youtube-dl
62 Group:          Applications/Shells
63 Requires:       %{name} = %{epoch}:%{version}-%{release}
64 Requires:       fish
65
66 %description -n fish-completion-%{name}
67 Fish completion for youtube-dl command.
68
69 %description -n fish-completion-%{name} -l pl.UTF-8
70 Dopełnianie parametrów w fish dla polecenia youtube-dl.
71
72 %package -n zsh-completion-%{name}
73 Summary:        Zsh completion for youtube-dl command
74 Summary(pl.UTF-8):      Dopełnianie parametrów w zsh dla polecenia youtube-dl
75 Group:          Applications/Shells
76 Requires:       %{name} = %{epoch}:%{version}-%{release}
77 Requires:       zsh
78
79 %description -n zsh-completion-%{name}
80 Zsh completion for youtube-dl command.
81
82 %description -n zsh-completion-%{name} -l pl.UTF-8
83 Dopełnianie parametrów w zsh dla polecenia youtube-dl.
84
85 %prep
86 %setup -qc
87 mv %{name} .tmp; mv .tmp/* .
88 %patch0 -p1
89
90 %build
91 %py_build
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95 %py_install
96 %py_postclean
97
98 install -d $RPM_BUILD_ROOT%{_sysconfdir}
99 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
100
101 install -d $RPM_BUILD_ROOT{%{bash_compdir},%{fish_compdir},%{zsh_compdir}}
102 %{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/bash_completion.d/youtube-dl.bash-completion \
103         $RPM_BUILD_ROOT%{bash_compdir}/%{name}
104 %{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/fish/completions/youtube-dl.fish \
105         $RPM_BUILD_ROOT%{fish_compdir}/%{name}.fish
106 cp -p youtube-dl.zsh $RPM_BUILD_ROOT%{zsh_compdir}/_youtube-dl
107 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/youtube_dl
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %files
113 %defattr(644,root,root,755)
114 %doc README.md LICENSE
115 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/youtube-dl.conf
116 %attr(755,root,root) %{_bindir}/youtube-dl
117 %{_mandir}/man1/youtube-dl.1*
118 %{py_sitescriptdir}/youtube_dl
119 %{py_sitescriptdir}/youtube_dl-*-py*.egg-info
120
121 %files -n bash-completion-%{name}
122 %defattr(644,root,root,755)
123 %{bash_compdir}/%{name}
124
125 %files -n fish-completion-%{name}
126 %defattr(644,root,root,755)
127 %{fish_compdir}/%{name}.fish
128
129 %files -n zsh-completion-%{name}
130 %defattr(644,root,root,755)
131 %{zsh_compdir}/_youtube-dl
This page took 0.043017 seconds and 2 git commands to generate.