- up to 2018.05.01
[packages/youtube-dl.git] / youtube-dl.spec
CommitLineData
652733c1 1# full version number as seen on youtube-dl website
3e0eba31 2%define verlong 2018.05.01
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
3e0eba31 19# Source0-md5: 2e8a164c9e3fca74544306e14438ffcf
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
28341d8e 28BuildRequires: rpm-pythonprov
8212b4a0 29BuildRequires: rpmbuild(macros) >= 1.713
cd3037f4 30Requires: python-pyxattr >= 0.5.0
872960a4 31Requires: python-setuptools
28341d8e 32BuildArch: noarch
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
b9296b05 35%define bash_compdir %{_datadir}/bash-completion/completions
cd179393 36%define fish_compdir %{_datadir}/fish/completions
e0c61189 37%define zsh_compdir %{_datadir}/zsh/site-functions
b9296b05 38
28341d8e 39%description
40youtube-dl is a small command-line program to download videos from
41YouTube.com.
42
43%description -l pl.UTF-8
44youtube-dl jest programem do ściągania plików video z YouTube.com.
45
97454f03
JB
46%package -n bash-completion-%{name}
47Summary: Bash completion for youtube-dl command
48Summary(pl.UTF-8): Bashowe dopełnianie parametrów polecenia youtube-dl
49Group: Applications/Shells
9a77a05b 50Requires: %{name} = %{epoch}:%{version}-%{release}
b9296b05 51Requires: bash-completion >= 2.0
97454f03
JB
52
53%description -n bash-completion-%{name}
54Bash completion for youtube-dl command.
55
56%description -n bash-completion-%{name} -l pl.UTF-8
57Bashowe dopełnianie parametrów polecenia youtube-dl.
58
cd179393
JP
59%package -n fish-completion-%{name}
60Summary: Fish completion for youtube-dl command
61Summary(pl.UTF-8): Dopełnianie parametrów w fish dla polecenia youtube-dl
62Group: Applications/Shells
63Requires: %{name} = %{epoch}:%{version}-%{release}
64Requires: fish
65
66%description -n fish-completion-%{name}
67Fish completion for youtube-dl command.
68
69%description -n fish-completion-%{name} -l pl.UTF-8
70Dopełnianie parametrów w fish dla polecenia youtube-dl.
71
e0c61189
JP
72%package -n zsh-completion-%{name}
73Summary: Zsh completion for youtube-dl command
74Summary(pl.UTF-8): Dopełnianie parametrów w zsh dla polecenia youtube-dl
75Group: Applications/Shells
76Requires: %{name} = %{epoch}:%{version}-%{release}
77Requires: zsh
78
79%description -n zsh-completion-%{name}
80Zsh completion for youtube-dl command.
81
82%description -n zsh-completion-%{name} -l pl.UTF-8
83Dopełnianie parametrów w zsh dla polecenia youtube-dl.
84
28341d8e 85%prep
58a481cb
ER
86%setup -qc
87mv %{name} .tmp; mv .tmp/* .
b9191cfa 88%patch0 -p1
48cee41a
AM
89
90%build
8212b4a0 91%py_build
28341d8e 92
28341d8e 93%install
94rm -rf $RPM_BUILD_ROOT
8212b4a0 95%py_install
58a481cb
ER
96%py_postclean
97
3ff34f8f
ER
98install -d $RPM_BUILD_ROOT%{_sysconfdir}
99cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
100
e0c61189 101install -d $RPM_BUILD_ROOT{%{bash_compdir},%{fish_compdir},%{zsh_compdir}}
b9296b05
ER
102%{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/bash_completion.d/youtube-dl.bash-completion \
103 $RPM_BUILD_ROOT%{bash_compdir}/%{name}
cd179393
JP
104%{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/fish/completions/youtube-dl.fish \
105 $RPM_BUILD_ROOT%{fish_compdir}/%{name}.fish
e0c61189 106cp -p youtube-dl.zsh $RPM_BUILD_ROOT%{zsh_compdir}/_youtube-dl
58a481cb 107%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/youtube_dl
28341d8e 108
109%clean
110rm -rf $RPM_BUILD_ROOT
111
112%files
113%defattr(644,root,root,755)
4c1746c0 114%doc README.md LICENSE
3ff34f8f 115%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/youtube-dl.conf
28341d8e 116%attr(755,root,root) %{_bindir}/youtube-dl
58a481cb
ER
117%{_mandir}/man1/youtube-dl.1*
118%{py_sitescriptdir}/youtube_dl
3ff34f8f 119%{py_sitescriptdir}/youtube_dl-*-py*.egg-info
97454f03
JB
120
121%files -n bash-completion-%{name}
122%defattr(644,root,root,755)
b9296b05 123%{bash_compdir}/%{name}
cd179393
JP
124
125%files -n fish-completion-%{name}
126%defattr(644,root,root,755)
127%{fish_compdir}/%{name}.fish
e0c61189
JP
128
129%files -n zsh-completion-%{name}
130%defattr(644,root,root,755)
131%{zsh_compdir}/_youtube-dl
This page took 1.400139 seconds and 4 git commands to generate.