wesnoth165-vl.spec 14 KB

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