%define name civil %define Name Civil %define version 0.83 %define release %mkrel 10 %define title Civil %define longtitle American civil war simulation %define title_editor Civil Editor %define longtitle_editor Civil scenario editor Name: %{name} Version: %{version} Release: %{release} Summary: %{longtitle} License: GPL Group: Games/Strategy URL: http://civil.sourceforge.net Source0: http://prdownloads.sourceforge.net/civil/%{name}-%{version}.tar.bz2 Patch0: civil-0.83-python24.patch Patch1: civil-0.83-remove-broken-pygame-check.patch Requires: SDL >= 1.2 Requires: python >= 2.1 Requires: pygame >= 1.5.3 Requires: %{name}-graphics = %{version} Requires: %{name}-sounds = %{version} BuildRequires: python-devel BuildRequires: ImageMagick %description Civil is a game that simulates battles in the American Civil War. It is playable by two players over a network. Civil aims to be able to recreate battles in great detail. %package graphics Summary: Civil graphics Group: Games/Strategy Requires: %{name} = %{version} %description graphics Graphics for Civil, a simulation of the American Civil War. %package sounds Summary: Civil sounds Group: Games/Strategy Requires: %{name} = %{version} %description sounds Sounds for Civil, a simulation of the American Civil War. %package scenarios Summary: Civil sample scenarios Group: Games/Strategy Requires: %{name} = %{version} %description scenarios Some example scenarios for Civil, a simulation of the American Civil War. %package editor Summary: Civil scenario editor Group: Games/Strategy Requires: %{name} = %{version} Requires: python-PQueue %description editor Scenario editor for civil, a simulation of the American Civil War. %prep %setup -q %patch0 -p0 %patch1 -p1 -b .pygame # fix perms for file in AUTHORS BUGS ChangeLog INSTALL LICENSE README TODO; do chmod 644 $file; done # clean-up build files included in tarball rm -rf src/map/los/build # remove useless shellbang sed -i -e '1d' src/civil{,-editor,-ai,-lounge}.py %build %configure --bindir=%{_gamesbindir} --datadir=%{_gamesdatadir}/%{name} %make %install rm -rf %{buildroot} %makeinstall_std # help install -d %{buildroot}%{_gamesdatadir}/%{name}/doc/help install -m 644 doc/help/*.xml %{buildroot}%{_gamesdatadir}/%{name}/doc/help # icons convert gfx/periphery/civil-icon-48x48.png -resize 16x16 %{name}-16.png convert gfx/periphery/civil-icon-48x48.png -resize 32x32 %{name}-32.png convert gfx/periphery/civil-icon-48x48.png %{name}-48.png install -D -m 644 %{name}-48.png %{buildroot}%{_liconsdir}/%{name}.png install -D -m 644 %{name}-32.png %{buildroot}%{_iconsdir}/%{name}.png install -D -m 644 %{name}-16.png %{buildroot}%{_miconsdir}/%{name}.png install -D -m 644 %{name}-48.png %{buildroot}%{_liconsdir}/%{name}-editor.png install -D -m 644 %{name}-32.png %{buildroot}%{_iconsdir}/%{name}-editor.png install -D -m 644 %{name}-16.png %{buildroot}%{_miconsdir}/%{name}-editor.png # menu install -d -m 755 %{buildroot}%{_menudir} cat >%{buildroot}%{_menudir}/%{name} <<EOF ?package(%{name}): \ command="%{_gamesbindir}/%{name}" \ needs="X11" \ section="More Applications/Games/Strategy" \ icon="%{name}.png" \ title="%{title}" \ longtitle="%{longtitle}" \ xdg="true" EOF cat >%{buildroot}%{_menudir}/%{name}-editor <<EOF ?package(%{name}-editor): \ command="%{_gamesbindir}/%{name}-editor" \ needs="X11" \ section="More Applications/Games/Strategy" \ icon="%{name}-editor.png" \ title="%{title_editor}" \ longtitle="%{longtitle_editor}" \ xdg="true" EOF # drop provided desktop files, they are too much buggy rm -rf %{buildroot}%{_datadir}/applnk/Games/TacticStrategy/*.desktop install -d -m 755 %{buildroot}%{_datadir}/applications cat > %{buildroot}%{_datadir}/applications/mandriva-%{name}.desktop << EOF [Desktop Entry] Name=%{title} Comment=%{longtitle} Exec=%{_gamesbindir}/%{name} Icon=%{name} Terminal=false Type=Application StartupNotify=false Categories=StrategyGame; EOF cat > %{buildroot}%{_datadir}/applications/mandriva-%{name}-editor.desktop << EOF [Desktop Entry] Name=%{title_editor} Comment=%{longtitle_editor} Exec=%{_gamesbindir}/%{name}-editor Icon=%{name}-editor Terminal=false Type=Application StartupNotify=false Categories=StrategyGame; EOF ln -s %{_libdir}/python%{pyver}/site-packages/ccivil.so %{buildroot}/%{_gamesdatadir}/%{name}/src/map/los/ chmod ogu+x %{buildroot}/%{_gamesdatadir}/%{name}/src/civil-server.py # no longer works, miss some xml nodes rm -f %{buildroot}/%{_gamesdatadir}/%{name}/scenarios/chakie_test.civil %clean rm -rf %{buildroot} %post %{update_menus} %postun %{clean_menus} %post editor %{update_menus} %postun editor %{clean_menus} %files %defattr(-,root,root) %doc AUTHORS BUGS ChangeLog INSTALL LICENSE README TODO %{_gamesbindir}/%{name} %{_gamesbindir}/%{name}-ai %{_gamesbindir}/%{name}-lounge %dir %{_gamesdatadir}/%{name} %{_gamesdatadir}/%{name}/src %{_gamesdatadir}/%{name}/doc %py_platsitedir/* %{_mandir}/man6/* %{_menudir}/%{name} %{_datadir}/applications/mandriva-%{name}.desktop %{_iconsdir}/%{name}.png %{_miconsdir}/%{name}.png %{_liconsdir}/%{name}.png %files graphics %defattr(-,root,root) %{_gamesdatadir}/%{name}/fonts %{_gamesdatadir}/%{name}/gfx %files sounds %defattr(-,root,root) %{_gamesdatadir}/%{name}/sound %files scenarios %defattr(-,root,root) %{_gamesdatadir}/%{name}/scenarios %files editor %defattr(-,root,root) %{_gamesbindir}/%{name}-editor %{_menudir}/%{name}-editor %{_datadir}/applications/mandriva-%{name}-editor.desktop %{_iconsdir}/%{name}-editor.png %{_miconsdir}/%{name}-editor.png %{_liconsdir}/%{name}-editor.png %changelog * Tue Dec 18 2007 Guillaume Rousse <guillomovitch@mandriva.org> 0.83-10mdv2008.1 + Revision: 132415 - rebuild + Thierry Vignaud <tvignaud@mandriva.com> - kill re-definition of %%buildroot on Pixel's request - kill desktop-file-validate's error: string list key "Categories" in group "Desktop Entry" does not have a semicolon (";") as trailing character - kill desktop-file-validate's 'warning: key "Encoding" in group "Desktop Entry" is deprecated' * Wed Dec 13 2006 Nicolas Lécureuil <neoclust@mandriva.org> 0.83-9mdv2007.0 + Revision: 96498 - Rebuild against new python - Import civil * Tue Sep 12 2006 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 0.83-8mdv2007.0 - drop broken pygame check (P1) - cosmetics * Wed Aug 02 2006 Guillaume Rousse <guillomovitch@mandriva.org> 0.83-7mdv2007.0 - xdg menu * Thu May 11 2006 Thierry Vignaud <tvignaud@mandriva.com> 0.83-6mdk - patch 0: make it work with python-2.4 * Wed Dec 14 2005 Guillaume Rousse <guillomovitch@mandriva.org> 0.83-5mdk - %%mkrel - spec cleanup - remove some useless shellbangs * Sat Dec 04 2004 Michael Scherer <misc@mandrake.org> 0.83-4mdk - Rebuild for new python * Mon Nov 01 2004 Michael Scherer <misc@mandrake.org> 0.83-3mdk - Buildrequires * Wed Sep 29 2004 Michael Scherer <misc@mandrake.org> 0.83-2mdk - fix #11740, and other bugs * Fri Aug 27 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.83-1mdk - new version * Sat Jul 10 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.82-5mdk - rpmbuildupdate aware - fixed menu category * Mon Jan 12 2004 Guillaume Rousse <guillomovitch@mandrake.org> 0.82-4mdk - buildrequires (slbd)