move python files to subpackage and package python3 version as well
[packages/youtube-dl.git] / youtube-dl.spec
1 # full version number as seen on youtube-dl website
2 %define verlong 2018.12.09
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:  234e0b1980a0fc92585290cf58861a7a
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:  python3-setuptools
29 BuildRequires:  rpm-pythonprov
30 BuildRequires:  rpmbuild(macros) >= 1.720
31 Requires:       python-setuptools
32 Requires:       python-%{name} = %{epoch}:%{version}-%{release}
33 Suggests:       ffmpeg
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
38 youtube-dl is a small command-line program to download videos from
39 YouTube.com.
40
41 %description -l pl.UTF-8
42 youtube-dl jest programem do ściągania plików video z YouTube.com.
43
44 %package -n bash-completion-%{name}
45 Summary:        Bash completion for youtube-dl command
46 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów polecenia youtube-dl
47 Group:          Applications/Shells
48 Requires:       %{name} = %{epoch}:%{version}-%{release}
49 Requires:       bash-completion >= 2.0
50
51 %description -n bash-completion-%{name}
52 Bash completion for youtube-dl command.
53
54 %description -n bash-completion-%{name} -l pl.UTF-8
55 Bashowe dopełnianie parametrów polecenia youtube-dl.
56
57 %package -n fish-completion-%{name}
58 Summary:        Fish completion for youtube-dl command
59 Summary(pl.UTF-8):      Dopełnianie parametrów w fish dla polecenia youtube-dl
60 Group:          Applications/Shells
61 Requires:       %{name} = %{epoch}:%{version}-%{release}
62 Requires:       fish
63
64 %description -n fish-completion-%{name}
65 Fish completion for youtube-dl command.
66
67 %description -n fish-completion-%{name} -l pl.UTF-8
68 Dopełnianie parametrów w fish dla polecenia youtube-dl.
69
70 %package -n python-%{name}
71 Summary:        Video extraction utility for YouTube
72 Summary(pl.UTF-8):      Narzędzie do wydobywania filmów z YouTube
73 Group:          Libraries/Python
74 Requires:       python-pyxattr >= 0.5.0
75
76 %description -n python-%{name}
77 youtube-dl is a small command-line program to download videos from
78 YouTube.com.
79
80 %description -n python-%{name} -l pl.UTF-8
81 youtube-dl jest programem do ściągania plików video z YouTube.com.
82
83 %package -n python3-%{name}
84 Summary:        Video extraction utility for YouTube
85 Summary(pl.UTF-8):      Narzędzie do wydobywania filmów z YouTube
86 Group:          Libraries/Python
87
88 %description -n python3-%{name}
89 youtube-dl is a small command-line program to download videos from
90 YouTube.com.
91
92 %description -n python3-%{name} -l pl.UTF-8
93 youtube-dl jest programem do ściągania plików video z YouTube.com.
94
95 %package -n zsh-completion-%{name}
96 Summary:        Zsh completion for youtube-dl command
97 Summary(pl.UTF-8):      Dopełnianie parametrów w zsh dla polecenia youtube-dl
98 Group:          Applications/Shells
99 Requires:       %{name} = %{epoch}:%{version}-%{release}
100 Requires:       zsh
101
102 %description -n zsh-completion-%{name}
103 Zsh completion for youtube-dl command.
104
105 %description -n zsh-completion-%{name} -l pl.UTF-8
106 Dopełnianie parametrów w zsh dla polecenia youtube-dl.
107
108 %prep
109 %setup -qc
110 mv %{name} .tmp; mv .tmp/* .
111 %patch0 -p1
112
113 %build
114 %py_build
115 %py3_build
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119 %py3_install
120 %py_install
121 %py_postclean
122
123 install -d $RPM_BUILD_ROOT%{_sysconfdir}
124 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
125
126 install -d $RPM_BUILD_ROOT{%{bash_compdir},%{fish_compdir},%{zsh_compdir}}
127 %{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/bash_completion.d/youtube-dl.bash-completion \
128         $RPM_BUILD_ROOT%{bash_compdir}/%{name}
129 %{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/fish/completions/youtube-dl.fish \
130         $RPM_BUILD_ROOT%{fish_compdir}/%{name}.fish
131 cp -p youtube-dl.zsh $RPM_BUILD_ROOT%{zsh_compdir}/_youtube-dl
132 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/youtube_dl
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %files
138 %defattr(644,root,root,755)
139 %doc README.md LICENSE
140 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/youtube-dl.conf
141 %attr(755,root,root) %{_bindir}/youtube-dl
142 %{_mandir}/man1/youtube-dl.1*
143
144 %files -n bash-completion-%{name}
145 %defattr(644,root,root,755)
146 %{bash_compdir}/%{name}
147
148 %files -n fish-completion-%{name}
149 %defattr(644,root,root,755)
150 %{fish_compdir}/%{name}.fish
151
152 %files -n python-%{name}
153 %defattr(644,root,root,755)
154 %{py_sitescriptdir}/youtube_dl
155 %{py_sitescriptdir}/youtube_dl-*-py*.egg-info
156
157 %files -n python3-%{name}
158 %defattr(644,root,root,755)
159 %{py3_sitescriptdir}/youtube_dl
160 %{py3_sitescriptdir}/youtube_dl-*-py*.egg-info
161
162 %files -n zsh-completion-%{name}
163 %defattr(644,root,root,755)
164 %{zsh_compdir}/_youtube-dl
This page took 0.110602 seconds and 3 git commands to generate.