]> git.pld-linux.org Git - packages/wesnoth.git/blob - wesnoth.spec
- fixing uninstall warnings
[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 %bcond_without  fribidi # without Bidirectional language support
8
9 Summary:        Strategy game with a fantasy theme
10 Summary(hu.UTF-8):      Fantasy környezetben játszódó stratégiai játék
11 Summary(pl.UTF-8):      Gra strategiczna z motywem fantasy
12 Name:           wesnoth
13 Version:        1.14.15
14 Release:        1
15 Epoch:          1
16 License:        GPL v2+
17 Group:          X11/Applications/Games/Strategy
18 Source0:        http://downloads.sourceforge.net/wesnoth/%{name}-%{version}.tar.bz2
19 # Source0-md5:  f3149cf74ae55c490739494c45179fa7
20 Source1:        %{name}d.init
21 Source2:        %{name}.tmpfiles
22 Source3:        %{name}.sysconfig
23 Source4:        %{name}d.service
24 URL:            http://www.wesnoth.org/
25 BuildRequires:  SDL2-devel >= 2.0.4
26 BuildRequires:  SDL2_image-devel >= 2.0.0
27 BuildRequires:  SDL2_mixer-devel >= 2.0.0
28 BuildRequires:  SDL2_ttf-devel >= 2.0.12
29 BuildRequires:  boost-devel >= 1.50.0
30 BuildRequires:  bzip2-devel
31 BuildRequires:  cairo-devel >= 1.10.0
32 BuildRequires:  cmake >= 2.8.5
33 BuildRequires:  dbus-devel
34 BuildRequires:  fontconfig-devel >= 2.4.1
35 %{?with_fribidi:BuildRequires:  fribidi-devel}
36 BuildRequires:  gettext-tools
37 BuildRequires:  libicu-devel
38 BuildRequires:  libpng-devel
39 BuildRequires:  libstdc++-devel
40 BuildRequires:  libvorbis-devel
41 BuildRequires:  openssl-devel
42 BuildRequires:  pango-devel >= 1:1.22.0
43 BuildRequires:  pkgconfig
44 BuildRequires:  rpm-pythonprov
45 BuildRequires:  rpmbuild(macros) >= 1.605
46 BuildRequires:  sed >= 4.0
47 BuildRequires:  systemd-devel
48 BuildRequires:  xorg-lib-libICE-devel
49 BuildRequires:  xorg-lib-libSM-devel
50 BuildRequires:  xorg-lib-libX11-devel
51 BuildRequires:  xorg-lib-libXext-devel
52 BuildRequires:  zlib-devel
53 Requires(post,postun):  desktop-file-utils
54 Requires(post,postun):  gtk-update-icon-cache
55 Requires:       %{name}-data = %{epoch}:%{version}
56 Requires:       SDL2 >= 2.0.4
57 Requires:       fontconfig >= 2.4.1
58 Requires:       pango >= 1:1.22.8
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 %if "%{_rpmversion}" >= "4.6"
111 BuildArch:      noarch
112 %endif
113
114 %description data
115 This package contains the data files for Wesnoth.
116
117 %description data -l pl.UTF-8
118 Ten pakiet zawiera pliki danych dla gry Wesnoth.
119
120 %prep
121 %setup -q
122
123 # don't install locales in %{_datadir}/%{name}
124 %{__sed} -i 's,${DATADIR}/${LOCALEDIR},${LOCALEDIR},' CMakeLists.txt
125
126 %{__sed} -i '1s,/usr/bin/env python3$,%{__python3},' \
127         data/tools/{GUI.pyw,about_cfg_to_wiki,addon_manager/__init__.py,addon_manager/html.py,campaign2wiki.py,extractbindings,hexometer.py,imgcheck,steam-changelog,terrain2wiki.py,unit_tree/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/wescamp.py,wesnoth/wmliterator3.py,wesnoth/wmlparser3.py,wesnoth/wmltools3.py,wesnoth_addon_manager,wmlindent,wmllint,wmllint-1.4,wmlscope,wmlunits,wmlxgettext}
128 %{__sed} -i '1s,/usr/bin/env python2$,%{__python},' \
129         data/tools/{expand-terrain-macros.py,journeylifter,rmtrans/rmtrans.py,scoutDefault.py,trackplacer,wesnoth/wmldata.py,wesnoth/wmlgrammar.py,wesnoth/wmliterator.py,wesnoth/wmlparser.py,wesnoth/wmlparser2.py,wesnoth/wmltools.py,wmlflip,wmlvalidator}
130
131 %build
132 install -d build
133 cd build
134 %cmake \
135         .. \
136         -DCMAKE_BUILD_TYPE="Release" \
137         -DENABLE_STRICT_COMPILATION="off" \
138         -DBINDIR="%{_bindir}" \
139         -DMANDIR="%{_mandir}" \
140         -DLOCALEDIR="%{_localedir}" \
141         %{!?with_server:-DENABLE_SERVER="off"} \
142         %{?with_server:-DENABLE_CAMPAIGN_SERVER="on"} \
143         %{!?with_fribidi:-DENABLE_FRIBIDI="off"}
144
145 %{__make}
146
147 %install
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},/var/run/wesnothd,/etc/rc.d/init.d,/etc/sysconfig} \
150         $RPM_BUILD_ROOT{%{systemdtmpfilesdir},%{_docdir}/%{name}-%{version}} \
151         $RPM_BUILD_ROOT%{systemdunitdir}
152
153 %{__make} -C build install \
154         DESTDIR=$RPM_BUILD_ROOT
155
156 %if %{with server}
157 cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/wesnothd
158 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
159 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wesnoth
160 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/wesnothd.service
161 %endif
162
163 %{__mv} $RPM_BUILD_ROOT%{_docdir}/html $RPM_BUILD_ROOT%{_docdir}/%{name}
164
165 # unify
166 %{__mv} $RPM_BUILD_ROOT%{_localedir}/{ca_ES@valencia,ca@valencia}
167 %{__mv} $RPM_BUILD_ROOT%{_localedir}/{nb_NO,nb}
168 %{__mv} $RPM_BUILD_ROOT%{_localedir}/{fur_IT,fur}
169 %{__mv} $RPM_BUILD_ROOT%{_mandir}/{ca_ES@valencia,ca@valencia}
170
171 # unsupported(?)
172 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ang@latin
173 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/racv
174 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/sr@ijekavian
175 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/sr@ijekavianlatin
176
177 # the same as manuals from %{_mandir}/man?
178 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/en_GB
179
180 %find_lang %{name} --all-name
181
182 %clean
183 rm -rf $RPM_BUILD_ROOT
184
185 %post
186 %update_desktop_database
187 %update_icon_cache hicolor
188
189 %postun
190 %update_desktop_database
191 %update_icon_cache hicolor
192
193 %pre server
194 %groupadd -P %{name}-server -g 178  wesnothd
195 %useradd -P %{name}-server -u 178 -d /var/run/wesnothd -c "Wesnothd User" -g wesnothd wesnothd
196
197 %post server
198 /sbin/chkconfig --add wesnothd
199 %service wesnothd restart
200 %systemd_post wesnothd.service
201
202 %preun server
203 if [ "$1" = "0" ]; then
204         %service wesnothd stop
205         /sbin/chkconfig --del wesnothd
206 fi
207 %systemd_preun wesnothd.service
208
209 %postun server
210 if [ "$1" = "0" ]; then
211         %userremove wesnothd
212         %groupremove wesnothd
213 fi
214 %systemd_reload
215
216 %files -f %{name}.lang
217 %defattr(644,root,root,755)
218 #%doc README changelog
219 %doc %{_docdir}/%{name}
220 %attr(755,root,root) %{_bindir}/wesnoth
221 %{_mandir}/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(hu) %{_mandir}/hu/man6/wesnoth.6*
226 %lang(it) %{_mandir}/it/man6/wesnoth.6*
227 %lang(ja) %{_mandir}/ja/man6/wesnoth.6*
228 %lang(lt) %{_mandir}/lt/man6/wesnoth.6*
229 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnoth.6*
230 %lang(ru) %{_mandir}/ru/man6/wesnoth.6*
231 %lang(tr) %{_mandir}/tr/man6/wesnoth.6*
232 %lang(zh_CN) %{_mandir}/zh_CN/man6/wesnoth.6*
233 %lang(zh_TW) %{_mandir}/zh_TW/man6/wesnoth.6*
234 %{_desktopdir}/wesnoth.desktop
235 %{_iconsdir}/hicolor/*x*/apps/wesnoth-icon.png
236 %{_datadir}/metainfo/wesnoth.appdata.xml
237
238 %if %{with server}
239 %files server
240 %defattr(644,root,root,755)
241 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
242 %attr(755,root,root) %{_bindir}/campaignd
243 %attr(755,root,root) %{_bindir}/wesnothd
244 %attr(754,root,root) /etc/rc.d/init.d/wesnothd
245 %attr(644,root,root) %{systemdunitdir}/wesnothd.service
246 %{_mandir}/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(et) %{_mandir}/et/man6/wesnothd.6*
251 %lang(fi) %{_mandir}/fi/man6/wesnothd.6*
252 %lang(fr) %{_mandir}/fr/man6/wesnothd.6*
253 %lang(gl) %{_mandir}/gl/man6/wesnothd.6*
254 %lang(hu) %{_mandir}/hu/man6/wesnothd.6*
255 %lang(id) %{_mandir}/id/man6/wesnothd.6*
256 %lang(it) %{_mandir}/it/man6/wesnothd.6*
257 %lang(ja) %{_mandir}/ja/man6/wesnothd.6*
258 %lang(lt) %{_mandir}/lt/man6/wesnothd.6*
259 %lang(pl) %{_mandir}/pl/man6/wesnothd.6*
260 %lang(pt) %{_mandir}/pt/man6/wesnothd.6*
261 %lang(pt_BR) %{_mandir}/pt_BR/man6/wesnothd.6*
262 %lang(ru) %{_mandir}/ru/man6/wesnothd.6*
263 %lang(sk) %{_mandir}/sk/man6/wesnothd.6*
264 %lang(sr) %{_mandir}/sr/man6/wesnothd.6*
265 %lang(sr@latin) %{_mandir}/sr@latin/man6/wesnothd.6*
266 %lang(tr) %{_mandir}/tr/man6/wesnothd.6*
267 %lang(uk) %{_mandir}/uk/man6/wesnothd.6*
268 %lang(vi) %{_mandir}/vi/man6/wesnothd.6*
269 %lang(zh_CN) %{_mandir}/zh_CN/man6/wesnothd.6*
270 %lang(zh_TW) %{_mandir}/zh_TW/man6/wesnothd.6*
271 %attr(770,wesnothd,wesnothd) %dir /var/run/wesnothd
272 %{systemdtmpfilesdir}/%{name}.conf
273 %endif
274
275 %files data
276 %defattr(644,root,root,755)
277 %{_datadir}/%{name}
This page took 0.134218 seconds and 4 git commands to generate.