# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} #%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: xword Version: 1.0 Release: 5%{?dist} Summary: Reads and writes crossword puzzles in the Across Lite file format Group: Amusements/Games License: BSD URL: http://x-word.org/ Source0: http://x-word.org/%{name}-%{version}.tar.gz Source1: %{name}.desktop Source2: %{name}.xml Source3: %{name}.1 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: desktop-file-utils Requires: pygtk2 gnome-python2-gnomeprint BuildArch: noarch %description Xword is a GTK program that works well for doing crossword puzzles in the Across Lite file format used by The New York Times and others. As well as a clock, it supports printing. It also auto-saves puzzles as you solve them so that you can return to partially completed puzzles. %prep %setup -q sed -i -e "s|HOME_PATH = os\.path\.dirname(sys\.argv\[0\])|HOME_PATH = '%{_datadir}/%{name}-%{version}'|g" xword %build #nothing to build %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} install -d $RPM_BUILD_ROOT%{_bindir}/ install -d $RPM_BUILD_ROOT%{_mandir}/man1/ install -p -m 755 xword $RPM_BUILD_ROOT%{_bindir}/ install -p -m 644 layout-rtb.png $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} install -p -m 644 crossword-solve.png $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} install -p -m 644 crossword-clock.png $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} install -p -m 644 crossword-check.png $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} install -p -m 644 crossword-check-all.png $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version} #man page install -p -m 644 %SOURCE3 $RPM_BUILD_ROOT%{_mandir}/man1 #icon install mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/24x24/apps cp -p crossword-solve.png \ $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/24x24/apps/xword.png #desktop file desktop-file-install --dir=$RPM_BUILD_ROOT%{_datadir}/applications %SOURCE1 #mime file install -d $RPM_BUILD_ROOT%{_datadir}/mime/packages install -p -m 644 %SOURCE2 $RPM_BUILD_ROOT%{_datadir}/mime/packages/ %post touch --no-create %{_datadir}/icons/hicolor || : %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : update-desktop-database &> /dev/null || : update-mime-database %{_datadir}/mime &> /dev/null || : %postun touch --no-create %{_datadir}/icons/hicolor || : %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : update-desktop-database &> /dev/null || : update-mime-database %{_datadir}/mime &> /dev/null || : %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENSE %{_datadir}/%{name}-%{version} %{_datadir}/icons/hicolor/24x24/apps/xword.png %{_datadir}/applications/%{name}.desktop %{_bindir}/* %{_datadir}/mime/packages/* %{_mandir}/man1/* %changelog * Sun Apr 5 2009 Alex Eskin - 1.0-5 - Addressed the comments in the review by Mamoru Tasaka . Warning on python 2.6 will be addressed later. * Thu Nov 20 2008 Alex Eskin - 1.0-4 - Added LICENSE to %%doc * Wed Nov 10 2008 Alex Eskin - 1.0-3 - Fix a silly error involving $RPM_BUILD_ROOT. * Wed Nov 5 2008 Alex Eskin - 1.0-2 - Initial import.