wesnoth147-vl.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. %define pkgname wesnoth
  2. %define version 1.4.7
  3. %define release 2%{?_dist_release}
  4. %define with_editor 0
  5. %define with_tools 0
  6. %define with_campaignd 0
  7. %define with_wesnothd 0
  8. %define datadir_name %{pkgname}147
  9. Summary: Fantasy Turn-Based Strategy Game
  10. Summary(ja): ターンベースのファンタジー戦略シミュレーションゲーム
  11. Name: %{pkgname}147
  12. Version: %{version}
  13. Release: %{release}
  14. Source0: %{pkgname}-%{version}.tar.bz2
  15. Source1: wesnothd.init
  16. Source2: %{pkgname}.sysconfig
  17. Patch0: %{pkgname}-1.2.8-gcc43.patch
  18. %{?nosrc:NoSource: 0}
  19. License: GPLv2+
  20. Group: Applications/Games
  21. URL: http://www.wesnoth.org/
  22. Requires: xorg-x11-libs SDL SDL_image SDL_mixer SDL_net SDL_ttf
  23. Requires: freetype2 libpng zlib
  24. Requires: libboost-iostreams
  25. %if %{?_dist_release} == "vl5"
  26. Requires: TrueType-vlgothic
  27. %endif
  28. %if %{?_dist_release} == "vl4"
  29. Requires: TrueType-sazanami
  30. %endif
  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
  34. BuildRequires: libboost-devel libboost-iostreams
  35. #BuildRequires: fribidi-devel
  36. #BuildRequires: python-devel
  37. BuildRoot: %{_tmppath}/%{pkgname}-%{version}-root
  38. Obsoletes: wesnoth <= 1.4.7
  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 -n %{pkgname}-%{version}
  113. %patch0 -p1 -b .gcc43
  114. %build
  115. export CFLAGS="%{optflags}" CXXFLAGS="%{optflags}"
  116. %configure \
  117. --disable-dependency-tracking \
  118. %if %{with_editor}
  119. --enable-editor \
  120. %endif
  121. %if %{with_tools}
  122. --enable-tools \
  123. %endif
  124. %if %{with_campaignd}
  125. --enable-campaign-server \
  126. %endif
  127. %if %{with_wesnothd}
  128. --enable-server \
  129. --with-fifodir=/var/run/wesnothd \
  130. --with-server-gid=root \
  131. --with-server-uid=root \
  132. %endif
  133. --with-datadir-name=%{datadir_name} \
  134. ;
  135. %{__make}
  136. %install
  137. %{__rm} -rf ${RPM_BUILD_ROOT}
  138. %{__make} DESTDIR=${RPM_BUILD_ROOT} install
  139. ### for wesnoth147
  140. # - rename exec binary
  141. # - remove man directory
  142. %{__rm} -rf $RPM_BUILD_ROOT%{_mandir}
  143. %__mv $RPM_BUILD_ROOT%{_bindir}/%{pkgname} \
  144. $RPM_BUILD_ROOT%{_bindir}/%{pkgname}-%{version}
  145. ### link sazanami-gothic.ttf
  146. pushd ${RPM_BUILD_ROOT}%{_datadir}/%{datadir_name}/fonts/
  147. # for 1.2.7 or higher (contains sazanami-gothic.ttf)
  148. %{__rm} -f sazanami-gothic.ttf
  149. %if %{?_dist_release} == "vl5"
  150. #ln -s /usr/share/fonts/TrueType-sazanami-gothic/sazanami-gothic.ttf .
  151. ln -s /usr/share/fonts/TrueType-vlgothic/VL-PGothic-Regular.ttf sazanami-gothic.ttf
  152. %endif
  153. %if %{?_dist_release} == "vl4"
  154. ln -s /usr/X11R6/lib/X11/fonts/TrueType/sazanami-gothic.ttf .
  155. %endif
  156. popd
  157. ### for Gnome menu
  158. mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
  159. sed -i -e 's/^Version=.*$//' \
  160. -e 's/^Name=Battle for Wesnoth/Name=Battle for Wesnoth (Version 1.4.7)/' \
  161. -e 's/^Exec=wesnoth/Exec=wesnoth-1.4.7/' \
  162. -e 's/Icon=wesnoth-icon\.png/Icon=wesnoth147-icon/' \
  163. icons/%{pkgname}.desktop
  164. %__mv icons/%{pkgname}.desktop icons/%{datadir_name}.desktop
  165. desktop-file-install \
  166. --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
  167. --mode="0644" --vendor vine \
  168. icons/%{datadir_name}.desktop
  169. install -m 644 images/%{pkgname}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps/%{datadir_name}-icon.png
  170. %if %{with_editor}
  171. desktop-file-install \
  172. --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
  173. --mode="0644" --vendor vine \
  174. icons/%{pkgname}_editor.desktop
  175. install -m 644 icons/%{pkgname}_editor-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
  176. %endif
  177. ### rename for tools
  178. %if %{with_tools}
  179. pushd ${RPM_BUILD_ROOT}%{_bindir}/
  180. mv cutter %{pkgname}_cutter
  181. mv exploder %{pkgname}_exploder
  182. popd
  183. %endif
  184. ### for wesnothd server
  185. %if %{with_wesnothd}
  186. mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
  187. mv ${RPM_BUILD_ROOT}%{_bindir}/wesnothd ${RPM_BUILD_ROOT}%{_sbindir}
  188. mkdir -p ${RPM_BUILD_ROOT}/var/run/wesnothd
  189. touch ${RPM_BUILD_ROOT}/var/run/wesnothd/socket
  190. install -Dpm 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initrddir}/wesnothd
  191. install -Dpm 644 %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/wesnoth
  192. %endif
  193. ### remove unpackage files
  194. %if !%{with_editor}
  195. %{__rm} -f ${RPM_BUILD_ROOT}%{_datadir}/wesnoth/translations/*/LC_MESSAGES/wesnoth-editor.mo
  196. %endif
  197. find $RPM_BUILD_ROOT -name ".cvs*" | xargs rm -f
  198. find $RPM_BUILD_ROOT -name "CVS" | xargs rm -rf
  199. %{__rm} -rf $RPM_BUILD_ROOT/usr/share/doc/wesnoth/
  200. %{__rm} -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth-icon.png
  201. %{__rm} -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth_editor-icon.png
  202. %{__rm} -f $RPM_BUILD_ROOT/usr/share/applications/wesnoth*
  203. %clean
  204. %{__rm} -rf ${RPM_BUILD_ROOT}
  205. %post
  206. # touch --no-create %{_datadir}/icons/hicolor || :
  207. # if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  208. # %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
  209. # fi
  210. %postun
  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. %if %{with_wesnothd}
  216. %pre server
  217. /usr/sbin/useradd -c "Wesnoth server" -s /sbin/nologin \
  218. -r -d /var/run/wesnothd wesnothd 2> /dev/null || :
  219. %post server
  220. /sbin/chkconfig --add wesnothd
  221. if [ $1 -gt 1 ]; then
  222. %{_initrddir}/wesnothd try-restart >/dev/null || :
  223. fi
  224. %preun server
  225. if [ $1 -eq 0 ]; then
  226. %{_initrddir}/wesnothd stop >/dev/null 2>&1 || :
  227. /sbin/chkconfig --del wesnothd
  228. fi
  229. %endif
  230. %files
  231. %defattr(-,root,root)
  232. %doc COPYING INSTALL README changelog copyright doc/manual/
  233. %{_bindir}/%{pkgname}-%{version}
  234. #%{_mandir}/man6/wesnoth.*
  235. #%{_mandir}/*/man6/wesnoth.*
  236. %{_datadir}/%{datadir_name}
  237. %{_datadir}/applications/vine-*.desktop
  238. %{_datadir}/pixmaps/*.png
  239. %if %{with_editor}
  240. %files editor
  241. %defattr(-,root,root)
  242. %{_bindir}/wesnoth_editor
  243. %{_mandir}/man6/wesnoth_editor.*
  244. %{_mandir}/*/man6/wesnoth_editor.*
  245. %{_datadir}/wesnoth/translations/*/LC_MESSAGES/wesnoth-editor.mo
  246. %{_datadir}/applications/vine-wesnoth_editor.desktop
  247. %endif
  248. %if %{with_tools}
  249. %files tools
  250. %defattr(-,root,root)
  251. #%{_bindir}/cutter
  252. #%{_bindir}/exploder
  253. %{_bindir}/wesnoth_cutter
  254. %{_bindir}/wesnoth_exploder
  255. %endif
  256. %if %{with_campaignd}
  257. %files campaign-server
  258. %defattr(-,root,root)
  259. %{_bindir}/campaignd
  260. %endif
  261. %if %{with_wesnothd}
  262. %files server
  263. %defattr(-,root,root)
  264. %config %{_initrddir}/wesnothd
  265. %config(noreplace) %{_sysconfdir}/sysconfig/wesnoth
  266. #%{_bindir}/wesnothd
  267. %{_sbindir}/wesnothd
  268. %{_mandir}/man6/wesnothd.*
  269. %{_mandir}/*/man6/wesnothd.*
  270. %attr(0700,wesnothd,wesnothd) %dir /var/run/wesnothd/
  271. %ghost /var/run/wesnothd/socket
  272. %endif
  273. %changelog
  274. * Sat Jan 10 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.7-2
  275. - renamed to wesnoth147 from wesnoth
  276. - added Requires: TrueType-vlgothic for vl5
  277. - dropped BuildRequires: TrueType-sazanami
  278. - added configure options:
  279. - --disable-dependency-tracking
  280. - --with-datadir-name=%%{datadir_name}
  281. * Sat Jan 10 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.7-1
  282. - new upstream release
  283. * Sun Nov 16 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.6-1
  284. - new upstream release
  285. * Sun Nov 02 2008 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 1.4.5-1
  286. - new upstream release
  287. - fixed License to GPLv2+
  288. - added BuildRequires: libboost-devel
  289. - added Requires: libboost-iostreams
  290. - dropped wesnoth.desktop, wesnoth.png, wesnoth-editor.desktop
  291. - apply wesnoth-1.2.8-gcc43.patch (from Fedora package)
  292. * Tue Oct 14 2008 Shu KONNO <owa@bg.wakwak.com> 1.2.7-1vl5
  293. - applied new versioning policy, spec in utf-8
  294. * Wed Jan 02 2008 Shu KONNO <owa@bg.wakwak.com> 1.2.7-0vl2
  295. - rebuilt for VineSeed
  296. * Mon Oct 23 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.7-0vl1
  297. - new upstream
  298. - define with_editor 0, with_tools 0, with_campaignd 0, with_wesnothd 0
  299. - drop wesnoth-server package
  300. - arrange wesnothd server package files
  301. [HELP] please test wesnoth-server, which change with_wesnothd to TRUE
  302. # * Tue Sep 4 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl3
  303. # - provide wesnoth-tools package
  304. # - drop wesnoth-server package
  305. # - arrange wesnothd server package files
  306. # [HELP] please test wesnoth-server and wesnoth-campaign-server,
  307. # which change with_wesnothd and with_campaignd to TRUE
  308. * Mon Sep 3 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl2
  309. - rebuild for VineSeed
  310. * Mon Sep 3 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.6-0vl1
  311. - initial build for Vine Linux 4.1
  312. * Sun Apr 15 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 1.2.3-0vlmp1
  313. - new upstream for Vine Linux 4.1
  314. * Fri Jun 10 2005 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 0.9.2-0vlmp1
  315. - initial build for Vine Linux 3.2
  316. # end of file