From f441be602a23631235e0b142ab7d55e8e98e78ce Mon Sep 17 00:00:00 2001 From: Jon Ciesla Date: Aug 12 2013 16:56:28 +0000 Subject: Spec cleanup. --- diff --git a/wesnoth-1.3.16-remove-ogg-test.patch b/wesnoth-1.3.16-remove-ogg-test.patch deleted file mode 100644 index 2d69cd9..0000000 --- a/wesnoth-1.3.16-remove-ogg-test.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- configure.ac 2008-02-22 14:10:36.000000000 -0600 -+++ configure.ac 2008-02-22 14:10:36.000000000 -0600 -@@ -890,23 +890,6 @@ - LIBS="$LIBS $SDL_LIBS $SDL_MIXER_LIBS" - - ac_link="$LDPREFIX $ac_link" -- AC_RUN_IFELSE([AC_LANG_SOURCE([ -- #include -- #include -- -- int main(int argc, char **argv) -- { -- Mix_Music* music = Mix_LoadMUS("data/core/music/main_menu.ogg"); -- if (music == NULL) -- exit(1); -- exit(0); -- } -- ])], -- [AC_MSG_RESULT(yes)], -- [AC_MSG_RESULT(no)] -- [AC_MSG_ERROR([*** SDL_mixer has no OGG support! You need SDL_mixer with OGG support])], -- [AC_MSG_RESULT([not tested in cross-compiling])]) -- - - CPPFLAGS=$OLD_CPPFLAGS - CFLAGS=$OLD_CFLAGS diff --git a/wesnoth-1.5.11-remove-ogg-test.patch b/wesnoth-1.5.11-remove-ogg-test.patch deleted file mode 100644 index 55792bf..0000000 --- a/wesnoth-1.5.11-remove-ogg-test.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- configure.ac~ 2009-02-02 13:31:10.000000000 -0600 -+++ configure.ac 2009-02-02 13:31:10.000000000 -0600 -@@ -877,17 +876,0 @@ -- AC_RUN_IFELSE([AC_LANG_SOURCE([ -- #include -- #include -- -- int main(int argc, char **argv) -- { -- Mix_Music* music = Mix_LoadMUS("data/core/music/main_menu.ogg"); -- if (music == NULL) -- exit(1); -- exit(0); -- } -- ])], -- [AC_MSG_RESULT(yes)], -- [AC_MSG_RESULT(no)] -- [AC_MSG_ERROR([*** SDL_mixer has no OGG support! You need SDL_mixer with OGG support])], -- [AC_MSG_RESULT([not tested in cross-compiling])]) -- diff --git a/wesnoth-1.6.4-fribidi.patch b/wesnoth-1.6.4-fribidi.patch deleted file mode 100644 index 2a7c029..0000000 --- a/wesnoth-1.6.4-fribidi.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- configure.ac 2009-06-08 00:24:52.604753218 +0300 -+++ configure.ac 2009-06-08 00:25:05.257753171 +0300 -@@ -404,19 +404,7 @@ fi - - # fribidi-config - --AC_PATH_PROGS([FRIBIDI_CONFIG], [fribidi-config], [none]) -- --if test "x$FRIBIDI_CONFIG" = "xnone"; then -- fribidifound=no -- AC_MSG_WARN([*** FRIBIDI not found.]) --else -- fribidifound=yes -- FRIBIDI_CFLAGS=`$FRIBIDI_CONFIG --cflags` -- FRIBIDI_LIBS=`$FRIBIDI_CONFIG --libs` --fi -- --AC_SUBST([FRIBIDI_CFLAGS]) --AC_SUBST([FRIBIDI_LIBS]) -+PKG_CHECK_MODULES([FRIBIDI], [fribidi],[fribidifound=yes],[fribidifound=no]) - AM_CONDITIONAL([FRIBIDI], [test "x$fribidifound" = xyes -a "x$fribidi" = xyes ]) - - # python ---- src/font.cpp 2009-03-15 18:50:42.000000000 +0200 -+++ src/font.cpp 2009-06-08 00:19:56.884753434 +0300 -@@ -50,9 +50,6 @@ - - #ifdef HAVE_FRIBIDI - #include -- --#else -- - #endif - - namespace { -@@ -467,16 +464,16 @@ private: - void text_surface::bidi_cvt() - { - char *c_str = const_cast(str_.c_str()); // fribidi forgot const... -- int len = str_.length(); -+ FriBidiStrIndex len = str_.length(); - FriBidiChar *bidi_logical = new FriBidiChar[len + 2]; - FriBidiChar *bidi_visual = new FriBidiChar[len + 2]; - char *utf8str = new char[4*len + 1]; //assume worst case here (all 4 Byte characters) - FriBidiCharType base_dir = FRIBIDI_TYPE_ON; -- int n; -+ FriBidiStrIndex n; - -- n = fribidi_utf8_to_unicode (c_str, len, bidi_logical); -+ n = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, c_str, len, bidi_logical); - fribidi_log2vis(bidi_logical, n, &base_dir, bidi_visual, NULL, NULL, NULL); -- fribidi_unicode_to_utf8 (bidi_visual, n, utf8str); -+ fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, bidi_visual, n, utf8str); - is_rtl_ = base_dir == FRIBIDI_TYPE_RTL; - str_ = std::string(utf8str); - delete[] bidi_logical; diff --git a/wesnoth-1.8.3-boost-iostreams.patch b/wesnoth-1.8.3-boost-iostreams.patch deleted file mode 100644 index 5d2d81e..0000000 --- a/wesnoth-1.8.3-boost-iostreams.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur wesnoth-1.8.3-orig/m4/boost.m4 wesnoth-1.8.3/m4/boost.m4 ---- wesnoth-1.8.3-orig/m4/boost.m4 2010-05-27 09:42:52.000000000 +0200 -+++ wesnoth-1.8.3/m4/boost.m4 2010-08-05 19:23:54.000000000 +0200 -@@ -463,7 +463,7 @@ - AC_DEFUN([BOOST_IOSTREAMS], - [BOOST_FIND_LIB([iostreams], [$1], - [boost/iostreams/device/file_descriptor.hpp], -- [boost::iostreams::file_descriptor fd(0); fd.close();]) -+ [boost::iostreams::file_descriptor fd(""); fd.close();]) - ])# BOOST_IOSTREAMS - - diff --git a/wesnoth-1.8.5-cstddef.patch b/wesnoth-1.8.5-cstddef.patch deleted file mode 100644 index 1ef9005..0000000 --- a/wesnoth-1.8.5-cstddef.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- src/server/simple_wml.hpp~ 2009-10-08 14:38:22.000000000 -0500 -+++ src/server/simple_wml.hpp 2011-02-07 14:40:02.992527013 -0600 -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - - namespace simple_wml { - diff --git a/wesnoth-1.8.6-boost-foreach.patch b/wesnoth-1.8.6-boost-foreach.patch deleted file mode 100644 index 5aee311..0000000 --- a/wesnoth-1.8.6-boost-foreach.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp~ 2011-07-21 23:05:56.594879049 +0200 -+++ wesnoth-1.8.6/src/gui/widgets/tree_view_node.cpp 2011-07-21 23:28:07.540358742 +0200 -@@ -238,6 +238,17 @@ void ttree_view_node::clear() - - struct ttree_view_node_implementation - { -+ template -+ static W* find_at_aux(It begin, It end, -+ const tpoint& coordinate, const bool must_be_active) { -+ for (It it = begin; it != end; ++it) { -+ if(W* widget = it->find_at(coordinate, must_be_active)) { -+ return widget; -+ } -+ } -+ return NULL; -+ } -+ - template - static W* find_at( - typename tconst_duplicator::type& -@@ -255,13 +266,9 @@ struct ttree_view_node_implementation - } - - typedef typename tconst_duplicator::type thack; -- foreach(thack& node, tree_view_node.children_) { -- if(W* widget = node.find_at(coordinate, must_be_active)) { -- return widget; -- } -- } -- -- return NULL; -+ return find_at_aux(tree_view_node.children_.begin(), -+ tree_view_node.children_.end(), -+ coordinate, must_be_active); - } - }; - -@@ -313,7 +320,9 @@ tpoint ttree_view_node::get_current_size - return size; - } - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; -@@ -344,7 +353,9 @@ tpoint ttree_view_node::get_unfolded_siz - size.x += (get_indention_level() - 1) * tree_view().indention_step_size_; - } - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; -@@ -378,7 +389,9 @@ tpoint ttree_view_node::calculate_best_s - - DBG_GUI_L << LOG_HEADER << " own grid best size " << best_size << ".\n"; - -- foreach(const ttree_view_node& node, children_) { -+ for (boost::ptr_vector::const_iterator it -+ = children_.begin (); it != children_.end (); ++it) { -+ const ttree_view_node& node = *it; - - if(node.grid_.get_visible() == twidget::INVISIBLE) { - continue; diff --git a/wesnoth.spec b/wesnoth.spec index 7dc15fb..5a04ac2 100644 --- a/wesnoth.spec +++ b/wesnoth.spec @@ -3,7 +3,7 @@ Name: wesnoth Version: 1.10.6 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Turn-based strategy game with a fantasy theme Group: Amusements/Games @@ -13,12 +13,6 @@ Source0: http://www.%{name}.org/files/%{name}-%{version}.tar.bz2 Source1: wesnothd.service Source2: %{name}.sysconfig Patch0: %{name}-1.2.8-gcc43.patch -#Patch1: wesnoth-1.5.11-remove-ogg-test.patch -#Patch2: wesnoth-1.6.4-fribidi.patch -#Patch3: wesnoth-1.8.3-boost-iostreams.patch -#Patch4: wesnoth-1.8.5-cstddef.patch -#Patch5: wesnoth-1.8.6-boost-foreach.patch -#Patch6: wesnoth-libpng15.patch Patch7: wesnoth-1.10.6-crash.patch Requires: wesnoth-data = %{version} @@ -36,9 +30,6 @@ BuildRequires: boost-devel BuildRequires: pango-devel BuildRequires: lua-devel BuildRequires: scons -# Drop these when ogg test patch is removed. -#BuildRequires: autoconf -#BuildRequires: automake %description The Battle for Wesnoth is a turn-based strategy game with a fantasy theme. @@ -62,14 +53,10 @@ friends--or strangers--and fight multi-player epic fantasy battles. Summary: %{summary} Group: Amusements/Games Requires: %{name} = %{version}-%{release} -#Requires(post): /sbin/chkconfig -#Requires(preun):/sbin/chkconfig Requires(pre): /usr/sbin/useradd -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -Requires(post): systemd-sysv - +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd %description server This package contains the binaries for running a Wesnoth server @@ -90,6 +77,9 @@ This package contains the game editor and development tools. Summary: %{summary} Group: Amusements/Games Requires: %{name} = %{version} +Requires: dejavu-sans-fonts +Requires: sazanami-gothic-fonts +Requires: wqy-zenhei-fonts BuildArch: noarch %description data @@ -99,75 +89,32 @@ This package contains the data files for Wesnoth. %prep %setup -qn wesnoth-%{version} %patch0 -p1 -b .gcc43 -#%patch1 -p0 -#%patch2 -p0 -#%patch3 -p1 -b .boost-iostreams -#%patch4 -p0 -b .cstddef -#%patch5 -p1 -b .boost-foreach -#%patch6 -p0 -b .libpng %patch7 -p0 -b .crash %build -# Cannot use configure macro because noarch-redhat-linux is not recognized by the auto tools in the tarball -export CFLAGS="$RPM_OPT_FLAGS" -export CXXFLAGS="$RPM_OPT_FLAGS" -export LDFLAGS="%{?__global_ldflags}" -#./configure --prefix=%{_prefix} --exec-prefix=%{_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} \ -# --disable-dependency-tracking \ -# --with-localedir=%{_datadir}/locale \ -# --enable-editor \ -# --enable-tools \ -# --enable-server \ -# --enable-python \ -# --with-fifodir=/var/run/wesnothd \ -# --with-server-uid=$(id -u) \ -# --with-server-gid=$(id -g) \ -# --disable-strict-compilation - -##%%cmake . -DCMAKE_INSTALL_PREFIX=${RPM_BUILD_ROOT}%{_prefix} -DDATAROOTDIR=%{_datadir} -DBINDIR=%{_bindir} -DENABLE_TOOLS=ON -DSERVER_UID=$(id -u) -DSERVER_GID=$(id -g) -DCMAKE_INSTALL_PREFIX=%{RPM_BUILD_ROOT} -DENABLE_NLS=ON -%ifnarch noarch -#make %{?_smp_mflags} -scons all prefix=/usr -%endif +scons all prefix=%{_prefix} \ + bindir=%{_bindir} \ + libdir=%{_libdir} \ + localedirname=locale \ + python_site_packages_dir=%{python_sitelib}/%{name} \ + extra_flags_release="$RPM_OPT_FLAGS $RPM_LD_FLAGS" \ + %{?_smp_mflags} %install -#make install -mkdir -p $RPM_BUILD_ROOT/%{_bindir} +rm -rf $RPM_BUILD_ROOT +scons install install-pytools destdir=$RPM_BUILD_ROOT + +# extra files we provide +install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/wesnothd.service +install -Dpm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wesnoth + +# create this so we can %ghost it +touch ${RPM_BUILD_ROOT}/var/run/wesnothd/socket + +# move server stuff into sbindir mkdir -p $RPM_BUILD_ROOT/%{_sbindir} -for i in cutter exploder wesnoth; do - cp -p $i $RPM_BUILD_ROOT/%{_bindir}/ -done -cp wesnothd $RPM_BUILD_ROOT/%{_sbindir}/ -pushd data -pushd tools -for i in wesnoth_addon_manager wml*; do - cp -p $i $RPM_BUILD_ROOT/%{_bindir}/ -done -popd -popd - -#%ifarch noarch -### Data Files and Desktop Files -#make install-data DESTDIR=${RPM_BUILD_ROOT} -#Python modules for tools -mkdir -p $RPM_BUILD_ROOT%{python_sitelib} -mv data/tools/wesnoth $RPM_BUILD_ROOT%{python_sitelib} - -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/wesnoth -for i in data fonts icons images sounds; do - cp -pr $i $RPM_BUILD_ROOT/%{_datadir}/wesnoth/ -done -rm -rf $RPM_BUILD_ROOT%{_datadir}/applications - -desktop-file-install --dir $RPM_BUILD_ROOT/%{_datadir}/applications \ - --mode="0644" \ - --remove-key="Version" \ - icons/%{name}.desktop - -# add icon for menus -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps -ln -sf ../wesnoth/icons/%{name}-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps -ln -sf ../wesnoth/icons/%{name}_editor-icon.png $RPM_BUILD_ROOT/%{_datadir}/pixmaps +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 Fedora packaged versions rm -f $RPM_BUILD_ROOT/%{_datadir}/fonts/* @@ -175,76 +122,14 @@ mkdir -p $RPM_BUILD_ROOT/%{_datadir}/fonts # dejavu-fonts ln -s /usr/share/fonts/dejavu/DejaVuSans.ttf $RPM_BUILD_ROOT/%{_datadir}/fonts/DejaVuSans.ttf # sazanami-fonts-gothic -ln -s /usr/share/fonts/sazanami-fonts-gothic/sazanami-gothic.ttf $RPM_BUILD_ROOT/%{_datadir}/fonts/sazanami-gothic.ttf +ln -s /usr/share/fonts/sazanami-fonts-gothic/sazanami-gothic.ttf $RPM_BUILD_ROOT/%{_datadir}/fonts/sazanami-gothic.t # wqy-zenhei-fonts ln -s /usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc $RPM_BUILD_ROOT/%{_datadir}/fonts/wqy-zenhei.ttc -#So find_lang will work. . . -mkdir -p $RPM_BUILD_ROOT/%{_datadir}/locale -cp -pr translations/* $RPM_BUILD_ROOT/%{_datadir}/locale/ - -#So wesnoth can still find the translations. . . -ln -s %{_datadir}/locale/ $RPM_BUILD_ROOT/%{_datadir}/wesnoth/translations - -mkdir -p $RPM_BUILD_ROOT/%{_mandir} -pushd doc -pushd man - - rm CMakeLists.txt - - for d in $(dirname */*.6 | sort -u); do - pushd $d - mkdir man6 - mv *.6 man6 - popd - done - - mkdir man6 - mv *.6 man6 - -popd -popd - -cp -pr doc/man/* $RPM_BUILD_ROOT/%{_mandir} -find $RPM_BUILD_ROOT/%{_mandir} -name '*.6' | xargs gzip - -%find_lang %{name}*.\* - -#%else -### Binaries and Config Files -#make install-exec DESTDIR=${RPM_BUILD_ROOT} - -desktop-file-install --dir $RPM_BUILD_ROOT/%{_datadir}/applications \ - --mode="0644" --vendor fedora \ - --remove-key="Version" \ - icons/%{name}_editor.desktop - -# arrange server package files -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%{_unitdir}/wesnothd.service -install -Dpm 644 %{SOURCE2} \ - $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/wesnoth - -#%endif - -### Cleanup Stuff -rm -f $RPM_BUILD_ROOT/usr/share/wesnoth/icons/*.desktop - -find $RPM_BUILD_ROOT -name ".cvs*" | xargs rm -f -find $RPM_BUILD_ROOT -name "CVS" | xargs rm -rf -find $RPM_BUILD_ROOT/ -name 'Makefile*' |xargs rm -f -rm -rf $RPM_BUILD_ROOT/usr/share/doc/wesnoth/ -rm -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth-icon.png -rm -f $RPM_BUILD_ROOT/usr/share/icons/wesnoth_editor-icon.png -rm -f $RPM_BUILD_ROOT/usr/share/applications/fedora-wesnoth_editor.desktop +# language stuff +%find_lang %{name} LANGFILES --with-man - -#%ifarch noarch %post touch --no-create %{_datadir}/icons/hicolor || : if [ -x %{_bindir}/gtk-update-icon-cache ]; then @@ -256,93 +141,57 @@ touch --no-create %{_datadir}/icons/hicolor || : if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : fi -#%endif -#%ifnarch noarch %pre server /usr/sbin/useradd -c "Wesnoth server" -s /sbin/nologin \ -r -d /var/run/wesnothd wesnothd 2> /dev/null || : %post server -#/sbin/chkconfig --add wesnothd -#if [ $1 -gt 1 ]; then -# %%{_initrddir}/wesnothd try-restart >/dev/null || : -#fi -if [ $1 -eq 1 ] ; then - # Initial installation - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi - - +%systemd_post wesnothd.service %preun server -#if [ $1 -eq 0 ]; then -# %%{_initrddir}/wesnothd stop >/dev/null 2>&1 || : -# /sbin/chkconfig --del wesnothd -#fi -if [ $1 -eq 0 ] ; then - # Package removal, not upgrade - /bin/systemctl --no-reload disable wesnothd.service > /dev/null 2>&1 || : - /bin/systemctl stop wesnothd.service > /dev/null 2>&1 || : -fi +%systemd_preun wesnothd.service %postun server -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then - # Package upgrade, not uninstall - /bin/systemctl try-restart wesnothd.service >/dev/null 2>&1 || : -fi - - -#%endif +%systemd_postun_with_restart wesnothd.service -%triggerun -- wesnoth-server < 1.10-2 -# Save the current service runlevel info -# User must manually run systemd-sysv-convert --apply wesnothd -# to migrate them to systemd targets -/usr/bin/systemd-sysv-convert --save wesnothd >/dev/null 2>&1 ||: -# Run these because the SysV package being removed won't do them -/sbin/chkconfig --del wesnothd >/dev/null 2>&1 || : -/bin/systemctl try-restart wesnothd.service >/dev/null 2>&1 || : - - -#%ifnarch noarch %files -%doc COPYING changelog README copyright doc/manual/ +%doc COPYING changelog README copyright +%docdir %{_docdir}/wesnoth +%{_docdir}/wesnoth %{_bindir}/%{name} %files tools -#%{_bindir}/wesnoth_editor %{_bindir}/wesnoth_addon_manager %{_bindir}/exploder %{_bindir}/cutter %{_bindir}/wml* -#%{_datadir}/applications/wesnoth_editor.desktop %files server -#%%config %%{_initrddir}/wesnothd %{_unitdir}/wesnothd.service %config(noreplace) %{_sysconfdir}/sysconfig/wesnoth %{_sbindir}/wesnothd +%{_sbindir}/campaignd %attr(0700,wesnothd,wesnothd) %dir /var/run/wesnothd/ %ghost /var/run/wesnothd/socket -#%endif -#%ifarch noarch -%files data -f %{name}*.*.lang +%files data -f LANGFILES %{_datadir}/%{name} %{_datadir}/applications/wesnoth.desktop -%{_datadir}/pixmaps/* %{_datadir}/fonts/* +%{_datadir}/icons/* %{python_sitelib}/wesnoth -%{_mandir}/man6/* -%{_mandir}/*/man6/* - -#%endif +%{_mandir}/man6/wesnoth*.6.gz +%{_mandir}/*/man6/wesnoth*.6.gz %changelog +* Mon Aug 12 2013 Jon Ciesla - 1.10.6-8 +- Spec cleanup, better scons build, BZ 991376. +- Add systemd macros, BZ 850365. +- Fix font requires. + * Thu Aug 01 2013 Jon Ciesla - 1.10.6-7 - Another man page fix attempt.