]>
Commit | Line | Data |
---|---|---|
ca858d45 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python3 # CPython 3.x module | |
4 | ||
652733c1 | 5 | # full version number as seen on youtube-dl website |
7e83a621 | 6 | %define verlong 2019.05.11 |
ffca9320 ER |
7 | |
8 | # transform version so we don't have to bump epoch after four digit upgrades: | |
9 | # 2013.01.17.1 becomes 20130117_1 | |
10 | # 2013.01.28 becomes 20130128 | |
11 | # $ rpmvercmp 20130117_1 20130128 | |
12 | # 20130117_1 < 20130128 | |
bee68788 | 13 | %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)}') |
28341d8e | 14 | Summary: Video extraction utility for YouTube |
15 | Summary(pl.UTF-8): Narzędzie do wydobywania filmów z YouTube | |
16 | Name: youtube-dl | |
652733c1 | 17 | Version: %{ver} |
77453449 | 18 | Release: 1 |
652733c1 | 19 | Epoch: 2 |
ae11d3cf | 20 | License: Public Domain |
28341d8e | 21 | Group: Applications/System |
652733c1 | 22 | Source0: http://youtube-dl.org/downloads/%{verlong}/%{name}-%{verlong}.tar.gz |
7e83a621 | 23 | # Source0-md5: 4b3dacfb8e26de80b04349671161f5cb |
3ff34f8f | 24 | Source1: %{name}.conf |
b9191cfa ER |
25 | # should be downloaded from: |
26 | # https://github.com/rg3/youtube-dl/pull/10291.diff | |
27 | # but the author removed his repository, so the url is 404 | |
28 | # git log -p --reverse pr/10291~3..pr/10291 | |
29 | Patch0: 10291.diff | |
9f1b4a7d | 30 | URL: http://youtube-dl.org/ |
ca858d45 | 31 | BuildRequires: python-modules >= 1:2.6 |
5f5c6c14 | 32 | BuildRequires: python-setuptools |
ca858d45 JB |
33 | %if %{with python3} |
34 | BuildRequires: python3-modules >= 1:3.2 | |
62e93aa0 | 35 | BuildRequires: python3-setuptools |
ca858d45 | 36 | %endif |
28341d8e | 37 | BuildRequires: rpm-pythonprov |
fecb6f83 | 38 | BuildRequires: rpmbuild(macros) >= 1.720 |
872960a4 | 39 | Requires: python-setuptools |
62e93aa0 | 40 | Requires: python-%{name} = %{epoch}:%{version}-%{release} |
873019f9 | 41 | Suggests: ffmpeg |
28341d8e | 42 | BuildArch: noarch |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
46 | youtube-dl is a small command-line program to download videos from | |
47 | YouTube.com. | |
48 | ||
49 | %description -l pl.UTF-8 | |
50 | youtube-dl jest programem do ściągania plików video z YouTube.com. | |
51 | ||
97454f03 JB |
52 | %package -n bash-completion-%{name} |
53 | Summary: Bash completion for youtube-dl command | |
54 | Summary(pl.UTF-8): Bashowe dopełnianie parametrów polecenia youtube-dl | |
55 | Group: Applications/Shells | |
9a77a05b | 56 | Requires: %{name} = %{epoch}:%{version}-%{release} |
b9296b05 | 57 | Requires: bash-completion >= 2.0 |
97454f03 JB |
58 | |
59 | %description -n bash-completion-%{name} | |
60 | Bash completion for youtube-dl command. | |
61 | ||
62 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
63 | Bashowe dopełnianie parametrów polecenia youtube-dl. | |
64 | ||
cd179393 JP |
65 | %package -n fish-completion-%{name} |
66 | Summary: Fish completion for youtube-dl command | |
67 | Summary(pl.UTF-8): Dopełnianie parametrów w fish dla polecenia youtube-dl | |
68 | Group: Applications/Shells | |
69 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
70 | Requires: fish | |
71 | ||
72 | %description -n fish-completion-%{name} | |
73 | Fish completion for youtube-dl command. | |
74 | ||
75 | %description -n fish-completion-%{name} -l pl.UTF-8 | |
76 | Dopełnianie parametrów w fish dla polecenia youtube-dl. | |
77 | ||
62e93aa0 | 78 | %package -n python-%{name} |
ca858d45 JB |
79 | Summary: Python 2 video extraction utility for YouTube |
80 | Summary(pl.UTF-8): Narzędzie do wydobywania filmów z YouTube dla Pythona 2 | |
62e93aa0 JP |
81 | Group: Libraries/Python |
82 | Requires: python-pyxattr >= 0.5.0 | |
83 | ||
84 | %description -n python-%{name} | |
ca858d45 | 85 | Python 2 video extraction utility for YouTube. |
62e93aa0 JP |
86 | |
87 | %description -n python-%{name} -l pl.UTF-8 | |
ca858d45 | 88 | Narzędzie do wydobywania filmów z YouTube dla Pythona 2. |
62e93aa0 JP |
89 | |
90 | %package -n python3-%{name} | |
ca858d45 JB |
91 | Summary: Python 3 video extraction utility for YouTube |
92 | Summary(pl.UTF-8): Narzędzie do wydobywania filmów z YouTube dla Pythona 3 | |
62e93aa0 | 93 | Group: Libraries/Python |
ca858d45 | 94 | Requires: python3-pyxattr >= 0.5.0 |
62e93aa0 JP |
95 | |
96 | %description -n python3-%{name} | |
ca858d45 | 97 | Python 3 video extraction utility for YouTube. |
62e93aa0 JP |
98 | |
99 | %description -n python3-%{name} -l pl.UTF-8 | |
ca858d45 | 100 | Narzędzie do wydobywania filmów z YouTube dla Pythona 3. |
62e93aa0 | 101 | |
e0c61189 JP |
102 | %package -n zsh-completion-%{name} |
103 | Summary: Zsh completion for youtube-dl command | |
104 | Summary(pl.UTF-8): Dopełnianie parametrów w zsh dla polecenia youtube-dl | |
105 | Group: Applications/Shells | |
106 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
107 | Requires: zsh | |
108 | ||
109 | %description -n zsh-completion-%{name} | |
110 | Zsh completion for youtube-dl command. | |
111 | ||
112 | %description -n zsh-completion-%{name} -l pl.UTF-8 | |
113 | Dopełnianie parametrów w zsh dla polecenia youtube-dl. | |
114 | ||
28341d8e | 115 | %prep |
58a481cb | 116 | %setup -qc |
ca858d45 | 117 | %{__mv} %{name} .tmp; %{__mv} .tmp/* . |
b9191cfa | 118 | %patch0 -p1 |
48cee41a AM |
119 | |
120 | %build | |
8212b4a0 | 121 | %py_build |
ca858d45 JB |
122 | |
123 | %if %{with python3} | |
62e93aa0 | 124 | %py3_build |
ca858d45 | 125 | %endif |
28341d8e | 126 | |
28341d8e | 127 | %install |
128 | rm -rf $RPM_BUILD_ROOT | |
ca858d45 JB |
129 | |
130 | %if %{with python3} | |
62e93aa0 | 131 | %py3_install |
ca858d45 JB |
132 | %endif |
133 | ||
8212b4a0 | 134 | %py_install |
58a481cb ER |
135 | %py_postclean |
136 | ||
3ff34f8f ER |
137 | install -d $RPM_BUILD_ROOT%{_sysconfdir} |
138 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir} | |
139 | ||
e0c61189 | 140 | install -d $RPM_BUILD_ROOT{%{bash_compdir},%{fish_compdir},%{zsh_compdir}} |
b9296b05 ER |
141 | %{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/bash_completion.d/youtube-dl.bash-completion \ |
142 | $RPM_BUILD_ROOT%{bash_compdir}/%{name} | |
cd179393 JP |
143 | %{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/fish/completions/youtube-dl.fish \ |
144 | $RPM_BUILD_ROOT%{fish_compdir}/%{name}.fish | |
e0c61189 | 145 | cp -p youtube-dl.zsh $RPM_BUILD_ROOT%{zsh_compdir}/_youtube-dl |
58a481cb | 146 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/youtube_dl |
28341d8e | 147 | |
148 | %clean | |
149 | rm -rf $RPM_BUILD_ROOT | |
150 | ||
151 | %files | |
152 | %defattr(644,root,root,755) | |
4c1746c0 | 153 | %doc README.md LICENSE |
3ff34f8f | 154 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/youtube-dl.conf |
28341d8e | 155 | %attr(755,root,root) %{_bindir}/youtube-dl |
58a481cb | 156 | %{_mandir}/man1/youtube-dl.1* |
97454f03 JB |
157 | |
158 | %files -n bash-completion-%{name} | |
159 | %defattr(644,root,root,755) | |
b9296b05 | 160 | %{bash_compdir}/%{name} |
cd179393 JP |
161 | |
162 | %files -n fish-completion-%{name} | |
163 | %defattr(644,root,root,755) | |
164 | %{fish_compdir}/%{name}.fish | |
e0c61189 | 165 | |
62e93aa0 JP |
166 | %files -n python-%{name} |
167 | %defattr(644,root,root,755) | |
168 | %{py_sitescriptdir}/youtube_dl | |
169 | %{py_sitescriptdir}/youtube_dl-*-py*.egg-info | |
170 | ||
ca858d45 | 171 | %if %{with python3} |
62e93aa0 JP |
172 | %files -n python3-%{name} |
173 | %defattr(644,root,root,755) | |
174 | %{py3_sitescriptdir}/youtube_dl | |
175 | %{py3_sitescriptdir}/youtube_dl-*-py*.egg-info | |
ca858d45 | 176 | %endif |
62e93aa0 | 177 | |
e0c61189 JP |
178 | %files -n zsh-completion-%{name} |
179 | %defattr(644,root,root,755) | |
180 | %{zsh_compdir}/_youtube-dl |