Blob Blame History Raw
Name:		golly
Version:	2.2
Release:	3%{?dist}
Summary:	Cellular automata simulator (includes Conway's Game of Life)
Group:		Amusements/Games
# The license for the code is GPLv2+
# The license for the Life Lexicon is CC-BY-SA (see Source1)
License:	GPLv2+ and CC-BY-SA
URL:		http://golly.sourceforge.net/

Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}-src.tar.gz
# The following is the official web page for the Life Lexicon included
# in the Golly distribution. We included it here because currently
# none of the actual files comprising the Life Lexicon have been
# updated to include the license notice. When a future upstream
# release includes the appropriate license notice, we can remove
# Source1 from this spec.
Source1:	http://www.argentum.freeserve.co.uk/lex_home.htm

# patch to use %{_datadir}/%{name} for supplied files, rather than current dir
Patch0:		golly-appdir.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	wxGTK-devel
BuildRequires:	perl-devel perl-ExtUtils-Embed
BuildRequires:	python-devel
BuildRequires:	ImageMagick
BuildRequires:	desktop-file-utils

# Because we're embedding an path into the binary depend on that path. See:
# https://www.redhat.com/archives/fedora-packaging/2008-March/thread.html#00070
# https://www.redhat.com/archives/fedora-devel-list/2008-March/msg00922.html
# https://bugzilla.redhat.com/show_bug.cgi?id=590355
%global libperldir %(%{__perl} -MExtUtils::Embed -e ldopts 2> /dev/null | egrep -o '/[^[:space:]]*CORE' | head -1)
%if "%{?libperldir}" != "%{nil}"
Requires: %{?libperldir}/libperl.so
%endif
# We're also going to pick up a versioned dependency, to help track things:
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))	

%description
Golly is an open source application for exploring Conway's Game of
Life and other cellular automata.  Golly supports unbounded universes
with up to 256 states.  Golly supports multiple algorithms, including
Bill Gosper's super fast hashlife algorithm.  Many different types of
CA are included: John von Neumann's 29-state CA, Wolfram's 1D rules,
WireWorld, Generations, Langton's Loops, Paterson's Worms, etc.

%package devel
Summary:	Development files for Golly cellular automata simulator
Group:		Development/Tools
Requires:	%{name} = %{version}-%{release}

%description devel
Development files for Golly celluar automata simulator.

%prep
%setup -q -n %{name}-%{version}-src
%patch -P 0 -p1 -b .appdir

cp %{SOURCE1} .

# remove unnecessary AppleDouble stuff
find . -name '._*' -exec rm {} \;
find . -name '.DS*' -exec rm {} \;
find . -name '.#*' -exec rm {} \;

# fix permissions - no normal files should have execute permissions set
find . -type f -exec chmod 644 {} \;

%build
make %{?_smp_mflags} \
	CXXFLAGS="%{optflags} -DGOLLYDIR=\"%{_datadir}/%{name}\"" \
	ZLIB_LDFLAGS=-lz \
	-f makefile-gtk
convert appicon48.ico golly.png
cat <<EOF >golly.desktop
[Desktop Entry]
Name=Golly
GenericName=Golly cellular automata simulator
Exec=golly
Icon=golly
Terminal=false
Type=Application
Categories=GNOME;Game;LogicGame;
EOF

%install
rm -rf %{buildroot}

# install binaries
install -d %{buildroot}%{_bindir}/
install -m 755 golly bgolly RuleTableToTree %{buildroot}%{_bindir}/

# install data files, but not scripts used only for build
for d in bitmaps Help Patterns Rules Scripts
do
  find $d -type d -exec install -d %{buildroot}%{_datadir}/%{name}/{} \;
  find $d -type f -exec install -m 644 {} %{buildroot}%{_datadir}/%{name}/{} \;
done
rm %{buildroot}%{_datadir}/%{name}/Help/Lexicon/*.pl

# install application icon and desktop file
install -D -p -m 644 %{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -D -p -m 644 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/golly
%{_bindir}/bgolly
%{_bindir}/RuleTableToTree
%{_datadir}/%{name}/
%exclude %{_datadir}/%{name}/Rules/TableGenerators/
%exclude %{_datadir}/%{name}/Rules/TreeGenerators/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%doc README LICENSE
%doc lex_home.htm

%files devel
%defattr(-,root,root,-)
%{_datadir}/%{name}/Rules/TableGenerators/
%{_datadir}/%{name}/Rules/TreeGenerators/


%changelog
* Thu Jun 09 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.2-3
- Perl 5.14 mass rebuild

* Tue Apr  5 2011 Eric Smith <eric@brouhaha.com> 2.2-2
- Include HTML file from official Life Lexicon web page giving CC-BY-SA
  license notice.

* Mon Dec 13 2010 Eric Smith <eric@brouhaha.com> 2.2-1
- Updated to latest upstream release, several patches no longer necessary

* Wed Jun  2 2010 Eric Smith <eric@brouhaha.com> 2.1-7
- Fixed space/tab rpmlint complaint about spec

* Tue Jun  1 2010 Terje Rosten <terje.rosten@> 2.1-6
- Add patch to let golly locate libperl.so 

* Mon May 31 2010 Eric Smith <eric@brouhaha.com> 2.1-5
- Added patch to use Perl 5.10.1

* Wed May 12 2010 Eric Smith <eric@brouhaha.com> 2.1-4
- Added patch to use libpython2.6 as default, from Terje Røsten
- Included upstream patch for 64-bit issue

* Tue May 11 2010 Eric Smith <eric@brouhaha.com> 2.1-3
- Changed optflags patch to remove -O5
- Fixed appdir patch
- Consistent use of buildroot var
- Fixed directory ownership by using exclude
- Removed echo command left over from debugging

* Sun May  9 2010 Eric Smith <eric@brouhaha.com> 2.1-2
- Changed appdir patch to use arg defined by makefile

* Sat May  8 2010 Eric Smith <eric@brouhaha.com> 2.1-1
- Initial version