-
Notifications
You must be signed in to change notification settings - Fork 0
/
weechat.spec
374 lines (314 loc) · 10.3 KB
/
weechat.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# TODO:
# - consider doing subpackages for all those plugins (which one should be in main package ?)
# - desktop file (icon exists, but no desktop file?)
#
# Conditional build:
# Features
%bcond_without aspell # don't build aspell support
%bcond_without doc # don't build docs
# Bindings
%bcond_without guile # don't enable Scheme (guile) scripting language
%bcond_without lua # don't enable Lua scripting language
%bcond_without perl # don't enable Perl scripting language
%bcond_with php # don't enable PHP scripting language
%bcond_without python # don't enable Python scripting language
%bcond_without ruby # don't enable Ruby scripting language
%bcond_without tcl # don't enable Tcl scripting language
%bcond_without js # don't enable JavaScript scripting language (V8 engine)
%ifnarch %{ix86} %{x8664} arm mips
%undefine with_js
%endif
%define php_name php%{?php_suffix}
Summary: WeeChat - fast and light chat environment
Summary(pl.UTF-8): WeeChat - szybkie i lekkie środowisko do rozmów
Name: weechat
Version: 4.4.4
Release: 1
License: GPL v3+
Group: Applications/Communications
Source0: https://www.weechat.org/files/src/%{name}-%{version}.tar.xz
# Source0-md5: 0a474ffdb338b5ab1fa1f1dcc59fff8d
URL: http://www.weechat.org/
%{?with_aspell:BuildRequires: aspell-devel}
BuildRequires: cjson-devel
BuildRequires: cmake >= 3.18
BuildRequires: curl-devel
BuildRequires: gettext-tools
BuildRequires: gnutls-devel
%{?with_guile:BuildRequires: guile-devel}
BuildRequires: libgcrypt-devel
%{?with_lua:BuildRequires: lua-devel}
BuildRequires: ncurses-devel
%{?with_perl:BuildRequires: perl-devel}
%{?with_php:BuildRequires: %{php_name}-devel >= 4:7}
BuildRequires: pkgconfig
%if %{with python}
BuildRequires: python3-devel
BuildRequires: python3-modules
%endif
BuildRequires: rpm-build >= 4.6
BuildRequires: rpmbuild(macros) >= 1.752
%{?with_doc:BuildRequires: ruby-asciidoctor}
%{?with_ruby:BuildRequires: ruby-devel >= 1:1.9}
BuildRequires: sed >= 4.0
BuildRequires: tar >= 1:1.22
%{?with_tcl:BuildRequires: tcl-devel}
%{?with_js:BuildRequires: v8-devel}
BuildRequires: xz
BuildRequires: zlib-devel
BuildRequires: zstd-devel
Requires(post,postun): desktop-file-utils
Suggests: %{name}-icons
Suggests: %{name}-plugin-irc
Obsoletes: weechat-common < 1.2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define skip_post_check_so ruby.so.0.0.0
%description
WeeChat (Wee Enhanced Environment for Chat) is a fast and light chat
environment for many operating systems. Everything can be done with a
keyboard. It is customizable and extensible with scripts.
%description -l pl.UTF-8
WeeChat (Wee Ehanced Environment for Chat) to szybkie i lekkie
środowisko do rozmów dla wielu systemów operacyjnych. Pozwala wszystko
zrobić przy pomocy klawiatury. Jest konfigurowalne i rozszerzalne za
pomocą skryptów.
%package doc
Summary: Manual for weechat
Group: Documentation
BuildArch: noarch
%description doc
HTML documentation for weechat.
%package icons
Summary: Icon files for weechat
Group: Applications
BuildArch: noarch
Requires(post,postun): gtk-update-icon-cache
%description icons
Icon files for weechat.
%package plugin-guile
Summary: Guile scripting plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-guile
Guile scripting plugin for weechat.
%package plugin-irc
Summary: IRC chat protocol plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-irc
IRC chat protocol plugin for weechat.
%package plugin-javascript
Summary: JavaScript scripting plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-javascript
JavaScript scripting plugin for weechat.
%package plugin-lua
Summary: Lua scripting plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-lua
Lua scripting plugin for weechat.
%package plugin-perl
Summary: Perl scripting plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-perl
Perl scripting plugin for weechat.
%package plugin-python
Summary: Python scripting plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-python
Python scripting plugin for weechat.
%package plugin-relay
Summary: Relay data via network plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-relay
Relay data via network plugin for weechat used by alternative
frontends.
%package plugin-ruby
Summary: Ruby scripting plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-ruby
Ruby scripting plugin for weechat.
%package plugin-spell
Summary: Spell checking plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-spell
Spell checking plugin for weechat.
%package plugin-tcl
Summary: Tcl scripting plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-tcl
Tcl scripting plugin for weechat.
%package plugin-xfer
Summary: File transfer and direct chat plugin for weechat
Group: Applications/Communications
Requires: %{name} = %{version}-%{release}
%description plugin-xfer
File transfer and direct chat plugin for weechat.
%prep
%setup -q
%build
install -d build
cd build
%cmake \
-DPREFIX=%{_prefix} \
-DLIBDIR=%{_libdir} \
-DENABLE_HEADLESS=ON \
-DENABLE_DOC_INCOMPLETE=ON \
-DENABLE_NCURSES=ON \
%{cmake_on_off aspell ENABLE_SPELL} \
%{cmake_on_off doc ENABLE_DOC} \
%{cmake_on_off perl ENABLE_PERL} \
%{cmake_on_off php ENABLE_PHP} \
%{cmake_on_off python ENABLE_PYTHON} \
%{cmake_on_off ruby ENABLE_RUBY} \
%{cmake_on_off lua ENABLE_LUA} \
%{cmake_on_off guile ENABLE_GUILE} \
%{cmake_on_off tcl ENABLE_TCL} \
%{cmake_on_off doc ENABLE_MAN} \
%{cmake_on_off js ENABLE_JAVASCRIPT} \
..
%{__make} VERBOSE=1
%install
rm -rf $RPM_BUILD_ROOT
%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_datadir}/weechat/{guile,javascript,lua,perl,python,ruby,tcl}
# symlink to "weechat"
%{__rm} $RPM_BUILD_ROOT%{_bindir}/weechat-curses
# no -devel, drop
%{__rm} -r $RPM_BUILD_ROOT%{_includedir}/%{name}
%{__rm} $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
%find_lang %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post
%update_desktop_database
%update_mime_database
%post icons
%update_icon_cache hicolor
%postun
%update_desktop_database_postun
%update_mime_database
%postun icons
%update_icon_cache hicolor
%files -f %{name}.lang
%defattr(644,root,root,755)
%doc AUTHORS.md CHANGELOG.md README.md UPGRADING.md
%attr(755,root,root) %{_bindir}/weechat
%attr(755,root,root) %{_bindir}/weechat-headless
%dir %{_datadir}/weechat
%if %{with doc}
%{_mandir}/man1/weechat.1*
%{_mandir}/man1/weechat-headless.1*
%lang(cs) %{_mandir}/cs/man1/weechat.1*
%lang(cs) %{_mandir}/cs/man1/weechat-headless.1*
%lang(de) %{_mandir}/de/man1/weechat.1*
%lang(de) %{_mandir}/de/man1/weechat-headless.1*
%lang(fr) %{_mandir}/fr/man1/weechat.1*
%lang(fr) %{_mandir}/fr/man1/weechat-headless.1*
%lang(it) %{_mandir}/it/man1/weechat.1*
%lang(it) %{_mandir}/it/man1/weechat-headless.1*
%lang(ja) %{_mandir}/ja/man1/weechat.1*
%lang(ja) %{_mandir}/ja/man1/weechat-headless.1*
%lang(pl) %{_mandir}/pl/man1/weechat.1*
%lang(pl) %{_mandir}/pl/man1/weechat-headless.1*
%lang(ru) %{_mandir}/ru/man1/weechat.1*
%lang(ru) %{_mandir}/ru/man1/weechat-headless.1*
%lang(sr) %{_mandir}/sr/man1/weechat.1*
%lang(sr) %{_mandir}/sr/man1/weechat-headless.1*
%endif
%{_desktopdir}/%{name}.desktop
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/plugins
%attr(755,root,root) %{_libdir}/%{name}/plugins/alias.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/buflist.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/charset.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/exec.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/fifo.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/fset.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/logger.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/script.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/trigger.so
%attr(755,root,root) %{_libdir}/%{name}/plugins/typing.so
%files icons
%defattr(644,root,root,755)
%{_iconsdir}/hicolor/*/apps/weechat.png
%if %{with doc}
%files doc
%defattr(644,root,root,755)
%dir %{_docdir}/%{name}
%lang(cs) %{_docdir}/%{name}/*.cs.html
%lang(de) %{_docdir}/%{name}/*.de.html
%lang(en) %{_docdir}/%{name}/*.en.html
%lang(es) %{_docdir}/%{name}/*.es.html
%lang(fr) %{_docdir}/%{name}/*.fr.html
%lang(it) %{_docdir}/%{name}/*.it.html
%lang(ja) %{_docdir}/%{name}/*.ja.html
%lang(pl) %{_docdir}/%{name}/*.pl.html
%lang(ru) %{_docdir}/%{name}/*.ru.html
%lang(sr) %{_docdir}/%{name}/*.sr.html
%endif
%if %{with guile}
%files plugin-guile
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/guile.so
%dir %{_datadir}/weechat/guile
%endif
%files plugin-irc
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/irc.so
%if %{with js}
%files plugin-javascript
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/javascript.so
%dir %{_datadir}/weechat/javascript
%endif
%if %{with lua}
%files plugin-lua
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/lua.so
%dir %{_datadir}/weechat/lua
%endif
%if %{with perl}
%files plugin-perl
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/perl.so
%dir %{_datadir}/weechat/perl
%endif
%if %{with python}
%files plugin-python
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/python.so
%dir %{_datadir}/weechat/python
%endif
%files plugin-relay
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/relay.so
%if %{with ruby}
%files plugin-ruby
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/ruby.so
%dir %{_datadir}/weechat/ruby
%endif
%if %{with aspell}
%files plugin-spell
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/spell.so
%endif
%if %{with tcl}
%files plugin-tcl
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/tcl.so
%dir %{_datadir}/weechat/tcl
%endif
%files plugin-xfer
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/%{name}/plugins/xfer.so