File pysol.spec of Package pysol

#
# spec file for package pysol (Version 4.82)
#
# Copyright (c) 2008 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:        GPL v2 or later
Group:          Amusements/Games/Board/Card
%define pyver %(python -c 'import sys; print sys.version[:3]')
Requires:       python-tk, python >= %pyver, python < %{pyver}.99
AutoReqProv:    on
Summary:        Nice solitaire game
Version:        4.82
Release:        435
%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>

%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
/usr/share/games/pysol
/usr/share/pixmaps/pysol.xpm
/usr/bin/pysol
/usr/share/applications/PySol.desktop
%pysite/*
%attr(644,root,root) %doc %{_mandir}/man6/pysol.6.gz

%changelog
* Thu Nov 06 2008 ro@suse.de
- drop nosource
* Tue Nov 07 2006 ro@suse.de
- fix manpage permissions
* Thu Jun 22 2006 ro@suse.de
- remove selfprovides
* Fri Jan 27 2006 jmatejek@suse.cz
- use local copy of desktop file with a correct icon
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Feb 02 2005 ro@suse.de
- fix build
* Tue Nov 30 2004 mcihar@suse.cz
- let's include icon
* Thu Jul 01 2004 mcihar@suse.cz
- fixed crash, when selecting table color (bug #42650)
* Wed Mar 03 2004 mcihar@suse.cz
- make building a bit more quiet
- include some documentation
* Thu Oct 16 2003 mcihar@suse.cz
- removed icon from /usr/X11R6/include/X11/pixmaps
- do not use root for build
* Thu Sep 04 2003 mcihar@suse.cz
- updated to 4.82 which includes support for Python 2.3
* Thu Aug 28 2003 mcihar@suse.cz
- don't call directly compiled python file, but the source, that could
  cause problems when changed python version and not recompiled pysol
* Sat Aug 16 2003 adrian@suse.de
- use translated desktop file from kappfinder
* Wed Aug 13 2003 mcihar@suse.cz
- added desktop file
* Tue Jun 24 2003 mcihar@suse.cz
- builds correctly for current python
- versioned dependency on python
- byte compiled with ddir to produce meaningful error messages
- added XFree86 to neededforbuild (fixes unpackaged directories)
* Tue May 27 2003 mcihar@suse.cz
- fixed permissions for man page
* Mon Nov 11 2002 ro@suse.de
- removed python-tkinter from neededforbuild
* Mon Aug 12 2002 vinil@suse.cz
- new version: 4.81
* Fri Jun 07 2002 ro@suse.de
- create directory before installing into
* Thu Jun 06 2002 ro@suse.de
- fix build for lib64 using python's Makefile.pre.in
- fix libdir
* Fri Feb 15 2002 ro@suse.de
- use defattr
* Wed Jan 16 2002 ro@suse.de
- update to 4.80 / sound 4.50
- fixed sound server to compile
- move from /usr/games/pysol to /usr/share/games/pysol
* Wed Sep 12 2001 ro@suse.de
- marked cardsets and music as nosource, they are just copied anyway
* Thu Aug 16 2001 ro@suse.de
- changed neededforbuild <smpeg> to <smpeg smpeg-devel>
* Wed Aug 08 2001 ro@suse.de
- changed neededforbuild <sdl> to <SDL>
- changed neededforbuild <sdl-devel> to <SDL-devel>
* Mon Apr 23 2001 vinil@suse.cz
- optimalization removed; just bytecompile
* Fri Apr 20 2001 vinil@suse.cz
- fixed to work under SuSE -> the game is built from sources
  (not pre-compiled bins)
  |
  v
  independent on python version
- update -> 4.71
- needed for abuild fixed
* Wed Mar 07 2001 uli@suse.de
- update -> 4.70 (works with Python 2.0)
- soundserver update -> 2.40
* Wed Dec 06 2000 ro@suse.de
- fixed neededforbuild
* Tue Dec 05 2000 kukuk@suse.de
- Fix Requires (pyth_tk -> python-tk)
* Wed Sep 20 2000 msrex@suse.de
- update -> 4.60 (cardsets 4.40)
  now with fancy music and sounds :)
* Fri Jul 21 2000 uli@suse.de
- update -> 4.41 (cardsets 4.20)
* Thu Oct 28 1999 uli@suse.de
- update -> 2.99
* Fri Sep 17 1999 kettner@suse.de
- Reinserted old # Commandline: line.
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Sun Jul 18 1999 msrex@suse.de
- Spec file created from pysol-2.14.tar.gz by autospec
* Wed May 19 1999 msrex@suse.de
- Spec file created from pysol-2.13.tar.gz by autospec
openSUSE Build Service is sponsored by