Browse Source

new upstream release

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@9976 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 8 years ago
parent
commit
6791cfb3f5
1 changed files with 151 additions and 238 deletions
  1. 151 238
      w/wesnoth/wesnoth-vl.spec

+ 151 - 238
w/wesnoth/wesnoth-vl.spec

@@ -1,72 +1,71 @@
-%define with_editor 0
-%define with_tools 0
-%define with_campaignd 0
-%define with_wesnothd 0
-
-%define ver 1.10.7
-%define src_ver %{ver}
-%define rel 1
-
-%define with_svn 0
-%if %{with_svn}
-%define svn_rev 41885
-%endif
-
-%define with_unofficial_po 0
-%define po_date		   20100926
-
-Summary: Fantasy Turn-Based Strategy Game
-Summary(ja):  ターンベースのファンタジー戦略シミュレーションゲーム
-Name: wesnoth
-Version: %{ver}
-%if %{with_svn}
-Release: %{rel}.svn%{svn_rev}%{?_dist_release}
-Source0: %{name}-%{version}-svn%{svn_rev}.tar.bz2
-%else
-Release: %{rel}%{?_dist_release}
-Source0: %{name}-%{src_ver}.tar.bz2
-%endif
-Source1: wesnothd.init
-Source2: %{name}.sysconfig
+%global with_editor 0
+%global with_tools 0
+%global with_campaignd 0
+%global with_wesnothd 0
+
+#% global svn_rev 41885
+%global with_unofficial_po 0
+%global po_date		   20100926
+
+Summary:	Fantasy Turn-Based Strategy Game
+Summary(ja):	ターンベースのファンタジー戦略シミュレーションゲーム
+Name:		wesnoth
+Version:	1.12.5
+Release:	1%{?svn_rev:.svn%svn_rev}%{?_dist_release}
+Source0:	http://www.wesnoth.org/files/%{name}-%{version}%{?svn_rev:-svn%svn_rev}.tar.bz2
+Source1:	wesnothd.init
+# Source1:	wesnothd.service
+Source2:	wesnoth.sysconfig
+Source3:	wesnoth.appdata.xml
+%if %{with_unofficial_po}
 # http://sourceforge.jp/projects/wesnoth-ja/releases/?package_id=11460
-Source12: wesnoth-1.8.5_ja-catalogs-%{po_date}.zip
+Source12:	wesnoth-1.8.5_ja-catalogs-%{po_date}.zip
+%endif
 
 %{?nosrc:NoSource: 0}
 
