]> git.pld-linux.org Git - packages/wesnoth.git/blob - wesnoth.spec
- up to 1.18.0
[packages/wesnoth.git] / wesnoth.spec
1 # TODO
2 # - system lua?
3 # - unpackaged language files
4 #
5 # Conditional build
6 %bcond_without  server  # without server
7
8 Summary:        Strategy game with a fantasy theme
9 Summary(hu.UTF-8):      Fantasy környezetben játszódó stratégiai játék
10 Summary(pl.UTF-8):      Gra strategiczna z motywem fantasy
11 Name:           wesnoth
12 Version:        1.18.0
13 Release:        1
14 Epoch:          1
15 License:        GPL v2+
16 Group:          X11/Applications/Games/Strategy
17 Source0:        http://downloads.sourceforge.net/wesnoth/%{name}-%{version}.tar.bz2
18 # Source0-md5:  b475028bebe0168f46d5a452c4bc1c05
19 Source1:        %{name}d.init
20 Source2:        %{name}.tmpfiles
21 Source3:        %{name}.sysconfig
22 Source4:        %{name}d.service
23 URL:            http://www.wesnoth.org/
24 BuildRequires:  SDL2-devel >= 2.0.10
25 BuildRequires:  SDL2_image-devel >= 2.0.2
26 BuildRequires:  SDL2_mixer-devel >= 2.0.0
27 BuildRequires:  boost-devel >= 1.66.0
28 BuildRequires:  bzip2-devel
29 BuildRequires:  cairo-devel >= 1.10.0
30 BuildRequires:  cmake >= 3.7
31 BuildRequires:  dbus-devel
32 BuildRequires:  fontconfig-devel >= 2.4.1
33 BuildRequires:  gettext-tools
34 BuildRequires:  libicu-devel
35 BuildRequires:  libpng-devel
36 BuildRequires:  libstdc++-devel >= 6:4.7
37 BuildRequires:  libvorbis-devel
38 BuildRequires:  openssl-devel >= 1.0
39 BuildRequires:  pango-devel >= 1:1.44.0
40 BuildRequires:  pkgconfig
41 BuildRequires:  readline-devel
42 BuildRequires:  rpm-build >= 4.6
43 BuildRequires:  rpm-pythonprov
44 BuildRequires:  rpmbuild(macros) >= 1.605
45 BuildRequires:  sed >= 4.0
46 BuildRequires:  systemd-devel
47 BuildRequires:  xorg-lib-libICE-devel
48 BuildRequires:  xorg-lib-libSM-devel
49 BuildRequires:  xorg-lib-libX11-devel
50 BuildRequires:  xorg-lib-libXext-devel
51 BuildRequires:  zlib-devel
52 Requires(post,postun):  desktop-file-utils
53 Requires(post,postun):  gtk-update-icon-cache
54 Requires:       %{name}-data = %{epoch}:%{version}
55 Requires:       SDL2 >= 2.0.4
56 Requires:       fontconfig >= 2.4.1
57 Requires:       pango >= 1:1.22.8
58 Obsoletes:      wesnoth-tools < 1:1.14
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %description
62 Battle for Wesnoth is a fantasy strategy game. Battle for control of
63 villages, using variety of units which have advantages and
64 disadvantages in different types of terrains and against different
65 types of attacks. Units gain experience and advance levels, and are
66 carried over from one scenario to the next campaign.
67
68 %description -l hu.UTF-8
69 Battle for Wesnoth (Harc Wesnothért) egy fantasy környezetben játszódó
70 stratégiai játék. Harc a falvak megszerzéséért, különböző egységek
71 felhasználásával, amelyeknek különböző előnyeik és hátrányaik vannak a
72 különféle terepeken és a különböző támadási stílusok ellen. Az
73 egységek tapasztalatot gyűjtenek, és fejlődnek, amelyek átvihetők a
74 következő pályára.
75
76 %description -l pl.UTF-8
77 Bitwa o Wesnoth jest strategiczną grą fantasy. Batalia o kontrolę nad
78 wsiami przy pomocy różnego rodzaju oddziałów, które mają przewagę lub
79 jej brak w odmiennym ukształtowaniu terenu i przeciwko różnym sposobom
80 ataku. Oddziały zdobywają doświadczenie i poziomy zaawansowania i są
81 przenoszone z jednej scenerii do następnej kampanii.
82
83 %package server
84 Summary:        Network server for Wesnoth
85 Summary(hu.UTF-8):      Hálózati szerver Wesnoth-hoz
86 Summary(pl.UTF-8):      Sieciowy serwer dla Wesnoth
87 Group:          X11/Applications/Games/Strategy
88 Requires(post,preun):   /sbin/chkconfig
89 Requires(postun):       /usr/sbin/groupdel
90 Requires(postun):       /usr/sbin/userdel
91 Requires(pre):  /usr/sbin/groupadd
92 Requires(pre):  /usr/sbin/useradd
93 Requires:       rc-scripts >= 0.4.0.17
94 Provides:       group(wesnothd)
95 Provides:       user(wesnothd)
96
97 %description server
98 Server for playing networked games of Wesnoth.
99
100 %description server -l hu.UTF-8
101 Szerver a Wesnoth hálózati játékához.
102
103 %description server -l pl.UTF-8
104 Serwer do prowadzenia sieciowych gier Wesnoth.
105
106 %package data
107 Summary:        Strategy game with a fantasy theme - data files
108 Summary(pl.UTF-8):      Gra strategiczna z motywem fantasy - pliki danych
109 Group:          Applications/Games
110 BuildArch:      noarch
111
112 %description data
113 This package contains the data files for Wesnoth.
114
115 %description data -l pl.UTF-8
116 Ten pakiet zawiera pliki danych dla gry Wesnoth.
117
118 %prep
119 %setup -q
120
121 # don't install locales in %{_datadir}/%{name}
122 %{__sed} -i 's,${DATADIR}/${LOCALEDIR},${LOCALEDIR},' CMakeLists.txt
123
124 %{__sed} -i '1s,/usr/bin/env python3$,%{__python3},' \
125         data/tools/{GUI.pyw,about_cfg_to_wiki,addon_manager/__init__.py,addon_manager/html.py,check_mixed_indent,extractbindings,hexometer.py,imgcheck,steam-changelog,terrain2wiki.py,TeamColorizer,unit_tree/__init__.py,unit_tree/animations.py,unit_tree/helpers.py,unit_tree/html_output.py,unit_tree/overview.py,unit_tree/wiki_output.py,wesnoth/campaignserver_client.py,wesnoth/libgithub.py,wesnoth/version.py,wesnoth/wescamp.py,wesnoth/wmliterator3.py,wesnoth/wmlparser3.py,wesnoth/wmltools3.py,trackviewer.pyw,wesnoth_addon_manager,wmlflip,wmlindent,wmllint,wmllint-1.4,wmlscope,wmlunits,wmlxgettext,tmx_trackplacer,wesnoth/wmldata.py,wesnoth/trackplacer3/datatypes.py,wesnoth/wmlparser.py,expand-terrain-macros.py}
126
127 %build
128 install -d build
129 cd build
130 # override *FLAGS to remove -DNDEBUG (wesnoth depends on asserts)
131 CFLAGS="%{rpmcflags}"
132 CXXFLAGS="%{rpmcxxflags}"
133 %cmake .. \
134         -DENABLE_STRICT_COMPILATION=OFF \
135         -DBINDIR="%{_bindir}" \
136         -DMANDIR="%{_mandir}" \
137         -DLOCALEDIR="%{_localedir}" \
138         %{!?with_server:-DENABLE_SERVER=OFF} \
139         %{?with_server:-DENABLE_CAMPAIGN_SERVER=ON}
140
141 %{__make}
142
143 %install
144 rm -rf $RPM_BUILD_ROOT
145 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/var/run/wesnothd,/etc/rc.d/init.d,/etc/sysconfig} \
146         $RPM_BUILD_ROOT{%{systemdtmpfilesdir},%{_docdir}/%{name}-%{version}} \
147         $RPM_BUILD_ROOT%{systemdunitdir}
148
149 %{__make} -C build install \
150         DESTDIR=$RPM_BUILD_ROOT
151
152 %if %{with server}
153 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/wesnothd
154 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
155 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wesnoth
156 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/wesnothd.service
157 %endif
158
159 %{__mv} $RPM_BUILD_ROOT%{_docdir}/html $RPM_BUILD_ROOT%{_docdir}/%{name}
160
161 # unify
162 %{__mv} $RPM_BUILD_ROOT%{_localedir}/{ca_ES@valencia,ca@valencia}
163 %{__mv} $RPM_BUILD_ROOT%{_localedir}/{nb_NO,nb}
164 %{__mv} $RPM_BUILD_ROOT%{_mandir}/{ca_ES@valencia,ca@valencia}
165
166 # unsupported(?)
167 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/{ang@latin,grc,racv}
168 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/sr@ijekavian
169 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/sr@ijekavianlatin
170
171 # the same as manuals from %{_mandir}/man?
172 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/en_GB
173
174 # remove HighContrast icon
175 %{__rm} -r $RPM_BUILD_ROOT%{_iconsdir}/HighContrast/scalable/apps/wesnoth-icon.svg
176
177 %find_lang %{name} --all-name
178
179 %clean
180 rm -rf $RPM_BUILD_ROOT
181
182 %post
183 %update_desktop_database
184 %update_icon_cache hicolor
185
186 %postun
187 %update_desktop_database
188 %update_icon_cache hicolor
189
190 %pre server
191 %groupadd -P %{name}-server -g 178  wesnothd
192 %useradd -P %{name}-server -u 178 -d /var/run/wesnothd -c "Wesnothd User" -g wesnothd wesnothd
193
194 %post server
195 /sbin/chkconfig --add wesnothd
196 %service wesnothd restart
197 %systemd_post wesnothd.service
198
199 %preun server
200 if [ "$1" = "0" ]; then
201         %service wesnothd stop
202         /sbin/chkconfig --del wesnothd
203 fi
204 %systemd_preun wesnothd.service
205
206 %postun server
207 if [ "$1" = "0" ]; then
208         %userremove wesnothd
209         %groupremove wesnothd
210 fi
211 %systemd_reload
212
213 %files -f %{name}.lang
214 %defattr(644,root,root,755)
215 %doc README.md changelog.md
216 %doc %{_docdir}/%{name}
217 %attr(755,root,root) %{_bindir}/wesnoth
218 %{_mandir}/man6/wesnoth.6*
219 %lang(bg) %{_mandir}/bg/man6/wesnoth.6*
220 %lang(ca) %{_mandir}/ca/man6/wesnoth.6*
221 %lang(cs) %{_mandir}/cs/man6/wesnoth.6*
222 %lang(de) %{_mandir}/de/man6/wesnoth.6*
223 %lang(es) %{_mandir}/es/man6/wesnoth.6*
224 %lang(fr) %{_mandir}/fr/man6/wesnoth.6*
225 %lang(it) %{_mandir}/it/man6/wesnoth.6*
226 %lang(ja) %{_mandir}/ja/man6/wesnoth.6*
227 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnoth.6*
228 %lang(ru) %{_mandir}/ru/man6/wesnoth.6*
229 %lang(sk) %{_mandir}/sk/man6/wesnoth.6*
230 %lang(tr) %{_mandir}/tr/man6/wesnoth.6*
231 %lang(zh_CN) %{_mandir}/zh_CN/man6/wesnoth.6*
232 %lang(zh_TW) %{_mandir}/zh_TW/man6/wesnoth.6*
233 %{_desktopdir}/org.wesnoth.Wesnoth.desktop
234 %{_iconsdir}/hicolor/*x*/apps/wesnoth-icon.png
235 %{_datadir}/metainfo/org.wesnoth.Wesnoth.appdata.xml
236
237 %if %{with server}
238 %files server
239 %defattr(644,root,root,755)
240 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
241 %attr(755,root,root) %{_bindir}/campaignd
242 %attr(755,root,root) %{_bindir}/wesnothd
243 %attr(754,root,root) /etc/rc.d/init.d/wesnothd
244 %attr(644,root,root) %{systemdunitdir}/wesnothd.service
245 %{_mandir}/man6/wesnothd.6*
246 %lang(bg) %{_mandir}/bg/man6/wesnothd.6*
247 %lang(cs) %{_mandir}/cs/man6/wesnothd.6*
248 %lang(de) %{_mandir}/de/man6/wesnothd.6*
249 %lang(es) %{_mandir}/es/man6/wesnothd.6*
250 %lang(fr) %{_mandir}/fr/man6/wesnothd.6*
251 %lang(it) %{_mandir}/it/man6/wesnothd.6*
252 %lang(ja) %{_mandir}/ja/man6/wesnothd.6*
253 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnothd.6*
254 %lang(ru) %{_mandir}/ru/man6/wesnothd.6*
255 %lang(sk) %{_mandir}/sk/man6/wesnothd.6*
256 %lang(tr) %{_mandir}/tr/man6/wesnothd.6*
257 %lang(zh_CN) %{_mandir}/zh_CN/man6/wesnothd.6*
258 %lang(zh_TW) %{_mandir}/zh_TW/man6/wesnothd.6*
259 %attr(770,wesnothd,wesnothd) %dir /var/run/wesnothd
260 %{systemdtmpfilesdir}/%{name}.conf
261 %endif
262
263 %files data
264 %defattr(644,root,root,755)
265 %{_datadir}/%{name}
This page took 0.056588 seconds and 3 git commands to generate.