source: projects/specs/trunk/w/wesnoth165/wesnoth165-vl.spec @ 713

Revision 713, 14.3 KB checked in by iwaim, 14 years ago (diff)

new: add base file for wesnoth165

Line 
1%define with_editor 0
2%define with_tools 0
3%define with_campaignd 0
4%define with_wesnothd 0
5
6%define with_unofficial_po 1
7
8Summary: Fantasy Turn-Based Strategy Game
9Summary(ja):  ターンベースのファンタジー戦略シミュレーションゲーム
10Name: wesnoth
11Version: 1.6.5
12Release: 3%{?_dist_release}
13Source0: %{name}-%{version}.tar.bz2
14Source1: wesnothd.init
15Source2: %{name}.sysconfig
16%if %{with_unofficial_po}
17# based http://loda.jp/wjtranslate/?id=17
18Source10: wesnoth-1.6.5-japanese-po.tar.gz
19# http://github.com/iwaim/wesnoth-po/raw/master/ja-po/wesnoth-sotbe/ja.po
20Source11: wesnoth-1.6.5-sotbe-ja.po
21Patch10: wesnoth-1.6.5-japanese_translators.patch
22%endif
23
24%{?nosrc:NoSource: 0}
25
26License: GPLv2+
27Group: Applications/Games
28URL: http://www.wesnoth.org/
29
30Distribution: Vine Linux
31Vendor:       Project Vine
32Packager:     munepi, iwaim
33
34Requires: xorg-x11-libs SDL SDL_image SDL_mixer SDL_net SDL_ttf
35Requires: freetype2 libpng zlib pango fontconfig
36Requires: libboost-iostreams libboost-regex
37%if %{?_dist_release} == "vl5" || %{?_dist_release} == "vl6"
38Requires: TrueType-vlgothic
39%endif
40%if %{?_dist_release} == "vl4"
41Requires: TrueType-sazanami
42%endif
43BuildRequires: desktop-file-utils
44BuildRequires: ImageMagick
45BuildRequires: xorg-x11-devel SDL-devel SDL_image-devel SDL_mixer-devel
46BuildRequires: SDL_net-devel SDL_ttf-devel
47BuildRequires: freetype2-devel libpng-devel zlib-devel pango-devel
48BuildRequires: fontconfig-devel
49BuildRequires: libboost-devel libboost-iostreams libboost-regex
50#BuildRequires: fribidi-devel
51#BuildRequires: python-devel
52BuildRoot: %{_tmppath}/%{name}-%{version}-root
53
54%description
55Battle for Wesnoth is a fantasy turn-based strategy game. Battle for
56control of villages, using variety of units which have advantages and
57disadvantages in different types of terrains and against different
58types of attacks. Units gain experience and advance levels, and are
59carried over from one scenario to the next campaign.
60
61%description -l ja
62Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
63異なる地形や攻撃のタイプに対して,長所と短所をもつ多種のユニットを使用
64しながら,村々の支配のために戦います.ユニットは経験を得てレベルアップ
65して,シナリオから次のキャンペーンまで連れて行かれます.
66
67%if %{with_editor}
68%package editor
69Group: Applications/Games
70Summary: The Battle of Wesnoth map editor.
71Summary(ja): The Battle of Wesnoth マップエディタ
72Requires: wesnoth = %{version}-%{release}
73
74%description editor
75Battle for Wesnoth is a fantasy turn-based strategy game.
76This package contains the map editor for it.
77
78%description editor -l ja
79Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
80このパッケージには,そのマップエディタが入っています.
81%endif
82
83%if %{with_tools}
84%package tools
85Group: Applications/Games
86Summary: The Battle of Wesnoth tools.
87Summary(ja): The Battle of Wesnoth ツール
88Requires: wesnoth = %{version}-%{release}
89
90%description tools
91Battle for Wesnoth is a fantasy turn-based strategy game.
92This package includes tools for translators and artists working on
93Battle for Wesnoth.
94
95%description tools -l ja
96Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
97このパッケージには,Battle for Wesnoth で作業されている
98翻訳者やアーティストへのツールが含まれています.
99%endif
100
101%if %{with_campaignd}
102%package campaign-server
103Summary: The Battle of Wesnoth campaign server.
104Summary(ja): The Battle of Wesnoth キャンペーンサーバ
105Requires: wesnoth = %{version}-%{release}
106
107%description campaign-server
108Battle for Wesnoth is a fantasy turn-based strategy game.
109The campaign server acts as a simple download server, much like ftp, to
110provide a collection of Wesnoth campaigns to players.
111
112%description campaign-server -l ja
113Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
114このキャンペーンサーバーは,プレーヤーたちに Wesnoth キャンペーンの
115コレクションを提供するために,FTP のような簡易なダウンロードサーバとして
116動作します.
117%endif
118
119%if %{with_wesnothd}
120%package server
121Group: Applications/Games
122Summary: The Battle of Wesnoth game server.
123Summary(ja): The Battle of Wesnoth ゲームサーバ
124Requires: wesnoth = %{version}-%{release}
125Requires(post): /sbin/chkconfig
126Requires(preun): /sbin/chkconfig
127Requires(pre): /usr/sbin/useradd
128
129%description server
130Battle for Wesnoth is a fantasy turn-based strategy game.
131This package contains the wesnothd server needed to play networked games.
132
133%description server -l ja
134Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
135このパッケージには,ネットワークゲームのプレイに必要とされるwesnothdサー
136バが入っています.
137%endif
138
139
140%prep
141%__rm -rf ${RPM_BUILD_ROOT}
142
143%setup -q
144
145%if %{with_unofficial_po}
146%patch10 -p1
147%define japo_dir wesnoth-1.6.5-japanese-po
148%{__tar} zxvf %{SOURCE10}
149pushd %{japo_dir}
150target=(
151        wesnoth-anl
152        wesnoth-aoi
153        wesnoth-did
154        wesnoth-editor
155        wesnoth-ei
156        wesnoth-httt
157        wesnoth-l
158        wesnoth-lib
159        wesnoth-low
160        wesnoth-manpages
161        wesnoth-manual
162        wesnoth-multiplayer
163        wesnoth-nr
164        wesnoth-sof
165        wesnoth-sotbe
166        wesnoth-tb
167        wesnoth-test
168        wesnoth-thot
169        wesnoth-trow
170        wesnoth-tsg
171        wesnoth-tutorial
172        wesnoth-units
173        wesnoth-utbs
174        wesnoth
175)
176for n in "${target[@]}"
177do
178%{__cp} -f $n.po ../po/$n/ja.po
179done
180popd
181# wesnoth-sotbe
182%{__cp} -f %{SOURCE11} po/wesnoth-sotbe/ja.po
183%endif
184
185%build
186export CFLAGS="%{optflags}" CXXFLAGS="%{optflags}"
187%configure \
188    --disable-dependency-tracking \
189%if %{with_editor}
190    --enable-editor \
191%endif
192%if %{with_tools}
193    --enable-tools \
194%endif
195%if %{with_campaignd}
196    --enable-campaign-server \
197%endif
198%if %{with_wesnothd}
199    --enable-server=yes \
200    --with-fifodir=/var/run/wesnothd \
201    --with-server-gid=root \
202    --with-server-uid=root \
203%else
204    --enable-server=no \
205%endif
206    --with-localedir=%{_datadir}/locale \
207        ;
208   
209%{__make}
210
211
212%install
213%{__rm} -rf ${RPM_BUILD_ROOT}
214%{__make} DESTDIR=${RPM_BUILD_ROOT} install
215
216### link sazanami-gothic.ttf
217pushd ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fonts/
218## for 1.2.7 or higher (contains sazanami-gothic.ttf)
219#%{__rm} -f sazanami-gothic.ttf
220## for 1.6a or higher (NOT contains sazanami-gothic.ttf)
221%{__rm} -f wqy-zenhei.ttc
222
223%if %{?_dist_release} == "vl5" || %{?_dist_release} == "vl6"
224#ln -s /usr/share/fonts/TrueType-sazanami-gothic/sazanami-gothic.ttf .
225ln -s /usr/share/fonts/TrueType-vlgothic/VL-PGothic-Regular.ttf sazanami-gothic.ttf
226%endif
227%if %{?_dist_release} == "vl4"
228ln -s /usr/X11R6/lib/X11/fonts/TrueType/sazanami-gothic.ttf .
229%endif
230popd
231
232### for Gnome menu
233%__mkdir_p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
234%__sed -i -e 's/^Version=.*$//' \
235       -e 's/^Icon=wesnoth-icon\.png/Icon=wesnoth-icon/' \
236    icons/%{name}.desktop
237desktop-file-install \
238    --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
239    --mode="0644" --vendor vine \
240    icons/%{name}.desktop
241#%__install -m 644 icons/%{name}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
242for size in 16x16 20x20 22x22 24x24 32x32 36x36 64x64 48x48 64x64 72x72 96x96 128x128 192x192 ; do
243    %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${size}/apps
244    convert icons/%{name}-icon.png -size ${size} \
245        $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${size}/apps/%{name}-icon.png
246done
247%if %{with_editor}
248desktop-file-install \
249    --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
250    --mode="0644" --vendor vine \
251    icons/%{name}_editor.desktop
252%__install -m 644 icons/%{name}_editor-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
253%endif
254
255### rename for tools
256%if %{with_tools}
257pushd ${RPM_BUILD_ROOT}%{_bindir}/
258mv cutter %{name}_cutter
259mv exploder %{name}_exploder
260popd
261%endif
262
263### for wesnothd server
264%if %{with_wesnothd}
265mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
266mv ${RPM_BUILD_ROOT}%{_bindir}/wesnothd ${RPM_BUILD_ROOT}%{_sbindir}
267mkdir -p ${RPM_BUILD_ROOT}/var/run/wesnothd
268touch ${RPM_BUILD_ROOT}/var/run/wesnothd/socket
269install -Dpm 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initrddir}/wesnothd
270install -Dpm 644 %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/wesnoth
271%endif
272
273
274### remove unpackage files
275%if !%{with_editor}
276%{__rm} -f ${RPM_BUILD_ROOT}%{_datadir}/wesnoth/translations/*/LC_MESSAGES/wesnoth-editor.mo
277%endif
278
279find $RPM_BUILD_ROOT -name ".cvs*" | xargs rm -f
280find $RPM_BUILD_ROOT -name "CVS" | xargs rm -rf
281
282%{__rm} -rf $RPM_BUILD_ROOT/usr/share/doc/wesnoth/
283%{__rm} -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth-icon.png \
284    $RPM_BUILD_ROOT/usr/share/pixmaps/wesnoth-icon.png \
285    $RPM_BUILD_ROOT/usr/share/icons/wesnoth_editor-icon.png
286%{__rm} -f $RPM_BUILD_ROOT/usr/share/applications/wesnoth*.desktop
287%if !%{with_wesnothd}
288%{__rm} -f $RPM_BUILD_ROOT/%{_mandir}/man6/wesnothd.*
289%{__rm} -f $RPM_BUILD_ROOT/%{_mandir}/*/man6/wesnothd.*
290%endif
291
292%find_lang %{name} --all-name
293
294%clean
295%{__rm} -rf ${RPM_BUILD_ROOT}
296
297
298%post
299touch --no-create %{_datadir}/icons/hicolor || :
300if [ -x %{_bindir}/gtk-update-icon-cache ]; then
301   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
302fi
303%{_bindir}/update-desktop-database %{_datadir}/applications || :
304
305%postun
306%{_bindir}/update-desktop-database %{_datadir}/applications || :
307touch --no-create %{_datadir}/icons/hicolor || :
308if [ -x %{_bindir}/gtk-update-icon-cache ]; then
309  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
310fi
311
312%if %{with_wesnothd}
313%pre server
314/usr/sbin/useradd -c "Wesnoth server" -s /sbin/nologin \
315        -r -d /var/run/wesnothd wesnothd 2> /dev/null || :
316
317%post server
318/sbin/chkconfig --add wesnothd
319if [ $1 -gt 1 ]; then
320    %{_initrddir}/wesnothd try-restart >/dev/null || :
321fi
322
323%preun server
324if [ $1 -eq 0 ]; then
325    %{_initrddir}/wesnothd stop >/dev/null 2>&1 || :
326    /sbin/chkconfig --del wesnothd
327fi
328%endif
329
330
331%files -f %{name}.lang
332%defattr(-,root,root)
333%doc COPYING INSTALL README changelog copyright doc/manual/
334%{_bindir}/%{name}
335%{_mandir}/man6/wesnoth.*
336%{_mandir}/*/man6/wesnoth.*
337%{_datadir}/%{name}
338%{_datadir}/applications/vine-wesnoth.desktop
339#%{_datadir}/pixmaps/wesnoth-icon.png
340%{_datadir}/icons/hicolor/*/apps/*.png
341
342%if %{with_editor}
343%files editor
344%defattr(-,root,root)
345%{_bindir}/wesnoth_editor
346%{_mandir}/man6/wesnoth_editor.*
347%{_mandir}/*/man6/wesnoth_editor.*
348%{_datadir}/wesnoth/translations/*/LC_MESSAGES/wesnoth-editor.mo
349%{_datadir}/applications/vine-wesnoth_editor.desktop
350%endif
351
352%if %{with_tools}
353%files tools
354%defattr(-,root,root)
355#%{_bindir}/cutter
356#%{_bindir}/exploder
357%{_bindir}/wesnoth_cutter
358%{_bindir}/wesnoth_exploder
359%endif
360
361%if %{with_campaignd}
362%files campaign-server
363%defattr(-,root,root)
364%{_bindir}/campaignd
365%endif
366
367%if %{with_wesnothd}
368%files server
369%defattr(-,root,root)
370%config %{_initrddir}/wesnothd
371%config(noreplace) %{_sysconfdir}/sysconfig/wesnoth
372#%{_bindir}/wesnothd
373%{_sbindir}/wesnothd
374%{_mandir}/man6/wesnothd.*
375%{_mandir}/*/man6/wesnothd.*
376%attr(0700,wesnothd,wesnothd) %dir /var/run/wesnothd/
377%ghost /var/run/wesnothd/socket
378%endif
379
380
381%changelog
382* Mon Mar 29 2010 IWAI, Masaharu <iwai@alib.jp> 1.6.5-3
383- add unofficial Japanese po files
384  - add wesnoth-1.6.5-japanese-po.zip (Source10)
385  - add wesnoth-1.6.5-sotbe-ja.po (Source11)
386  - add Japanese translators patch (Patch10)
387- update Packager: assign iwaim
388
389* Mon Feb 08 2010 Shu KONNO <owa@bg.wakwak.com> 1.6.5-2vl6
390- rebuilt with new toolchain and libboost-1.42.0
391
392* Fri Sep 11 2009 Munehiro Yamamoto <munepi@vinelinux.org> 1.6.5-1
393- new upstream release
394- added BuildRequires:
395  - desktop-file-utils
396  - ImageMagick
397
398* Wed Jul 22 2009 Munehiro Yamamoto <munepi@vinelinux.org> 1.6.4-1
399- new upstream release
400
401* Wed Jul  8 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.6.3-2
402- fix enable-server bits
403  - specify --enable-server=no when with_wesnothd is NOT set)
404  - fix install section
405
406* Fri Jul 03 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.6.3-1
407- new upstream release
408
409* Sun May 17 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.6.2-1
410- new upstream release
411
412* Fri May 08 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.6.1-1
413- new upstream release
414
415* Mon Mar 23 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.6a-1
416- new upstream release
417- added BuildRequires: libboost-regex
418- added Requires:
419  - libboost-regex
420  - TrueType-vlgothic for vl5
421- dropped BuildRequires: TrueType-sazanami
422- dropped wesnoth-1.2.8-gcc43.patch
423- added configure options:
424  - --disable-dependency-tracking
425  - --with-localedir=%%{_datadir}/locale
426- removed wqy-zenhei.ttc
427  because wqy-zenhei.ttc affected sazanami-gothic.ttf badly
428- added update-desktop-database process in %%post and %%postun
429
430* Sat Jan 10 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.7-1
431- new upstream release
432
433* Sun Nov 16 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.6-1
434- new upstream release
435
436* Sun Nov 02 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.5-1
437- new upstream release
438- fixed License to GPLv2+
439- added BuildRequires: libboost-devel
440- added Requires: libboost-iostreams
441- dropped wesnoth.desktop, wesnoth.png, wesnoth-editor.desktop
442
443- apply wesnoth-1.2.8-gcc43.patch (from Fedora package)
444
445* Tue Oct 14 2008 Shu KONNO <owa@bg.wakwak.com> 1.2.7-1vl5
446- applied new versioning policy, spec in utf-8
447
448* Wed Jan 02 2008 Shu KONNO <owa@bg.wakwak.com> 1.2.7-0vl2
449- rebuilt for VineSeed
450
451* Mon Oct 23 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.7-0vl1
452- new upstream
453 - define with_editor 0, with_tools 0, with_campaignd 0, with_wesnothd 0
454 - drop wesnoth-server package
455 - arrange wesnothd server package files
456   [HELP] please test wesnoth-server, which change with_wesnothd to TRUE
457
458# * Tue Sep 4 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl3
459# - provide wesnoth-tools package
460# - drop wesnoth-server package
461# - arrange wesnothd server package files
462#   [HELP] please test wesnoth-server and wesnoth-campaign-server,
463#   which change with_wesnothd and with_campaignd to TRUE
464
465* Mon Sep 3 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl2
466- rebuild for VineSeed
467
468* Mon Sep 3 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl1
469- initial build for Vine Linux 4.1
470
471* Sun Apr 15 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.3-0vlmp1
472- new upstream for Vine Linux 4.1
473
474* Fri Jun 10 2005 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 0.9.2-0vlmp1
475- initial build for Vine Linux 3.2
476
477
478
479# end of file
Note: See TracBrowser for help on using the repository browser.