-License: GPLv2+
-Group: Applications/Games
-URL: http://www.wesnoth.org/
-
-Distribution: Vine Linux
-Vendor:       Project Vine
-Packager:     munepi, iwaim
-
-Requires: SDL SDL_image SDL_mixer SDL_net SDL_ttf
-Requires: freetype2 libpng zlib pango fontconfig
-Requires: libboost-iostreams libboost-regex
-Requires: TrueType-vlgothic
-BuildRequires: cmake >= 2.6.0
-BuildRequires: desktop-file-utils
-BuildRequires: ImageMagick
-BuildRequires: xorg-x11-devel SDL-devel SDL_image-devel SDL_mixer-devel 
-BuildRequires: SDL_net-devel SDL_ttf-devel
-BuildRequires: freetype2-devel libpng-devel zlib-devel pango-devel
-BuildRequires: fontconfig-devel
-BuildRequires: libboost-devel >= 1.36
-BuildRequires: libboost-iostreams libboost-regex
-BuildRequires: libboost-serialization
-BuildRequires: libboost-program-options
-BuildRequires: libboost-system
-BuildRequires: libboost-thread
-BuildRequires: lua-devel
-#BuildRequires: fribidi-devel
-#BuildRequires: python-devel
+Patch0:         wesnoth-1.2.8-gcc43.patch
+Patch8:         wesnoth-1.12.2-CVE-2015-5069.patch
+Patch9:         wesnoth-1.12.2-CVE-2015-5070.patch
+
+License:	GPLv2+
+Group:		Applications/Games
+URL:		http://www.wesnoth.org/
+
+Distribution:	Vine Linux
+Vendor:		Project Vine
+Packager:	munepi, iwaim
+
+Requires:	SDL SDL_image SDL_mixer SDL_net SDL_ttf
+Requires:	freetype2 libpng zlib pango fontconfig
+Requires:	libboost-iostreams libboost-regex
+Requires:	TrueType-vlgothic TrueType-dejavu-sans TrueType-droid-sans
+BuildRequires:	cmake >= 2.6.0
+BuildRequires:	desktop-file-utils
+BuildRequires:	ImageMagick
+BuildRequires:	xorg-x11-devel SDL-devel SDL_image-devel SDL_mixer-devel 
+BuildRequires:	SDL_net-devel SDL_ttf-devel
+BuildRequires:	freetype2-devel libpng-devel zlib-devel pango-devel
+BuildRequires:	fontconfig-devel
+BuildRequires:	libboost-devel >= 1.36
+BuildRequires:	libboost-iostreams libboost-regex
+BuildRequires:	libboost-serialization
+BuildRequires:	libboost-program-options
+BuildRequires:	libboost-system
+BuildRequires:	libboost-thread
+BuildRequires:	libboost-locale libboost-filesystem
+BuildRequires:	libvorbis-devel
+BuildRequires:	lua-devel
+BuildRequires:	dbus-devel
+BuildRequires:	fribidi-devel
+BuildRequires:	python-devel
+BuildRequires:  scons
 %if %{with_unofficial_po}
-BuildRequires: unzip
+BuildRequires:	unzip
 %endif
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRoot:	%{_tmppath}/%{name}-%{version}-root
 
-Conflicts: wesnoth165
+Conflicts:	wesnoth165
 
 %description
 Battle for Wesnoth is a fantasy turn-based strategy game. Battle for
@@ -81,23 +80,7 @@ Battle for Wesnoth はターンベースの戦略シミュレーションゲー
 しながら,村々の支配のために戦います.ユニットは経験を得てレベルアップ
 して,シナリオから次のキャンペーンまで連れて行かれます.
 
-%if %{with_editor}
-%package editor
-Group: Applications/Games
-Summary: The Battle of Wesnoth map editor.
-Summary(ja): The Battle of Wesnoth マップエディタ
-Requires: wesnoth = %{version}-%{release}
-
-%description editor
-Battle for Wesnoth is a fantasy turn-based strategy game. 
-This package contains the map editor for it.
 
-%description editor -l ja
-Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
-このパッケージには,そのマップエディタが入っています.
-%endif
-
-%if %{with_tools}
 %package tools
 Group: Applications/Games
 Summary: The Battle of Wesnoth tools.
@@ -113,27 +96,7 @@ Battle for Wesnoth.
 Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
 このパッケージには,Battle for Wesnoth で作業されている
 翻訳者やアーティストへのツールが含まれています.
-%endif
 
-%if %{with_campaignd}
-%package campaign-server
-Summary: The Battle of Wesnoth campaign server.
-Summary(ja): The Battle of Wesnoth キャンペーンサーバ
-Requires: wesnoth = %{version}-%{release}
-
-%description campaign-server
-Battle for Wesnoth is a fantasy turn-based strategy game. 
-The campaign server acts as a simple download server, much like ftp, to
-provide a collection of Wesnoth campaigns to players.
-
-%description campaign-server -l ja
-Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
-このキャンペーンサーバーは,プレーヤーたちに Wesnoth キャンペーンの
-コレクションを提供するために,FTP のような簡易なダウンロードサーバとして
-動作します.
-%endif
-
-%if %{with_wesnothd}
 %package server
 Group: Applications/Games
 Summary: The Battle of Wesnoth game server.
@@ -151,17 +114,15 @@ This package contains the wesnothd server needed to play networked games.
 Battle for Wesnoth はターンベースの戦略シミュレーションゲームです.
 このパッケージには,ネットワークゲームのプレイに必要とされるwesnothdサー
 バが入っています.
