wesnoth-vl.spec 15 KB

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