Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%define debug_package %{nil}

%define cardsetversion 1.1

Name:           PySolFC
Version:        1.1
Release:        4%{?dist}
Summary:        A collection of solitare card games
Group:          Amusements/Games
License:        GPLv2+
URL:            http://pysolfc.sourceforge.net
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
Source1:        PySol.desktop
Source2:        pysol-start-script
Patch0:         pysolfc-setup.py-noglade.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch

# optional but nice to have
Requires:       python-imaging, tile
# really required
Requires:       tcl
Requires:       tk, tix, tkinter
Requires:       python-imaging-tk
BuildRequires:  python-devel
BuildRequires:  desktop-file-utils
Provides:       pysol = %{version}-%{release}

%description
%{name} is a collection of more than 1000 solitaire card games. It is a fork
of PySol solitare. Its features include modern look and feel (uses Tile widget
set), multiple cardsets and tableau backgrounds, sound, unlimited undo, player
statistics, a hint system, demo games, a solitaire wizard, support for user
written plug-ins, an integrated HTML help browser, and lots of documentation.

%prep
%setup -q
%patch0 -p0

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
# install desktop file
desktop-file-install --vendor="fedora" \
    --dir=$RPM_BUILD_ROOT/%{_datadir}/applications \
    %{SOURCE1}

# install the startup wrapper
mv $RPM_BUILD_ROOT%{_bindir}/pysol.py $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m755 %{SOURCE2} $RPM_BUILD_ROOT/%{_bindir}/pysol

%find_lang pysol

%clean
rm -rf $RPM_BUILD_ROOT

%files -f pysol.lang
%defattr(-,root,root)
%doc README PKG-INFO COPYING
%dir %{_datadir}/%{name}
%dir %{python_sitelib}/pysollib
%{python_sitelib}/pysollib/*
%{_bindir}/pysol
%{_datadir}/%{name}/*
%{_datadir}/pixmaps/*
%{_datadir}/applications/fedora-*.desktop


%changelog
* Thu Nov 1 2007 Stewart Adam <s.adam@diffingo.com> 1.1-4
- Provides: pysol since PySolFC is almost a drop-in replacement for
  the now unmaintained pysol

* Mon Oct 22 2007 Stewart Adam <s.adam@diffingo.com> 1.1-3
- s/python-imageing-tk/python-imaging-tk/

* Fri Oct 19 2007 Stewart Adam <s.adam@diffingo.com> 1.1-2
- Add Requires: python-imageing-tk

* Sat Sep 29 2007 Stewart Adam <s.adam@diffingo.com> 1.1-1
- Initial release