-%endif
 
 
 %prep
 %__rm -rf ${RPM_BUILD_ROOT}
-
-%if %{with_svn}
-%setup -q -n %{name}-%{version}-svn%{svn_rev}
-%else
-%setup -q -n %{name}-%{src_ver}
-%endif
+%setup -q -n %{name}-%{version}%{?svn_rev:-svn%svn_rev}
+%patch0 -p1 -b .gcc43
+#%patch7 -p0 -b .crash
+%patch8 -p0
+%patch9 -p0
 
 %if %{with_unofficial_po}
 %define japo_dir wesnoth-1.8.5ja-catalogs-%{po_date}
@@ -179,115 +140,81 @@ popd
 %endif
 
 %build
-export CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" 
-
-%__mkdir build
-pushd build
-%{cmake} \
-    -DLOCALEDIR=%{_localedir} \
-    -DENABLE_FRIBIDI:BOOL=OFF \
-    -DENABLE_GAME:BOOL=ON \
-    -DENABLE_DESKTOP_ENTRY:BOOL=ON \
-    -DENABLE_NOTIFICATIONS:BOOL=ON \
-%if %{with_editor}
-    --enable-editor \ # FIXME
-%endif
-%if %{with_tools}
-    -DENABLE_TOOLS:BOOL=ON
-%endif
-%if %{with_campaignd}
-    -DENABLE_CAMPAIGN_SERVER:BOOL=ON \
-%endif
-%if %{with_wesnothd}
-    -DENABLE_SERVER:BOOL=ON \
-    -DFIFO_DIR=/var/run/wesnothd \
-    -DSERVER_GID=root \
-    -DSERVER_UID=root \
-%else
-    -DENABLE_SERVER:BOOL=OFF \
-%endif
-    ..
-    
-%{__make}
-popd
+scons wesnoth exploder cutter wesnothd campaignd \
+      prefix=%{_prefix} \
+      bindir=%{_bindir} \
+      libdir=%{_libdir} \
+      python_site_packages_dir=%{python_sitelib}/%{name} \
+      extra_flags_release="$RPM_OPT_FLAGS $RPM_LD_FLAGS" \
+      %{?_smp_mflags} || exit 1
+
+      # localedirname=locale \
 
 %install
 %{__rm} -rf ${RPM_BUILD_ROOT}
-pushd build
-%{__make} DESTDIR=${RPM_BUILD_ROOT} install 
+scons install install-pytools destdir=$RPM_BUILD_ROOT
 
-### link sazanami-gothic.ttf
-pushd ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fonts/
+### for wesnothd server
+## extra files we provide
+install -Dpm 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initrddir}/wesnothd
+install -Dpm 644 %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/wesnoth
+
+## create this so we can %ghost it
+mkdir -p ${RPM_BUILD_ROOT}/var/run/wesnothd
+touch ${RPM_BUILD_ROOT}/var/run/wesnothd/socket
+
+## move server stuff into sbindir
+mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
+mv $RPM_BUILD_ROOT/%{_bindir}/wesnothd $RPM_BUILD_ROOT/%{_sbindir}
+mv $RPM_BUILD_ROOT/%{_bindir}/campaignd $RPM_BUILD_ROOT/%{_sbindir}
+
+
+### Wesnoth ships its own fonts, replace with Vine Linux packaged versions
 ## for 1.2.7 or higher (contains sazanami-gothic.ttf)
-#%{__rm} -f sazanami-gothic.ttf
 ## for 1.6a or higher (NOT contains sazanami-gothic.ttf)
