wesnoth-vl.spec 13 KB

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