Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > ff379b9450ea434d1de957e06db09f32 > files > 6

cultivation-9-13.mga5.src.rpm

%define Name    Cultivation

Name:		cultivation
Version:	9
Release:	%mkrel 13
Summary:	A game about the interactions within a gardening community
License:	Public Domain
Group:		Games/Strategy
URL:		http://cultivation.sourceforge.net/
Source0:	http://sourceforge.net/projects/cultivation/files/cultivation/v9/Cultivation_%{version}_UnixSource.tar.gz
Patch0:		Cultivation-9-deb-portaudio.patch
Patch1:		Cultivation-9-deb-portaudio19.patch
Patch2:		Cultivation-9-deb-math_h.patch
Patch3:		Cultivation-9-upstream-fix_crash.patch
#Patch4:		Cultivation-9-mageia-build64bit.patch
BuildRequires:	mesaglu-devel
BuildRequires:	freeglut-devel
BuildRequires:	portaudio-devel
BuildRequires:	png-devel
BuildRequires:	imagemagick
Requires:	soundwrapper

%description
Cultivation is a game about a community of gardeners growing food
for themselves in a shared space.

Cultivation is quite different from most other games. It is a
social simulation, and the primary form of conflict is over land
and plant resources --- there is no shooting, but there are plenty
of angry looks. It is also an evolution simulation. Within the
world of Cultivation, you can explore a virtually infinite
spectrum of different plant and gardener varieties.

All of the graphics, sounds, melodies,and other content in
Cultivation are 100% procedurally generated at playtime. In other
words, there are no hand-painted texture maps --- instead, each
object has a uniquely 'grown' appearance. Every time you play,
Cultivation generates fresh visuals, music, and behaviors.


%prep
%setup -q -n %{Name}_%{version}_UnixSource
%apply_patches

%build

export CFLAGS="$RPM_OPT_FLAGS -fPIC -DPIC"
pushd game2
	chmod u+x configure
	./configure --linux
popd
	convert -type Grayscale -negate ./game2/build/macOSX/icon128_mask.png mask.png
	composite -compose CopyOpacity mask.png ./game2/build/macOSX/icon128_color.png cultivation.png
	mkdir -p 32x32
	convert -scale 32x32 cultivation.png 32x32/cultivation.png
	convert 32x32/cultivation.png 32x32/cultivation.xpm
	sed -i -e 's/-lX11//' game2/gameSource/Makefile
	sed -i -e 's/^DEBUG_FLAG = .*/DEBUG_FLAG = /' game2/gameSource/Makefile
	sed -i -e 's/^OPTIMIZE_FLAG = .*/OPTIMIZE_FLAG = /' game2/gameSource/Makefile
	sed -i -e 's/^COMPILE_FLAGS = /COMPILE_FLAGS = ${CFLAGS} /' game2/gameSource/Makefile
echo zzzz
	%__make %{?_smp_mflags} -C game2/gameSource CFLAGS="${CFLAGS} -DDATADIR=\"%{_gamesdatadir}/%{name}\""


%install
install -d -m 755 %{buildroot}%{_gamesbindir}
install -m 755 game2/gameSource/%{Name} \
	%{buildroot}%{_gamesbindir}/%{name}.real

install -d -m 755 %{buildroot}%{_gamesdatadir}/%{name}
install -m 644 game2/gameSource/font.tga \
	%{buildroot}%{_gamesdatadir}/%{name}
install -m 644 game2/gameSource/features.txt \
	%{buildroot}%{_gamesdatadir}/%{name}
install -m 644 game2/gameSource/language.txt \
	%{buildroot}%{_gamesdatadir}/%{name}