-%{__rm} -f wqy-zenhei.ttc
-
-ln -s /usr/share/fonts/TrueType-vlgothic/VL-PGothic-Regular.ttf sazanami-gothic.ttf
-ln -s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf wqy-zenhei.ttc
+rm -f $RPM_BUILD_ROOT/%{_datadir}/%{name}/fonts/*
+pushd ${RPM_BUILD_ROOT}%{_datadir}/%{name}/fonts/
+%__ln_s /usr/share/fonts/TrueType-dejavu/DejaVuSans.ttf           DejaVuSans.ttf || exit 1
+%__ln_s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf  sazanami-gothic.ttf || exit 1
+%__ln_s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf  wqy-zenhei.ttc || exit 1
+%__ln_s /usr/share/fonts/TrueType-droid/DroidSansFallbackFull.ttf . || exit 1
+%__ln_s /usr/share/fonts/TrueType-droid/DroidSansJapanese.ttf     . || exit 1
 popd
 
-### for Gnome menu
-%__mkdir_p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
-
-desktop-file-install \
-    --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
-    --mode="0644" --vendor vine \
-    ../icons/%{name}.desktop
-#%__install -m 644 icons/%{name}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
-for size in 16x16 20x20 22x22 24x24 32x32 36x36 64x64 48x48 64x64 72x72 96x96 128x128 192x192 ; do
+### Register as an application to be visible in the software center
+##
+## NOTE: It would be *awesome* if this file was maintained by the upstream
+## project, translated and installed into the right place during `make install`.
+##
+## See http://www.freedesktop.org/software/appstream/docs/ for more details.
+##
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
+cp %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml
+
+
+# ### for Gnome menu
+# %__mkdir_p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
+
+# desktop-file-install \
+#     --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
+#     --mode="0644" --vendor vine \
+#     ../icons/%{name}.desktop
+# #%__install -m 644 icons/%{name}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
+for size in 16x16 20x20 22x22 24x24 32x32 36x36 64x64 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512; do
     %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${size}/apps
-    convert ../icons/%{name}-icon.png -size ${size} \
+    convert icons/%{name}-icon.png -size ${size} \
 	$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${size}/apps/%{name}-icon.png
 done
-%if %{with_editor}
-desktop-file-install \
-    --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
-    --mode="0644" --vendor vine \
-    ../icons/%{name}_editor.desktop
-%__install -m 644 icons/%{name}_editor-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
-%endif
-
-### rename for tools
-%if %{with_tools}
-pushd ${RPM_BUILD_ROOT}%{_bindir}/
-mv cutter %{name}_cutter
-mv exploder %{name}_exploder 
-popd
-%endif
-
-### for wesnothd server
-%if %{with_wesnothd} 
-mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
-mv ${RPM_BUILD_ROOT}%{_bindir}/wesnothd ${RPM_BUILD_ROOT}%{_sbindir}
-mkdir -p ${RPM_BUILD_ROOT}/var/run/wesnothd
-touch ${RPM_BUILD_ROOT}/var/run/wesnothd/socket
-install -Dpm 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initrddir}/wesnothd
-install -Dpm 644 %{SOURCE2} ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/wesnoth
-%endif
 
+# desktop-file-install \
+#     --dir $RPM_BUILD_ROOT/%{_datadir}/applications \
+#     --mode="0644" --vendor vine \
+#     ../icons/%{name}_editor.desktop
+# %__install -m 644 icons/%{name}_editor-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps
 
-### remove unpackage files
-%if !%{with_editor}
-%{__rm} -f ${RPM_BUILD_ROOT}%{_localedir}/*/LC_MESSAGES/wesnoth-editor.mo
-%endif
+### language stuff
+%find_lang %{name} --all-name --with-man
 
