File pysol.spec of Package pysol
#
# spec file for package pysol (Version 4.82)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: pysol
BuildRequires: SDL-devel python-devel python-tk update-desktop-files xorg-x11
License: GPLv2+
Group: Amusements/Games/Board/Card
%define pyver %(python -c 'import sys; print sys.version[:3]')
Requires: python-tk, python >= %pyver, python < %{pyver}.99
Requires: %{name}-cardsets
AutoReqProv: on
Summary: Nice solitaire game
Version: 4.82
Release: 442
%define dataversion 4.40
%define soundversion 3.00
Url: http://www.pysol.org/
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}-%{version}-src.tar.bz2
Source2: %{name}-cardsets-%{dataversion}.tar.bz2
Source3: %{name}-music-%{dataversion}.tar.bz2
Source4: %{name}-sound-server-%{soundversion}.tar.bz2
Source5: PySol.desktop
Patch0: pysol-4.82-colorchooser.patch
Patch1: pysol-smpeg.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
%description
PySol is an X11 solitaire game with a number of nice features,
including hints, autoplay, unlimited undo, player statistics, demo
mode, selectable card set and background graphics, and integrated help.
It currently plays over one hundred different games and variants, and
has a plug-in architecture which makes adding more easy.
Authors:
--------
Markus F.X.J. Oberhumer <markus.oberhumer@jk.uni-linz.ac.at>
%package cardsets
License: GPLv2+
Summary: Nice solitaire game - Cardsets
Group: Amusements/Games/Board/Card
Version: %{dataversion}
Release: 1
%description cardsets
PySol is an X11 solitaire game with a number of nice features,
including hints, autoplay, unlimited undo, player statistics, demo
mode, selectable card set and background graphics, and integrated help.
It currently plays over one hundred different games and variants, and
has a plug-in architecture which makes adding more easy.
This package provides cardsets for the game.
Authors:
--------
Markus F.X.J. Oberhumer <markus.oberhumer@jk.uni-linz.ac.at>
%prep
%setup -q -b 1 -b 2 -b 3 -b 4
%patch0
if [ ! -f /usr/%_lib/libsmpeg.a ] ; then
pushd ../pysol-sound-server*
%patch1
popd
fi
%build
rm -f data/*.pyc
python -u -t -c "import compileall; compileall.compile_dir('./src',ddir='/usr/share/games/pysol/src' )"
cp -a ../%{name}-music-%{dataversion}/data/ .
cp -a ../%{name}-cardsets-%{dataversion}/data/ .
#
# soundserver
#
cd ../%{name}-sound-server-%{soundversion}/src
export CFLAGS="$RPM_OPT_FLAGS"
./configure --mandir=%{_mandir} --prefix=/usr --infodir=%{_infodir} --sysconfdir=%{_sysconfdir}
test -f config.h || ln -sf conf.h config.h
make
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{/usr/{share/games/pysol,bin,share/pixmaps},%{_mandir}/man6/,%{_docdir}}
install -d $RPM_BUILD_ROOT/%pysite
mv src $RPM_BUILD_ROOT/usr/share/games/pysol/
cp COPYING data/html/
mv data $RPM_BUILD_ROOT/usr/share/games/pysol/
(cd $RPM_BUILD_ROOT/usr/share/pixmaps/; ln -s ../games/pysol/data/pysol.xpm)
#
# docs
#
install -m644 pysol.6 $RPM_BUILD_ROOT/%{_mandir}/man6/
gzip -9 $RPM_BUILD_ROOT/%{_mandir}/man6/pysol.6
install -d $RPM_BUILD_ROOT/%{_docdir}/%{name}
ln -s /usr/share/games/pysol/data/html $RPM_BUILD_ROOT/%{_docdir}/%{name}/html
install -m 644 README NEWS COPYING $RPM_BUILD_ROOT/%{_docdir}/%{name}/
#
# soundserver
#
cd ../%{name}-sound-server-%{soundversion}/src
cp -v build/lib.*/* $RPM_BUILD_ROOT/%pysite
#
# exec
#
echo -e "#!/bin/sh\npython /usr/share/games/pysol/src/pysol.py" >$RPM_BUILD_ROOT/usr/bin/pysol
chmod +x $RPM_BUILD_ROOT/usr/bin/pysol
#
# desktop file
#
%suse_update_desktop_file -i PySol Game CardGame
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc %{_docdir}/pysol
%{_datadir}/games/pysol
%{_datadir}/pixmaps/pysol.xpm
%{_bindir}/pysol
%{_datadir}/applications/PySol.desktop
%pysite/*
%attr(644,root,root) %doc %{_mandir}/man6/pysol.6.gz
%exclude %{_datadir}/games/pysol/data/cardset-*
%files cardsets
%defattr(-,root,root)
%dir %{_datadir}/games/pysol
%dir %{_datadir}/games/pysol/data
%{_datadir}/games/pysol/data/cardset-*
%changelog