Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 2f59cb3dad8c45eb05dcd45f11b8f2c3 > files > 6

cultivation-9-1.2.mga1.src.rpm

%define subrel 	2
%define name    cultivation
%define Name    Cultivation
%define version 9
%define release %mkrel 1

Name:	    %{name}
Version:    %{version}
Release:    %{release}
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-abs_paths.patch
Patch2:     Cultivation-9-deb-math_h.patch
Patch3:     Cultivation-9-upstream-fix_crash.patch
Patch4:     Cultivation-9-mageia-build64bit.patch
BuildRequires:	mesaglut-devel
BuildRequires:	portaudio0-devel
BuildRequires:	png-devel
BuildRequires:	imagemagick

%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
%patch0 -p1
#%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

%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=\"/usr/share/games/cultivation\""


%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 game2/build/win32/iconSource.png \
	%{buildroot}%{_datadir}/pixmaps/%{name}.png

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

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, games)
%doc game2/documentation/*
%{_gamesbindir}/%{name}
%{_gamesbindir}/%{name}.real
%{_gamesdatadir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*.png



%changelog

* Mon Mar 12 2012 zezinho <zezinho> 9-1.2.mga1
+ Revision: 222846
- disable abs path patch as it prevents i18n
- rel downgrade to get a good update a MGA2 time
- updated from cauldron

  + stormi <stormi>
    - sync with cauldron, to get latest build patches

  + 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>