]>
Commit | Line | Data |
---|---|---|
209fd55a ER |
1 | Summary: The ultimate status-line/prompt utility |
2 | Name: powerline | |
c9d938ed | 3 | Version: 2.8.2 |
34c021da | 4 | Release: 3 |
209fd55a ER |
5 | License: MIT |
6 | Group: Applications/System | |
7 | Source0: https://github.com/powerline/powerline/archive/%{version}/%{name}-%{version}.tar.gz | |
c9d938ed | 8 | # Source0-md5: 2337d2f226b31e163aa752ce22aa532a |
209fd55a ER |
9 | URL: https://github.com/powerline/powerline |
10 | BuildRequires: fontconfig | |
c9d938ed KM |
11 | BuildRequires: python3-psutil |
12 | BuildRequires: python3-setuptools | |
8476178f | 13 | BuildRequires: rpm-pythonprov |
209fd55a ER |
14 | BuildRequires: sed >= 4.0 |
15 | BuildRequires: sphinx-pdg | |
209fd55a | 16 | Requires: fontconfig |
c9d938ed KM |
17 | Requires: python3 |
18 | Requires: python3-psutil | |
209fd55a ER |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
20 | ||
21 | %description | |
8476178f | 22 | Powerline is a status-line plugin for Vim, and provides status-lines |
209fd55a ER |
23 | and prompts for several other applications, including zsh, bash, tmux, |
24 | IPython, Awesome and Qtile. | |
25 | ||
26 | %package docs | |
27 | Summary: Powerline Documentation | |
28 | Group: Documentation | |
209fd55a | 29 | BuildArch: noarch |
209fd55a ER |
30 | |
31 | %description docs | |
32 | This package provides the powerline documentation. | |
33 | ||
34 | %package -n vim-plugin-powerline | |
35 | Summary: Powerline VIM plugin | |
36 | Group: Applications/Editors/Vim | |
37 | Requires: %{name} = %{version}-%{release} | |
38 | Requires: vim | |
209fd55a | 39 | BuildArch: noarch |
209fd55a ER |
40 | |
41 | %description -n vim-plugin-powerline | |
42 | Powerline is a status-line plugin for vim, and provides status-lines | |
43 | and prompts. | |
44 | ||
45 | %package -n tmux-powerline | |
46 | Summary: Powerline for tmux | |
47 | Group: Applications/System | |
48 | Requires: %{name} = %{version}-%{release} | |
49 | Requires: tmux | |
209fd55a | 50 | BuildArch: noarch |
209fd55a ER |
51 | |
52 | %description -n tmux-powerline | |
53 | Powerline for tmux. | |
54 | ||
55 | Add to your ~/.tmux.conf file: "source /usr/share/tmux/powerline.conf" | |
56 | ||
c9d938ed KM |
57 | %post |
58 | %systemd_post powerline.service | |
59 | ||
60 | %preun | |
61 | %systemd_preun powerline.service | |
62 | ||
63 | %postun | |
64 | %systemd_reload | |
65 | ||
209fd55a ER |
66 | %prep |
67 | %setup -q | |
68 | ||
69 | sed -i -e "/DEFAULT_SYSTEM_CONFIG_DIR/ s@None@'%{_sysconfdir}/xdg'@" powerline/config.py | |
70 | sed -i -e "/TMUX_CONFIG_DIRECTORY/ s@BINDINGS_DIRECTORY@'/usr/share'@" powerline/config.py | |
71 | ||
c9d938ed KM |
72 | # Change shebang in all relevant files in this directory and all subdirectories |
73 | find -type f -exec sed -i '1s=^#!%{_bindir}/\(python\|env python\)[23]\?=#!%{__python3}=' {} + | |
74 | ||
209fd55a | 75 | %build |
c9d938ed | 76 | %py3_build |
209fd55a ER |
77 | |
78 | # build docs | |
79 | cd docs | |
01080a66 ER |
80 | %{__make} html \ |
81 | SPHINXBUILD=%{_bindir}/sphinx-build | |
209fd55a ER |
82 | rm _build/html/.buildinfo |
83 | # A structure gets initialized while building the docs with os.environ. | |
84 | # This works around an rpmlint error with the build dir being in a file. | |
85 | sed -i -e 's/abuild/user/g' _build/html/develop/extensions.html | |
86 | ||
01080a66 ER |
87 | %{__make} man \ |
88 | SPHINXBUILD=%{_bindir}/sphinx-build | |
89 | ||
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
c9d938ed | 92 | %py3_install |
209fd55a ER |
93 | |
94 | # config | |
95 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/xdg/%{name} | |
96 | cp -a powerline/config_files/* $RPM_BUILD_ROOT%{_sysconfdir}/xdg/%{name}/ | |
97 | ||
98 | # fonts | |
99 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d | |
100 | install -d $RPM_BUILD_ROOT%{_datadir}/fonts/truetype | |
101 | install -d $RPM_BUILD_ROOT%{_datadir}/fontconfig/conf.avail | |
102 | ||
103 | cp -p font/PowerlineSymbols.otf $RPM_BUILD_ROOT%{_datadir}/fonts/truetype/PowerlineSymbols.otf | |
104 | cp -p font/10-powerline-symbols.conf $RPM_BUILD_ROOT%{_datadir}/fontconfig/conf.avail/10-powerline-symbols.conf | |
105 | ||
106 | ln -s %{_datadir}/fontconfig/conf.avail/10-powerline-symbols.conf $RPM_BUILD_ROOT%{_sysconfdir}/fonts/conf.d/10-powerline-symbols.conf | |
107 | ||
108 | # manpages | |
109 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
110 | for f in powerline-config.1 powerline-daemon.1 powerline-lint.1 powerline.1; do | |
111 | cp -p docs/_build/man/$f $RPM_BUILD_ROOT%{_mandir}/man1/$f | |
112 | done | |
113 | ||
114 | # awesome | |
115 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/awesome/ | |
c9d938ed KM |
116 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/awesome/powerline.lua $RPM_BUILD_ROOT%{_datadir}/%{name}/awesome/ |
117 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/awesome/powerline-awesome.py $RPM_BUILD_ROOT%{_datadir}/%{name}/awesome/ | |
209fd55a ER |
118 | |
119 | # bash bindings | |
120 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/bash | |
c9d938ed | 121 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/bash/powerline.sh $RPM_BUILD_ROOT%{_datadir}/%{name}/bash/ |
209fd55a ER |
122 | |
123 | # fish | |
124 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/fish | |
c9d938ed | 125 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/fish/powerline-setup.fish $RPM_BUILD_ROOT%{_datadir}/%{name}/fish |
209fd55a ER |
126 | |
127 | # i3 | |
128 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/i3 | |
c9d938ed | 129 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/i3/powerline-i3.py $RPM_BUILD_ROOT%{_datadir}/%{name}/i3 |
209fd55a ER |
130 | |
131 | # ipython | |
132 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/ipython | |
c9d938ed KM |
133 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/ipython/post_0_11.py $RPM_BUILD_ROOT%{_datadir}/%{name}/ipython |
134 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/ipython/pre_0_11.py $RPM_BUILD_ROOT%{_datadir}/%{name}/ipython | |
209fd55a ER |
135 | |
136 | # qtile | |
137 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/qtile | |
c9d938ed | 138 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/qtile/widget.py $RPM_BUILD_ROOT%{_datadir}/%{name}/qtile |
209fd55a ER |
139 | |
140 | # shell bindings | |
141 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/shell | |
c9d938ed | 142 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/shell/powerline.sh $RPM_BUILD_ROOT%{_datadir}/%{name}/shell/ |
209fd55a ER |
143 | |
144 | # tcsh | |
145 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/tcsh | |
c9d938ed | 146 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/tcsh/powerline.tcsh $RPM_BUILD_ROOT%{_datadir}/%{name}/tcsh |
209fd55a ER |
147 | |
148 | # tmux plugin | |
149 | install -d $RPM_BUILD_ROOT%{_datadir}/tmux | |
c9d938ed | 150 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/tmux/powerline*.conf $RPM_BUILD_ROOT%{_datadir}/tmux/ |
209fd55a ER |
151 | |
152 | # vim plugin | |
153 | install -d $RPM_BUILD_ROOT%{_datadir}/vim/site/plugin/ | |
c9d938ed KM |
154 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/vim/plugin/powerline.vim $RPM_BUILD_ROOT%{_datadir}/vim/site/plugin/powerline.vim |
155 | rm -rf $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/vim/plugin | |
209fd55a | 156 | install -d $RPM_BUILD_ROOT%{_datadir}/vim/site/autoload/powerline |
c9d938ed KM |
157 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/vim/autoload/powerline/debug.vim $RPM_BUILD_ROOT%{_datadir}/vim/site/autoload/powerline/debug.vim |
158 | rm -rf $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/vim/autoload | |
209fd55a ER |
159 | |
160 | # zsh | |
161 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/zsh | |
c9d938ed KM |
162 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/zsh/__init__.py $RPM_BUILD_ROOT%{_datadir}/%{name}/zsh |
163 | mv $RPM_BUILD_ROOT%{py3_sitescriptdir}/powerline/bindings/zsh/powerline.zsh $RPM_BUILD_ROOT%{_datadir}/%{name}/zsh | |
164 | ||
165 | # systemd | |
166 | #rm -f $RPM_BUILD_ROOT%{powerline_python_sitelib}/powerline/dist/systemd/powerline-daemon.service | |
167 | install -d $RPM_BUILD_ROOT%{systemdunitdir} | |
168 | cp -p powerline/dist/systemd/powerline-daemon.service $RPM_BUILD_ROOT%{systemdunitdir}/powerline.service | |
169 | install -d $RPM_BUILD_ROOT%{_sbindir} | |
170 | ln -s %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcpowerline | |
209fd55a ER |
171 | |
172 | # cleanup | |
c9d938ed | 173 | rm -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{name}/config_files |
cc71e7fc | 174 | find $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{name}/bindings -name "*.py[a-z]" -delete |
209fd55a ER |
175 | |
176 | %clean | |
177 | rm -rf $RPM_BUILD_ROOT | |
178 | ||
179 | %files | |
180 | %defattr(644,root,root,755) | |
181 | %doc LICENSE README.rst | |
182 | %{_sysconfdir}/fonts/conf.d/10-powerline-symbols.conf | |
183 | %config(noreplace) %{_sysconfdir}/xdg/%{name} | |
c9d938ed KM |
184 | %{systemdunitdir}/powerline.service |
185 | %attr(755,root,root) %{_sbindir}/rcpowerline | |
209fd55a ER |
186 | %attr(755,root,root) %{_bindir}/powerline |
187 | %attr(755,root,root) %{_bindir}/powerline-config | |
188 | %attr(755,root,root) %{_bindir}/powerline-daemon | |
189 | %attr(755,root,root) %{_bindir}/powerline-render | |
190 | %attr(755,root,root) %{_bindir}/powerline-lint | |
191 | %{_datadir}/fontconfig/conf.avail/10-powerline-symbols.conf | |
192 | %dir %{_datadir}/fonts/truetype | |
193 | %{_datadir}/fonts/truetype/PowerlineSymbols.otf | |
194 | %{_mandir}/man1/powerline.1* | |
195 | %{_mandir}/man1/powerline-config.1* | |
196 | %{_mandir}/man1/powerline-daemon.1* | |
197 | %{_mandir}/man1/powerline-lint.1* | |
198 | %dir %{_datadir}/%{name} | |
199 | %dir %{_datadir}/%{name}/awesome | |
200 | %{_datadir}/%{name}/awesome/powerline.lua | |
201 | %{_datadir}/%{name}/awesome/powerline-awesome.py* | |
202 | %dir %{_datadir}/%{name}/bash | |
203 | %{_datadir}/%{name}/bash/powerline.sh | |
204 | %dir %{_datadir}/%{name}/fish | |
205 | %{_datadir}/%{name}/fish/powerline-setup.fish | |
206 | %dir %{_datadir}/%{name}/i3 | |
207 | %{_datadir}/%{name}/i3/powerline-i3.py* | |
208 | %dir %{_datadir}/%{name}/ipython | |
209 | %{_datadir}/%{name}/ipython/post_0_11.py* | |
210 | %{_datadir}/%{name}/ipython/pre_0_11.py* | |
211 | %dir %{_datadir}/%{name}/qtile | |
212 | %{_datadir}/%{name}/qtile/widget.py* | |
213 | %dir %{_datadir}/%{name}/shell | |
214 | %{_datadir}/%{name}/shell/powerline.sh | |
215 | %dir %{_datadir}/%{name}/tcsh | |
216 | %{_datadir}/%{name}/tcsh/powerline.tcsh | |
217 | %dir %{_datadir}/%{name}/zsh | |
218 | %{_datadir}/%{name}/zsh/__init__.py* | |
219 | %{_datadir}/%{name}/zsh/powerline.zsh | |
c9d938ed | 220 | %{py3_sitescriptdir}/* |
209fd55a ER |
221 | |
222 | %files docs | |
223 | %defattr(644,root,root,755) | |
224 | %doc docs/_build/html/* | |
225 | ||
226 | %files -n vim-plugin-powerline | |
227 | %defattr(644,root,root,755) | |
228 | %dir %{_datadir}/vim/site | |
229 | %dir %{_datadir}/vim/site/autoload | |
230 | %dir %{_datadir}/vim/site/autoload/powerline | |
231 | %{_datadir}/vim/site/autoload/powerline/debug.vim | |
232 | %dir %{_datadir}/vim/site/plugin | |
233 | %{_datadir}/vim/site/plugin/powerline.vim | |
234 | ||
235 | %files -n tmux-powerline | |
236 | %defattr(644,root,root,755) | |
237 | %dir %{_datadir}/tmux | |
238 | %{_datadir}/tmux/powerline*.conf |