move python files to subpackage and package python3 version as well
[packages/youtube-dl.git] / youtube-dl.spec
CommitLineData
652733c1 1# full version number as seen on youtube-dl website
8b1a7237 2%define verlong 2018.12.09
ffca9320
ER
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
bee68788 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)}')
28341d8e 10Summary: Video extraction utility for YouTube
11Summary(pl.UTF-8): Narzędzie do wydobywania filmów z YouTube
12Name: youtube-dl
652733c1 13Version: %{ver}
77453449 14Release: 1
652733c1 15Epoch: 2
ae11d3cf 16License: Public Domain
28341d8e 17Group: Applications/System
652733c1 18Source0: http://youtube-dl.org/downloads/%{verlong}/%{name}-%{verlong}.tar.gz
8b1a7237 19# Source0-md5: 234e0b1980a0fc92585290cf58861a7a
3ff34f8f 20Source1: %{name}.conf
b9191cfa
ER
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
25Patch0: 10291.diff
9f1b4a7d 26URL: http://youtube-dl.org/
5f5c6c14 27BuildRequires: python-setuptools
62e93aa0 28BuildRequires: python3-setuptools
28341d8e 29BuildRequires: rpm-pythonprov
fecb6f83 30BuildRequires: rpmbuild(macros) >= 1.720
872960a4 31Requires: python-setuptools
62e93aa0 32Requires: python-%{name} = %{epoch}:%{version}-%{release}
873019f9 33Suggests: ffmpeg
28341d8e 34BuildArch: noarch
35BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37%description
38youtube-dl is a small command-line program to download videos from
39YouTube.com.
40
41%description -l pl.UTF-8
42youtube-dl jest programem do ściągania plików video z YouTube.com.
43
97454f03
JB
44%package -n bash-completion-%{name}
45Summary: Bash completion for youtube-dl command
46Summary(pl.UTF-8): Bashowe dopełnianie parametrów polecenia youtube-dl
47Group: Applications/Shells
9a77a05b 48Requires: %{name} = %{epoch}:%{version}-%{release}
b9296b05 49Requires: bash-completion >= 2.0
97454f03
JB
50
51%description -n bash-completion-%{name}
52Bash completion for youtube-dl command.
53
54%description -n bash-completion-%{name} -l pl.UTF-8
55Bashowe dopełnianie parametrów polecenia youtube-dl.
56
cd179393
JP
57%package -n fish-completion-%{name}
58Summary: Fish completion for youtube-dl command
59Summary(pl.UTF-8): Dopełnianie parametrów w fish dla polecenia youtube-dl
60Group: Applications/Shells
61Requires: %{name} = %{epoch}:%{version}-%{release}
62Requires: fish
63
64%description -n fish-completion-%{name}
65Fish completion for youtube-dl command.
66
67%description -n fish-completion-%{name} -l pl.UTF-8
68Dopełnianie parametrów w fish dla polecenia youtube-dl.
69
62e93aa0
JP
70%package -n python-%{name}
71Summary: Video extraction utility for YouTube
72Summary(pl.UTF-8): Narzędzie do wydobywania filmów z YouTube
73Group: Libraries/Python
74Requires: python-pyxattr >= 0.5.0
75
76%description -n python-%{name}
77youtube-dl is a small command-line program to download videos from
78YouTube.com.
79
80%description -n python-%{name} -l pl.UTF-8
81youtube-dl jest programem do ściągania plików video z YouTube.com.
82
83%package -n python3-%{name}
84Summary: Video extraction utility for YouTube
85Summary(pl.UTF-8): Narzędzie do wydobywania filmów z YouTube
86Group: Libraries/Python
87
88%description -n python3-%{name}
89youtube-dl is a small command-line program to download videos from
90YouTube.com.
91
92%description -n python3-%{name} -l pl.UTF-8
93youtube-dl jest programem do ściągania plików video z YouTube.com.
94
e0c61189
JP
95%package -n zsh-completion-%{name}
96Summary: Zsh completion for youtube-dl command
97Summary(pl.UTF-8): Dopełnianie parametrów w zsh dla polecenia youtube-dl
98Group: Applications/Shells
99Requires: %{name} = %{epoch}:%{version}-%{release}
100Requires: zsh
101
102%description -n zsh-completion-%{name}
103Zsh completion for youtube-dl command.
104
105%description -n zsh-completion-%{name} -l pl.UTF-8
106Dopełnianie parametrów w zsh dla polecenia youtube-dl.
107
28341d8e 108%prep
58a481cb
ER
109%setup -qc
110mv %{name} .tmp; mv .tmp/* .
b9191cfa 111%patch0 -p1
48cee41a
AM
112
113%build
8212b4a0 114%py_build
62e93aa0 115%py3_build
28341d8e 116
28341d8e 117%install
118rm -rf $RPM_BUILD_ROOT
62e93aa0 119%py3_install
8212b4a0 120%py_install
58a481cb
ER
121%py_postclean
122
3ff34f8f
ER
123install -d $RPM_BUILD_ROOT%{_sysconfdir}
124cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
125
e0c61189 126install -d $RPM_BUILD_ROOT{%{bash_compdir},%{fish_compdir},%{zsh_compdir}}
b9296b05
ER
127%{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/bash_completion.d/youtube-dl.bash-completion \
128 $RPM_BUILD_ROOT%{bash_compdir}/%{name}
cd179393
JP
129%{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/fish/completions/youtube-dl.fish \
130 $RPM_BUILD_ROOT%{fish_compdir}/%{name}.fish
e0c61189 131cp -p youtube-dl.zsh $RPM_BUILD_ROOT%{zsh_compdir}/_youtube-dl
58a481cb 132%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/youtube_dl
28341d8e 133
134%clean
135rm -rf $RPM_BUILD_ROOT
136
137%files
138%defattr(644,root,root,755)
4c1746c0 139%doc README.md LICENSE
3ff34f8f 140%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/youtube-dl.conf
28341d8e 141%attr(755,root,root) %{_bindir}/youtube-dl
58a481cb 142%{_mandir}/man1/youtube-dl.1*
97454f03
JB
143
144%files -n bash-completion-%{name}
145%defattr(644,root,root,755)
b9296b05 146%{bash_compdir}/%{name}
cd179393
JP
147
148%files -n fish-completion-%{name}
149%defattr(644,root,root,755)
150%{fish_compdir}/%{name}.fish
e0c61189 151
62e93aa0
JP
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
e0c61189
JP
162%files -n zsh-completion-%{name}
163%defattr(644,root,root,755)
164%{zsh_compdir}/_youtube-dl
This page took 0.891277 seconds and 4 git commands to generate.