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