wesnoth-vl.spec 15 KB

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