-find $RPM_BUILD_ROOT -name ".cvs*" | xargs rm -f
-find $RPM_BUILD_ROOT -name "CVS" | xargs rm -rf
-
-%{__rm} -rf $RPM_BUILD_ROOT/usr/share/doc/wesnoth/
-%{__rm} -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth-icon.png \
-    $RPM_BUILD_ROOT/usr/share/pixmaps/wesnoth-icon.png \
-    $RPM_BUILD_ROOT/usr/share/icons/wesnoth_editor-icon.png
-%{__rm} -f $RPM_BUILD_ROOT/usr/share/applications/wesnoth*.desktop
-%if !%{with_wesnothd}
-%{__rm} -f $RPM_BUILD_ROOT/%{_mandir}/man6/wesnothd.*
-%{__rm} -f $RPM_BUILD_ROOT/%{_mandir}/*/man6/wesnothd.*
-%endif
-
-%find_lang %{name} --all-name
-
-popd
 
 %clean
 %{__rm} -rf ${RPM_BUILD_ROOT}
@@ -307,7 +234,7 @@ if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
 fi
 
-%if %{with_wesnothd}
+
 %pre server
 /usr/sbin/useradd -c "Wesnoth server" -s /sbin/nologin \
 	-r -d /var/run/wesnothd wesnothd 2> /dev/null || :
@@ -323,61 +250,47 @@ if [ $1 -eq 0 ]; then
     %{_initrddir}/wesnothd stop >/dev/null 2>&1 || :
     /sbin/chkconfig --del wesnothd
 fi
-%endif
 
 
-%files -f build/%{name}.lang
+%files -f %{name}.lang
 %defattr(-,root,root)
-%doc COPYING INSTALL README changelog copyright doc/manual/
+%doc COPYING changelog README.md copyright
+%docdir %{_docdir}/wesnoth
+%{_docdir}/wesnoth
 %{_bindir}/%{name}
-%{_mandir}/man6/wesnoth.*
-%{_mandir}/*/man6/wesnoth.*
 %{_datadir}/%{name}
-%{_datadir}/applications/vine-wesnoth.desktop
-#%{_datadir}/pixmaps/wesnoth-icon.png
-%{_datadir}/icons/hicolor/*/apps/*.png
-
-%if %{with_editor}
-%files editor
-%defattr(-,root,root)
-%{_bindir}/wesnoth_editor
-%{_mandir}/man6/wesnoth_editor.*
-%{_mandir}/*/man6/wesnoth_editor.*
-%{_localedir}/*/LC_MESSAGES/wesnoth-editor.mo
-%{_datadir}/applications/vine-wesnoth_editor.desktop
-%{_datadir}/pixmaps/wesnoth_editor-icon.png
-%endif
+%{_datadir}/appdata/%{name}.appdata.xml
+%{_datadir}/applications/wesnoth.desktop
+%{_datadir}/wesnoth/fonts/*
+%{_datadir}/icons/*
+%{python_sitelib}/wesnoth
+%{_mandir}/man6/wesnoth*.6.gz
+%{_mandir}/*/man6/wesnoth*.6.gz
 
-%if %{with_tools}
 %files tools
 %defattr(-,root,root)
-#%{_bindir}/cutter
-#%{_bindir}/exploder
-%{_bindir}/wesnoth_cutter
-%{_bindir}/wesnoth_exploder
-%endif
+%{_bindir}/wesnoth_addon_manager
+%{_bindir}/exploder
+%{_bindir}/cutter
+%{_bindir}/wml*
 
-%if %{with_campaignd}
-%files campaign-server
-%defattr(-,root,root)
-%{_bindir}/campaignd
-%endif
-
-%if %{with_wesnothd}
 %files server
 %defattr(-,root,root)
-%config %{_initrddir}/wesnothd
+%{_initrddir}/wesnothd
 %config(noreplace) %{_sysconfdir}/sysconfig/wesnoth
-#%{_bindir}/wesnothd
 %{_sbindir}/wesnothd
-%{_mandir}/man6/wesnothd.*
-%{_mandir}/*/man6/wesnothd.*
+%{_sbindir}/campaignd
 %attr(0700,wesnothd,wesnothd) %dir /var/run/wesnothd/
 %ghost /var/run/wesnothd/socket
-%endif
 
 
 %changelog
+* Thu Jan 21 2016 Munehiro Yamamoto <munepi@vinelinux.org> 1.12.5
+- new upstream release
+- Wesnoth ships its own fonts, replace with Vine Linux packaged versions
+  - Requires: TrueType-vlgothic TrueType-dejavu-sans TrueType-droid-sans
+- supported server, tools packages
+
 * Fri Dec 20 2013 IWAI, Masaharu <iwaim.sub@gmail.com> 1.10.7-1
 - update to 1.10.7