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