wesnoth-vl.spec 15 KB

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