install -d -m 755 %{buildroot}%{_gamesdatadir}/%{name}/languages
install -m 644 game2/gameSource/languages/*.txt \
	%{buildroot}%{_gamesdatadir}/%{name}/languages

# startscript
cat > %{buildroot}%{_gamesbindir}/%{name} <<'EOF'
#!/bin/bash
if [ ! -d $HOME/.%{name} ]; then
	mkdir -p $HOME/.%{name}
	cd $HOME/.%{name}
	cp %{_gamesdatadir}/%{name}/*.txt .
	ln -s %{_gamesdatadir}/%{name}/*.tga .
	ln -s %{_gamesdatadir}/%{name}/languages .
	ln -s %{_gamesbindir}/%{name}.real .
fi

cd $HOME/.%{name}

# Basic switch of language according to locale defined in Unix systems
case "$LC_MESSAGES" in
    fr* )
        language="French"
	;;
    pt* )
        language="Portuguese"
	;;
    * )
        language="English"
	;;
esac
echo $language > ./language.txt

./%{name}.real
EOF
chmod 755 %{buildroot}%{_gamesbindir}/%{name}

# icon
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
install -m 644 cultivation.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

mkdir -p %{buildroot}%{_datadir}/applications
cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Name=%{name}
Comment=%summary
Exec=soundwrapper %{name}
Icon=%{name}
Terminal=false
Type=Application
StartupNotify=true
Categories=Game;Simulation;
EOF

%files
%doc game2/documentation/*
%{_gamesbindir}/%{name}
%{_gamesbindir}/%{name}.real
%{_gamesdatadir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/%{name}.png


%changelog
* Wed Oct 15 2014 umeabot <umeabot> 9-13.mga5
+ Revision: 741623
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 9-12.mga5
+ Revision: 678615
- Mageia 5 Mass Rebuild

* Thu Aug 14 2014 wally <wally> 9-11.mga5
+ Revision: 662436
- add patch from Debian to port to portaudio 19
- disable P4 for now
- require soundwrapper
- fix usage of CFLAGS

* Sat Oct 19 2013 umeabot <umeabot> 9-10.mga4
+ Revision: 526046
- Mageia 4 Mass Rebuild

* Mon Jun 03 2013 fwang <fwang> 9-9.mga4
+ Revision: 435812
- rebuild for new libpng

* Fri Jan 11 2013 umeabot <umeabot> 9-8.mga3
+ Revision: 348411
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sat Nov 24 2012 zezinho <zezinho> 9-7.mga3
+ Revision: 321659
- soundwrapper needed so added to desktop file

* Fri Jun 08 2012 dams <dams> 9-6.mga3
+ Revision: 257758
- clean/update specfile
- change game icon to have a better render

* Mon Mar 12 2012 zezinho <zezinho> 9-5.mga2
+ Revision: 222840
- disable abs path patch as it disables i18n

* Wed Sep 14 2011 fwang <fwang> 9-4.mga2
+ Revision: 143264
- br freeglut
- fix br
- rebuild for new libpng

  + zezinho <zezinho>
    - switch to freeglut-devel
    - missing build require
    - simple patch to build on current cauldron
    - update tarball
    - update to latest version and some debian patches to remove the bundled libs

  + stormi <stormi>
    - add imagemagick buildrequires

* Sun Jul 10 2011 stormi <stormi> 9-0.20071217.7.mga2
+ Revision: 121437
- increase release so that it's higher than in mageia 1

* Sat Jul 09 2011 stormi <stormi> 9-0.20071217.6.mga2
+ Revision: 120907
- bump release to ease migration from mandriva

* Wed Jun 08 2011 zezinho <zezinho> 9-0.20071217.5.mga2
+ Revision: 102046
- Upstream patches to build with current make and fix a crash

  + ennael <ennael>
    - clean spec file
    - imported package cultivation


* Thu Sep 10 2009 Thierry Vignaud <tvignaud@mandriva.com> 9-0.20071217.5mdv2010.0
+ Revision: 437163
- rebuild

* Mon Apr 06 2009 Funda Wang <fundawang@mandriva.org> 9-0.20071217.4mdv2009.1
+ Revision: 364301
- fix desktop file

* Thu Jun 12 2008 Pixel <pixel@mandriva.com> 9-0.20071217.3mdv2009.0
+ Revision: 218434
- rpm filetriggers deprecates update_menus/update_scrollkeeper/update_mime_database/update_icon_cache/update_desktop_database/post_install_gconf_schemas

  + Thierry Vignaud <tvignaud@mandriva.com>
    - fix 'error: for key "Icon" in group "Desktop Entry" is an icon name with an
      extension, but there should be no extension as described in the Icon Theme
      Specification if the value is not an absolute path'

* Thu Dec 20 2007 Guillaume Bedot <littletux@mandriva.org> 9-0.20071217.3mdv2008.1
+ Revision: 135868
- Fix wrapper again

* Wed Dec 19 2007 Guillaume Rousse <guillomovitch@mandriva.org> 9-0.20071217.2mdv2008.1
+ Revision: 135068
- fix wrapper (close bug #36234)

* Mon Dec 17 2007 Guillaume Rousse <guillomovitch@mandriva.org> 9-0.20071217.1mdv2008.1
+ Revision: 121738
- import cultivation


* Mon Dec 17 2007 Guillaume Rousse <guillomovitch@mandriva.org> 9cvs20071217-1mdv2008.1
- contributed by José Jorge <lists.jjorge@free.fr>