1 | %define pkgname wesnoth |
---|
2 | %define version 1.4.7 |
---|
3 | %define release 2%{?_dist_release} |
---|
4 | |
---|
5 | %define with_editor 0 |
---|
6 | %define with_tools 0 |
---|
7 | %define with_campaignd 0 |
---|
8 | %define with_wesnothd 0 |
---|
9 | |
---|
10 | %define datadir_name %{pkgname}147 |
---|
11 | |
---|
12 | Summary: Fantasy Turn-Based Strategy Game |
---|
13 | Summary(ja): ターンベースのファンタジー戦略シミュレーションゲーム |
---|
14 | Name: %{pkgname}147 |
---|
15 | Version: %{version} |
---|
16 | Release: %{release} |
---|
17 | Source0: %{pkgname}-%{version}.tar.bz2 |
---|
18 | Source1: wesnothd.init |
---|
19 | Source2: %{pkgname}.sysconfig |
---|
20 | Patch0: %{pkgname}-1.2.8-gcc43.patch |
---|
21 | |
---|
22 | %{?nosrc:NoSource: 0} |
---|
23 | |
---|
24 | License: GPLv2+ |
---|
25 | Group: Applications/Games |
---|
26 | URL: http://www.wesnoth.org/ |
---|
27 | |
---|
28 | Requires: xorg-x11-libs SDL SDL_image SDL_mixer SDL_net SDL_ttf |
---|
29 | Requires: freetype2 libpng zlib |
---|
30 | Requires: libboost-iostreams |
---|
31 | %if %{?_dist_release} == "vl5" |
---|
32 | Requires: TrueType-vlgothic |
---|
33 | %endif |
---|
34 | %if %{?_dist_release} == "vl4" |
---|
35 | Requires: TrueType-sazanami |
---|
36 | %endif |
---|
37 | BuildRequires: xorg-x11-devel SDL-devel SDL_image-devel SDL_mixer-devel |
---|
38 | BuildRequires: SDL_net-devel SDL_ttf-devel |
---|
39 | BuildRequires: freetype2-devel libpng-devel zlib-devel |
---|
40 | BuildRequires: libboost-devel libboost-iostreams |
---|
41 | #BuildRequires: fribidi-devel |
---|
42 | #BuildRequires: python-devel |
---|
43 | BuildRoot: %{_tmppath}/%{pkgname}-%{version}-root |
---|
44 | Obsoletes: wesnoth <= 1.4.7 |
---|
45 | |
---|
46 | %description |
---|
47 | Battle for Wesnoth is a fantasy turn-based strategy game. Battle for |
---|
48 | control of villages, using variety of units which have advantages and |
---|
49 | disadvantages in different types of terrains and against different |
---|
50 | types of attacks. Units gain experience and advance levels, and are |
---|
51 | carried over from one scenario to the next campaign. |
---|
52 | |
---|
53 | %description -l ja |
---|
54 | Battle for Wesnoth はターンベースの戦略シミュレーションゲームです. |
---|
55 | 異なる地形や攻撃のタイプに対して,長所と短所をもつ多種のユニットを使用 |
---|
56 | しながら,村々の支配のために戦います.ユニットは経験を得てレベルアップ |
---|
57 | して,シナリオから次のキャンペーンまで連れて行かれます. |
---|
58 | |
---|
59 | %if %{with_editor} |
---|
60 | %package editor |
---|
61 | Group: Applications/Games |
---|
62 | Summary: The Battle of Wesnoth map editor. |
---|
63 | Summary(ja): The Battle of Wesnoth マップエディタ |
---|
64 | Requires: wesnoth = %{version}-%{release} |
---|
65 | |
---|
66 | %description editor |
---|
67 | Battle for Wesnoth is a fantasy turn-based strategy game. |
---|
68 | This package contains the map editor for it. |
---|
69 | |
---|
70 | %description editor -l ja |
---|
71 | Battle for Wesnoth はターンベースの戦略シミュレーションゲームです. |
---|
72 | このパッケージには,そのマップエディタが入っています. |
---|
73 | %endif |
---|
74 | |
---|
75 | %if %{with_tools} |
---|
76 | %package tools |
---|
77 | Group: Applications/Games |
---|
78 | Summary: The Battle of Wesnoth tools. |
---|
79 | Summary(ja): The Battle of Wesnoth ツール |
---|
80 | Requires: wesnoth = %{version}-%{release} |
---|
81 | |
---|
82 | %description tools |
---|
83 | Battle for Wesnoth is a fantasy turn-based strategy game. |
---|
84 | This package includes tools for translators and artists working on |
---|
85 | Battle for Wesnoth. |
---|
86 | |
---|
87 | %description tools -l ja |
---|
88 | Battle for Wesnoth はターンベースの戦略シミュレーションゲームです. |
---|
89 | このパッケージには,Battle for Wesnoth で作業されている |
---|
90 | 翻訳者やアーティストへのツールが含まれています. |
---|
91 | %endif |
---|
92 | |
---|
93 | %if %{with_campaignd} |
---|
94 | %package campaign-server |
---|
95 | Summary: The Battle of Wesnoth campaign server. |
---|
96 | Summary(ja): The Battle of Wesnoth キャンペーンサーバ |
---|
97 | Requires: wesnoth = %{version}-%{release} |
---|
98 | |
---|
99 | %description campaign-server |
---|
100 | Battle for Wesnoth is a fantasy turn-based strategy game. |
---|
101 | The campaign server acts as a simple download server, much like ftp, to |
---|
102 | provide a collection of Wesnoth campaigns to players. |
---|
103 | |
---|
104 | %description campaign-server -l ja |
---|
105 | Battle for Wesnoth はターンベースの戦略シミュレーションゲームです. |
---|
106 | このキャンペーンサーバーは,プレーヤーたちに Wesnoth キャンペーンの |
---|
107 | コレクションを提供するために,FTP のような簡易なダウンロードサーバとして |
---|
108 | 動作します. |
---|
109 | %endif |
---|
110 | |
---|
111 | %if %{with_wesnothd} |
---|
112 | %package server |
---|
113 | Group: Applications/Games |
---|
114 | Summary: The Battle of Wesnoth game server. |
---|
115 | Summary(ja): The Battle of Wesnoth ゲームサーバ |
---|
116 | Requires: wesnoth = %{version}-%{release} |
---|
117 | Requires(post): /sbin/chkconfig |
---|
118 | Requires(preun): /sbin/chkconfig |
---|
119 | Requires(pre): /usr/sbin/useradd |
---|
120 | |
---|
121 | %description server |
---|
122 | Battle for Wesnoth is a fantasy turn-based strategy game. |
---|
123 | This package contains the wesnothd server needed to play networked games. |
---|
124 | |
---|
125 | %description server -l ja |
---|
126 | Battle for Wesnoth はターンベースの戦略シミュレーションゲームです. |
---|
127 | このパッケージには,ネットワークゲームのプレイに必要とされるwesnothdサー |
---|
128 | バが入っています. |
---|
129 | %endif |
---|
130 | |
---|
131 | |
---|
132 | %prep |
---|
133 | rm -rf ${RPM_BUILD_ROOT} |
---|
134 | |
---|
135 | %setup -q -n %{pkgname}-%{version} |
---|
136 | %patch0 -p1 -b .gcc43 |
---|
137 | |
---|
138 | %build |
---|
139 | export CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" |
---|
140 | %configure \ |
---|
141 | --disable-dependency-tracking \ |
---|
142 | %if %{with_editor} |
---|
143 | --enable-editor \ |
---|
144 | %endif |
---|
145 | %if %{with_tools} |
---|
146 | --enable-tools \ |
---|
147 | %endif |
---|
148 | %if %{with_campaignd} |
---|
149 | --enable-campaign-server \ |
---|
150 | %endif |
---|
151 | %if %{with_wesnothd} |
---|
152 | --enable-server \ |
---|
153 | --with-fifodir=/var/run/wesnothd \ |
---|
154 | --with-server-gid=root \ |
---|
155 | --with-server-uid=root \ |
---|
156 | %endif |
---|
157 | --with-datadir-name=%{datadir_name} \ |
---|
158 | ; |
---|
159 | |
---|
160 | %{__make} |
---|
161 | |
---|
162 | |
---|
163 | %install |
---|
164 | %{__rm} -rf ${RPM_BUILD_ROOT} |
---|
165 | %{__make} DESTDIR=${RPM_BUILD_ROOT} install |
---|
166 | |
---|
167 | ### for wesnoth147 |
---|
168 | # - rename exec binary |
---|
169 | # - remove man directory |
---|
170 | %{__rm} -rf $RPM_BUILD_ROOT%{_mandir} |
---|
171 | %__mv $RPM_BUILD_ROOT%{_bindir}/%{pkgname} \ |
---|
172 | $RPM_BUILD_ROOT%{_bindir}/%{pkgname}-%{version} |
---|
173 | |
---|
174 | ### link sazanami-gothic.ttf |
---|
175 | pushd ${RPM_BUILD_ROOT}%{_datadir}/%{datadir_name}/fonts/ |
---|
176 | # for 1.2.7 or higher (contains sazanami-gothic.ttf) |
---|
177 | %{__rm} -f sazanami-gothic.ttf |
---|
178 | |
---|
179 | %if %{?_dist_release} == "vl5" |
---|
180 | #ln -s /usr/share/fonts/TrueType-sazanami-gothic/sazanami-gothic.ttf . |
---|
181 | ln -s /usr/share/fonts/TrueType-vlgothic/VL-PGothic-Regular.ttf sazanami-gothic.ttf |
---|
182 | %endif |
---|
183 | %if %{?_dist_release} == "vl4" |
---|
184 | ln -s /usr/X11R6/lib/X11/fonts/TrueType/sazanami-gothic.ttf . |
---|
185 | %endif |
---|
186 | popd |
---|
187 | |
---|
188 | ### for Gnome menu |
---|
189 | mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps |
---|
190 | sed -i -e 's/^Version=.*$//' \ |
---|
191 | -e 's/^Name=Battle for Wesnoth/Name=Battle for Wesnoth (Version 1.4.7)/' \ |
---|
192 | -e 's/^Exec=wesnoth/Exec=wesnoth-1.4.7/' \ |
---|
193 | -e 's/Icon=wesnoth-icon\.png/Icon=wesnoth147-icon/' \ |
---|
194 | icons/%{pkgname}.desktop |
---|
195 | %__mv icons/%{pkgname}.desktop icons/%{datadir_name}.desktop |
---|
196 | desktop-file-install \ |
---|
197 | --dir $RPM_BUILD_ROOT/%{_datadir}/applications \ |
---|
198 | --mode="0644" --vendor vine \ |
---|
199 | icons/%{datadir_name}.desktop |
---|
200 | install -m 644 images/%{pkgname}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps/%{datadir_name}-icon.png |
---|
201 | %if %{with_editor} |
---|
202 | desktop-file-install \ |
---|
203 | --dir $RPM_BUILD_ROOT/%{_datadir}/applications \ |
---|
204 | --mode="0644" --vendor vine \ |
---|
205 | icons/%{pkgname}_editor.desktop |
---|
206 | install -m 644 icons/%{pkgname}_editor-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps |
---|
207 | %endif |
---|
208 | |
---|
209 | ### rename for tools |
---|
210 | %if %{with_tools} |
---|
211 | pushd ${RPM_BUILD_ROOT}%{_bindir}/ |
---|
212 | mv cutter %{pkgname}_cutter |
---|
213 | mv exploder %{pkgname}_exploder |
---|
214 | popd |
---|
215 | %endif |
---|
216 | |
---|
217 | ### for wesnothd server |
---|
218 | %if %{with_wesnothd} |
---|
219 | mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} |
---|
220 | mv ${RPM_BUILD_ROOT}%{_bindir}/wesnothd ${RPM_BUILD_ROOT}%{_sbindir} |
---|
221 | mkdir -p ${RPM_BUILD_ROOT}/var/run/wesnothd |
---|
222 | touch ${RPM_BUILD_ROOT}/var/run/wesnothd/socket |
---|
223 | install -Dpm 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initrddir}/wesnothd |
---|
224 | install -Dpm 644 %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/wesnoth |
---|
225 | %endif |
---|
226 | |
---|
227 | |
---|
228 | ### remove unpackage files |
---|
229 | %if !%{with_editor} |
---|
230 | %{__rm} -f ${RPM_BUILD_ROOT}%{_datadir}/wesnoth/translations/*/LC_MESSAGES/wesnoth-editor.mo |
---|
231 | %endif |
---|
232 | |
---|
233 | find $RPM_BUILD_ROOT -name ".cvs*" | xargs rm -f |
---|
234 | find $RPM_BUILD_ROOT -name "CVS" | xargs rm -rf |
---|
235 | |
---|
236 | %{__rm} -rf $RPM_BUILD_ROOT/usr/share/doc/wesnoth/ |
---|
237 | %{__rm} -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth-icon.png |
---|
238 | %{__rm} -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth_editor-icon.png |
---|
239 | %{__rm} -f $RPM_BUILD_ROOT/usr/share/applications/wesnoth* |
---|
240 | |
---|
241 | |
---|
242 | %clean |
---|
243 | %{__rm} -rf ${RPM_BUILD_ROOT} |
---|
244 | |
---|
245 | |
---|
246 | %post |
---|
247 | # touch --no-create %{_datadir}/icons/hicolor || : |
---|
248 | # if [ -x %{_bindir}/gtk-update-icon-cache ]; then |
---|
249 | # %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : |
---|
250 | # fi |
---|
251 | |
---|
252 | %postun |
---|
253 | # touch --no-create %{_datadir}/icons/hicolor || : |
---|
254 | # if [ -x %{_bindir}/gtk-update-icon-cache ]; then |
---|
255 | # %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : |
---|
256 | # fi |
---|
257 | |
---|
258 | %if %{with_wesnothd} |
---|
259 | %pre server |
---|
260 | /usr/sbin/useradd -c "Wesnoth server" -s /sbin/nologin \ |
---|
261 | -r -d /var/run/wesnothd wesnothd 2> /dev/null || : |
---|
262 | |
---|
263 | %post server |
---|
264 | /sbin/chkconfig --add wesnothd |
---|
265 | if [ $1 -gt 1 ]; then |
---|
266 | %{_initrddir}/wesnothd try-restart >/dev/null || : |
---|
267 | fi |
---|
268 | |
---|
269 | %preun server |
---|
270 | if [ $1 -eq 0 ]; then |
---|
271 | %{_initrddir}/wesnothd stop >/dev/null 2>&1 || : |
---|
272 | /sbin/chkconfig --del wesnothd |
---|
273 | fi |
---|
274 | %endif |
---|
275 | |
---|
276 | |
---|
277 | %files |
---|
278 | %defattr(-,root,root) |
---|
279 | %doc COPYING INSTALL README changelog copyright doc/manual/ |
---|
280 | %{_bindir}/%{pkgname}-%{version} |
---|
281 | #%{_mandir}/man6/wesnoth.* |
---|
282 | #%{_mandir}/*/man6/wesnoth.* |
---|
283 | %{_datadir}/%{datadir_name} |
---|
284 | %{_datadir}/applications/vine-*.desktop |
---|
285 | %{_datadir}/pixmaps/*.png |
---|
286 | |
---|
287 | %if %{with_editor} |
---|
288 | %files editor |
---|
289 | %defattr(-,root,root) |
---|
290 | %{_bindir}/wesnoth_editor |
---|
291 | %{_mandir}/man6/wesnoth_editor.* |
---|
292 | %{_mandir}/*/man6/wesnoth_editor.* |
---|
293 | %{_datadir}/wesnoth/translations/*/LC_MESSAGES/wesnoth-editor.mo |
---|
294 | %{_datadir}/applications/vine-wesnoth_editor.desktop |
---|
295 | %endif |
---|
296 | |
---|
297 | %if %{with_tools} |
---|
298 | %files tools |
---|
299 | %defattr(-,root,root) |
---|
300 | #%{_bindir}/cutter |
---|
301 | #%{_bindir}/exploder |
---|
302 | %{_bindir}/wesnoth_cutter |
---|
303 | %{_bindir}/wesnoth_exploder |
---|
304 | %endif |
---|
305 | |
---|
306 | %if %{with_campaignd} |
---|
307 | %files campaign-server |
---|
308 | %defattr(-,root,root) |
---|
309 | %{_bindir}/campaignd |
---|
310 | %endif |
---|
311 | |
---|
312 | %if %{with_wesnothd} |
---|
313 | %files server |
---|
314 | %defattr(-,root,root) |
---|
315 | %config %{_initrddir}/wesnothd |
---|
316 | %config(noreplace) %{_sysconfdir}/sysconfig/wesnoth |
---|
317 | #%{_bindir}/wesnothd |
---|
318 | %{_sbindir}/wesnothd |
---|
319 | %{_mandir}/man6/wesnothd.* |
---|
320 | %{_mandir}/*/man6/wesnothd.* |
---|
321 | %attr(0700,wesnothd,wesnothd) %dir /var/run/wesnothd/ |
---|
322 | %ghost /var/run/wesnothd/socket |
---|
323 | %endif |
---|
324 | |
---|
325 | |
---|
326 | %changelog |
---|
327 | * Sat Jan 10 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.7-2 |
---|
328 | - renamed to wesnoth147 from wesnoth |
---|
329 | - added Requires: TrueType-vlgothic for vl5 |
---|
330 | - dropped BuildRequires: TrueType-sazanami |
---|
331 | - added configure options: |
---|
332 | - --disable-dependency-tracking |
---|
333 | - --with-datadir-name=%%{datadir_name} |
---|
334 | |
---|
335 | * Sat Jan 10 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.7-1 |
---|
336 | - new upstream release |
---|
337 | |
---|
338 | * Sun Nov 16 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.6-1 |
---|
339 | - new upstream release |
---|
340 | |
---|
341 | * Sun Nov 02 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.5-1 |
---|
342 | - new upstream release |
---|
343 | - fixed License to GPLv2+ |
---|
344 | - added BuildRequires: libboost-devel |
---|
345 | - added Requires: libboost-iostreams |
---|
346 | - dropped wesnoth.desktop, wesnoth.png, wesnoth-editor.desktop |
---|
347 | |
---|
348 | - apply wesnoth-1.2.8-gcc43.patch (from Fedora package) |
---|
349 | |
---|
350 | * Tue Oct 14 2008 Shu KONNO <owa@bg.wakwak.com> 1.2.7-1vl5 |
---|
351 | - applied new versioning policy, spec in utf-8 |
---|
352 | |
---|
353 | * Wed Jan 02 2008 Shu KONNO <owa@bg.wakwak.com> 1.2.7-0vl2 |
---|
354 | - rebuilt for VineSeed |
---|
355 | |
---|
356 | * Mon Oct 23 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.7-0vl1 |
---|
357 | - new upstream |
---|
358 | - define with_editor 0, with_tools 0, with_campaignd 0, with_wesnothd 0 |
---|
359 | - drop wesnoth-server package |
---|
360 | - arrange wesnothd server package files |
---|
361 | [HELP] please test wesnoth-server, which change with_wesnothd to TRUE |
---|
362 | |
---|
363 | # * Tue Sep 4 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl3 |
---|
364 | # - provide wesnoth-tools package |
---|
365 | # - drop wesnoth-server package |
---|
366 | # - arrange wesnothd server package files |
---|
367 | # [HELP] please test wesnoth-server and wesnoth-campaign-server, |
---|
368 | # which change with_wesnothd and with_campaignd to TRUE |
---|
369 | |
---|
370 | * Mon Sep 3 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl2 |
---|
371 | - rebuild for VineSeed |
---|
372 | |
---|
373 | * Mon Sep 3 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl1 |
---|
374 | - initial build for Vine Linux 4.1 |
---|
375 | |
---|
376 | * Sun Apr 15 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.3-0vlmp1 |
---|
377 | - new upstream for Vine Linux 4.1 |
---|
378 | |
---|
379 | * Fri Jun 10 2005 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 0.9.2-0vlmp1 |
---|
380 | - initial build for Vine Linux 3.2 |
---|
381 | |
---|
382 | |
---|
383 | |
---|
384 | # end of file |
---|