[wesnoth] Spec cleanup.

Jon Ciesla limb at fedoraproject.org
Mon Aug 12 17:01:47 UTC 2013


commit f441be602a23631235e0b142ab7d55e8e98e78ce
Author: Jon Ciesla <limburgher at gmail.com>
Date:   Mon Aug 12 11:56:28 2013 -0500

    Spec cleanup.

 wesnoth-1.3.16-remove-ogg-test.patch |   26 ----
 wesnoth-1.5.11-remove-ogg-test.patch |   20 ---
 wesnoth-1.6.4-fribidi.patch          |   56 --------
 wesnoth-1.8.3-boost-iostreams.patch  |   12 --
 wesnoth-1.8.5-cstddef.patch          |   10 --
 wesnoth-1.8.6-boost-foreach.patch    |   70 ----------
 wesnoth.spec                         |  243 +++++++---------------------------
 7 files changed, 46 insertions(+), 391 deletions(-)
---
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 <limburgher at gmail.com> - 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 <limburgher at gmail.com> - 1.10.6-7
 - Another man page fix attempt.
 


More information about the scm-commits mailing list