+# TODO:
+# - demos seem to use installed headers instead of these coming from new tarball (therefore buildconflicts)
#
# Conditional build:
%bcond_without lcd # without LCD subpixel color filtering (Microsoft patents in USA)
%bcond_without x11 # don't build examples (X11-based)
+%bcond_without harfbuzz # harfbuzz based autohinting
%bcond_without apidocs # disable api docs
Summary: TrueType font rasterizer
Summary(ru.UTF-8): Растеризатор шрифтов TrueType
Summary(uk.UTF-8): Растеризатор шрифтів TrueType
Name: freetype
-Version: 2.4.8
+Version: 2.6
Release: 1
Epoch: 1
License: GPL v2 or FTL
Group: Libraries
-Source0: http://downloads.sourceforge.net/freetype/%{name}-%{version}.tar.bz2
-# Source0-md5: dbf2caca1d3afd410a29217a9809d397
-Source1: http://downloads.sourceforge.net/freetype/%{name}-doc-%{version}.tar.bz2
-# Source1-md5: 538c925059e90be23928b454c14df728
-Source2: http://downloads.sourceforge.net/freetype/ft2demos-%{version}.tar.bz2
-# Source2-md5: f44562cf0b434b6dc3488751f82d99ec
-Patch0: freetype-2.2.1-enable-valid.patch
+Source0: http://download.savannah.gnu.org/releases/freetype/%{name}-%{version}.tar.bz2
+# Source0-md5: 5682890cb0267f6671dd3de6eabd3e69
+Source1: http://download.savannah.gnu.org/releases/freetype/%{name}-doc-%{version}.tar.bz2
+# Source1-md5: f456b7ead3c351c7c218bb3afd45803c
+Source2: http://download.savannah.gnu.org/releases/freetype/ft2demos-%{version}.tar.bz2
+# Source2-md5: c6c209b37f10621d6ff100620b8292b4
+Patch0: %{name}-2.2.1-enable-valid.patch
URL: http://www.freetype.org/
BuildRequires: automake
+BuildRequires: bzip2-devel
+%{?with_harfbuzz:BuildRequires: harfbuzz-devel >= 0.9.19}
+BuildRequires: libpng-devel
BuildRequires: python
BuildRequires: python-modules
BuildRequires: rpm >= 4.4.9-56
+BuildRequires: sed >= 4.0
%if "%{pld_release}" == "ac"
%{?with_x11:BuildRequires: XFree86-devel}
%else
%{?with_x11:BuildRequires: xorg-lib-libX11-devel}
%endif
BuildRequires: zlib-devel
+BuildConflicts: %{name}-devel < %{version}
Obsoletes: freetype2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Summary(uk.UTF-8): Бібліотеки програміста для freetype
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: bzip2-devel
+%{?with_harfbuzz:Requires: harfbuzz-devel >= 0.9.19}
+Requires: libpng-devel
Requires: zlib-devel
Obsoletes: freetype2-devel
%setup -q -a1 -a2
%patch0 -p1
+# avoid propagating -L%{_libdir} through *.la
+%{__sed} -i -e 's,libpng-config --ldflags,libpng-config --libs,' builds/unix/configure
+
%build
+CC="%{__cc}" \
CFLAGS="%{rpmcflags} %{rpmcppflags} \
-%{?with_lcd:-DFT_CONFIG_OPTION_SUBPIXEL_RENDERING}" \
+%{?with_lcd:-DFT_CONFIG_OPTION_SUBPIXEL_RENDERING} \
+-DTT_CONFIG_OPTION_SUBPIXEL_HINTING \
+%{?with_harfbuzz:-DFT_CONFIG_OPTION_USE_HARFBUZZ} \
+" \
%{__make} setup unix \
CFG="--prefix=%{_prefix} --libdir=%{_libdir}"
+CC="%{__cc}" \
%{__make} \
X11_LIB=%{?_x_libraries}
%if %{with x11}
+CC="%{__cc}" \
%{__make} -C ft2demos-* \
TOP_DIR=$(pwd) \
X11_LIB=%{?_x_libraries}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+ln -s . $RPM_BUILD_ROOT%{_includedir}/freetype2/freetype
+
%if %{with x11}
install -p ft2demos-*/bin/.libs/ft* $RPM_BUILD_ROOT%{_bindir}
%endif
%attr(755,root,root) %{_libdir}/libfreetype.so
%{_libdir}/libfreetype.la
%{_includedir}/freetype2
-%{_includedir}/ft2build.h
%{_aclocaldir}/freetype2.m4
%{_pkgconfigdir}/freetype2.pc
+%{_mandir}/man1/freetype-config.1*
%if %{with apidocs}
%files apidocs