File fontforge.spec of Package fontforge
#
# spec file for package fontforge
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: fontforge
Version: 20120731
Release: 0
%define src_version %{version}-b
Summary: A Font Editor
License: BSD-3-Clause
Group: Productivity/Graphics/Vector Editors
Url: http://fontforge.org/
Source0: http://downloads.sourceforge.net/%{name}/%{name}_full-%{src_version}.tar.bz2
Source1: http://downloads.sourceforge.net/%{name}/%{name}_htdocs-%{src_version}.tar.bz2
# PATCH-FIX-OPENSUSE -- set path to documentation
Patch0: docdir.patch
Patch1: fontforge-20090622-fdleak.patch
Patch2: libpng14-dynamic.diff
# PATCH-FIX-OPENSUSE fontforge-python-module-name.diff -- change python module name according to naming policy
Patch3: fontforge-python-module-name.diff
BuildRequires: cairo-devel
BuildRequires: fdupes
BuildRequires: freetype2-devel
BuildRequires: gettext-tools
BuildRequires: giflib-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
%if 0%{?suse_version} > 1210
BuildRequires: libspiro-devel
%endif
BuildRequires: libtiff-devel
BuildRequires: libuninameslist-devel
BuildRequires: libxml2-devel
BuildRequires: pango-devel
BuildRequires: python-devel
BuildRequires: update-desktop-files
BuildRequires: xorg-x11-devel
Obsoletes: PfaEdit < 20110222
Provides: PfaEdit = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
FontForge allows editing of outline and bitmap fonts. With it, you can
create new fonts or modify old ones. It also converts font formats and
can convert among PostScript (ASCII & binary Type 1, some Type 3s, and
some Type 0s), TrueType, OpenType (Type2), and CID-keyed fonts.
%package devel
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/Other
Requires: %{name} = %{version}
Requires: freetype2-devel
%description devel
This package contains all necessary include files and libraries needed
to develop applications that use FontForge libraries.
%prep
%setup -q -T -n fontforge-%{src_version} -b 0
%patch0 -p 1 -b .docdir
%patch1
%if 0%{?suse_version} > 1120
%patch2
%endif
%patch3
mkdir docs
tar -jxvf %{SOURCE1} -C docs
chmod 644 docs/quadraticspline.gif
chmod 644 docs/FontForgeSplash.png
chmod 644 docs/*.html
# tar zxvf docs/cidmaps.tgz
find . -name CVS -type d | xargs rm -rf
# fix wrong-file-end-of-line-encoding
sed -i 's/\r$//' docs/{Big5.txt,corpchar.txt}
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure \
--disable-static \
--enable-pyextension \
--with-regular-link
make %{?_smp_mflags}
pushd pyhook
python setup.py build
popd
%install
make DESTDIR=%{buildroot} install
# symlink for old FontForge name - PfaEdit
pushd %{buildroot}%{_bindir}
ln -s fontforge pfaedit
popd
# install CMaps to be able to edit CID-keyed fonts:
# install -m 644 Adobe* %{buildroot}%{_datadir}/fontforge
# desktop file and icon
install -Dm 644 Packaging/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dm 644 Packaging/icons/48x48/apps/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%suse_update_desktop_file -i %{name} VectorGraphics
%find_lang FontForge
rm -f %{buildroot}%{_libdir}/*.la
pushd pyhook
python setup.py install \
--root=%{buildroot} \
--prefix=%{_prefix} \
--record-rpm=%{name}-python.files
popd
%fdupes -s %{buildroot}%{_datadir}/%{name}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files -f FontForge.lang
%defattr(-,root,root)
%doc AUTHORS VERSION LICENSE README-unix docs/
%{_bindir}/*
%{_libdir}/lib*.so.*
%{_datadir}/fontforge/
%{_mandir}/man1/*.1*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%py_sitedir/*
%files devel
%defattr(-, root, root)
%dir %{_includedir}/fontforge/
%{_includedir}/fontforge/*
%{_libdir}/pkgconfig/*
%{_libdir}/lib*.so
%changelog