Name: alfont
Version: 2.0.6
Release: 2%{?dist}
Summary: Font rendering library for the Allegro game library
Group: System Environment/Libraries
License: BSD-like
URL: http://chernsha.sitesled.com/
# this is http://chernsha.sitesled.com/AlFont206.rar repackaged in .tgz format
Source0: %{name}-%{version}.tar.gz
Patch0: alfont-2.0.6-linux.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: allegro-devel freetype-devel
%description
alfont also known as AllegroFont or AlFont is a wrapper around the freetype2
library for use with the Allegro game library. Thus allowing the display of
text using freetype fonts on Allegro bitmaps.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: allegro-devel
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q
%patch0 -p1 -z .linux
sed -i s'/\r//g' freetype/docs/FTL.TXT
%build
# Upstreams makefile uses its own private copy of freetype, since all
# we want is the wrapper and since the wrapper is only one file we
# do a manual compile here
gcc -fPIC -DPIC $RPM_OPT_FLAGS -Iinclude `freetype-config --cflags` \
-o src/alfont.o -c src/alfont.c
gcc -shared -Wl,-soname,lib%{name}.so.2 -o lib%{name}.so.%{version} \
src/alfont.o `freetype-config --libs` \
`allegro-config --libs | sed 's/-lalleg_unsharable//'`
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_includedir}
install -m 755 lib%{name}.so.%{version} $RPM_BUILD_ROOT%{_libdir}
ln -s lib%{name}.so.%{version} $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so.2
ln -s lib%{name}.so.%{version} $RPM_BUILD_ROOT%{_libdir}/lib%{name}.so
install -m 644 include/%{name}*.h $RPM_BUILD_ROOT%{_includedir}
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc CHANGES.txt README.txt freetype/docs/FTL.TXT
%{_libdir}/lib%{name}.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}*.h
%{_libdir}/lib%{name}.so
%changelog
* Sun Dec 3 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 2.0.6-2
- Link the .so file with allegro (bz 217998)
- Add "Requires: allegro-devel" to the -devel subpackage
* Thu Nov 30 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 2.0.6-1
- Initial FE package