Blob Blame History Raw
%define archivename     dejavu-sfd
# This macro has the same value as %{version}, except when testing pre-release snapshots
%define alphatag	20060618svn945
%define archiveversion  20060618-945
%define fontdir         %{_datadir}/fonts/%{name}
%define fontconfdir     %{_sysconfdir}/fonts
%define xsldir          %{_datadir}/xml/%{name}

# Let the perl Maintainer worry about Unicode.org data files (updates, licensing)
%define Blocks		%(eval "$(%{__perl} -V:privlibexp)"; echo $privlibexp)/unicore/Blocks.txt
%define UnicodeData	%(eval "$(%{__perl} -V:privlibexp)"; echo $privlibexp)/unicore/UnicodeData.txt

Name:      dejavu-fonts
Version:   2.7.0
Release:   0.19.%{alphatag}%{?dist}
Summary:   DejaVu fonts
Group:     User Interface/X
License:   Redistributable, with restrictions
URL:       http://dejavu.sf.net/
Source:    http://prdownloads.sourceforge.net/dejavu/%{archivename}-%{archiveversion}.tar.gz
# Make DejaVu fonts the default in Sans, Serif and Monospace
Source1:   %{name}-makedefault.xsl
#  Substitute the glyphs of another font in Sans, Serif and Monospace for Arabic and Farsi
Source2:   %{name}-block.xsl
Source3:   %{name}-unblock.xsl
# DejaVu fontconfig setup
Source4:   %{name}-fontconfig.conf
# Substitute the glyphs of another font in DejaVu for Farsi
Source5:   %{name}-persian-override.conf
# Substitute the glyphs of another font in DejaVu for Arabic
Source6:   %{name}-arabic-override.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: fontforge
# The CPAN sources do not declare perl(Font::TTF)
BuildRequires: perl-Font-TTF
# Needed to compute unicode coverage
BuildRequires: %{Blocks} %{UnicodeData}
# If we add this the package will require fontconfig
# Requires: %{fontconfdir}/conf.d
BuildArch: noarch
Conflicts: fontconfig < 2.3.93


%description
The DejaVu fonts are a font family based on the Bitstream Vera Fonts release
1.10. Its purpose is to provide a wider range of characters while maintaining
the original look and feel through the process of collaborative development.

This package includes the typefaces the DejaVu project considers mature.


%package experimental
Group:    User Interface/X
Summary:  Experimental DejaVu typefaces
# Does not really make sense without the core typefaces
Requires: %{name} = %{version}-%{release}


%description experimental
The DejaVu fonts are a font family based on the Bitstream Vera Fonts release
1.10.

This package includes the typefaces the DejaVu project considers experimental.


%package makedefault
Group:     User Interface/X
Summary:   Files needed to make DejaVu the default fontconfig fonts 
# Needed for xslt processing of %{fontconfdir}/fonts.conf
Requires:  %{_bindir}/xsltproc, /bin/mktemp, %{fontconfdir}/fonts.conf
Obsoletes: %{name}-fontconfig < 2.7.0-0.15
Conflicts: %{name}-fontconfig < 2.7.0-0.15

%description makedefault
The DejaVu fonts are a font family based on the Bitstream Vera Fonts release
1.10. This package will add DejaVu fonts to fontconfig aliases and keep them
there.

It will make DejaVu fonts the first choice in Sans, Sans-Serif and Monospace.


%package block
Group:    User Interface/X
Summary:  Files needed to block DejaVu use with some scripts
Requires: %{fontconfdir}/conf.d
# Needed for xslt processing of %{fontconfdir}/fonts.conf
Requires: %{_bindir}/xsltproc, /bin/mktemp, %{fontconfdir}/fonts.conf

%description block
The DejaVu fonts are a font family based on the Bitstream Vera Fonts release
1.10. While their glyph coverage and quality is improving every release, they
may not yet be suitable for intensive use for some scripts.

This package will force substitution of DejaVu by other fonts when rendering
one of these scripts. If you need to install it, you probably have
some enhancement suggestions to make at
https://bugs.freedesktop.org/enter_bug.cgi?product=DejaVu or
dejavu-fonts at lists.sourceforge.net

Requests for enhancements or fixes of the blocking code should go to
https://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora%20Extras


%prep
%setup -q -n %{archivename}-%{archiveversion}


%build
./generate.sh
./status.pl %{version} status.txt *.sfd > status.txt.new
mv status.txt.new status.txt
./unicover.pl %{UnicodeData} %{Blocks} \
              DejaVuSans.sfd Sans \
              DejaVuSerif.sfd Serif \
              DejaVuMonoSans.sfd "Sans Mono" > unicover.txt
# We should probably also regenerate langcover.txt
# but it requires resolution of 
# https://bugs.freedesktop.org/show_bug.cgi?id=6316 


%check
# Current upstream files are full of "problems"
# Do not panic if the output is long
./problems.pl -l 3 *.sfd


%install
/bin/rm -rf %{buildroot}

#fonts
install -d -m 0755 %{buildroot}%{fontdir}
install -m 0644 generated/*.ttf  %{buildroot}%{fontdir}

#xsl
install -d -m 755 %{buildroot}%{xsldir}
install -p -m 644 %{SOURCE1} %{buildroot}%{xsldir}/makedefault.xsl
install -p -m 644 %{SOURCE2} %{buildroot}%{xsldir}/block.xsl
install -p -m 644 %{SOURCE3} %{buildroot}%{xsldir}/unblock.xsl

# Fontconfig overrides for some scripts
install -d -m 0755 %{buildroot}%{fontconfdir}/conf.d
install -m 0644 %{SOURCE4} %{buildroot}%{fontconfdir}/conf.d/20-DejaVu.conf
install -m 0644 %{SOURCE5} %{buildroot}%{fontconfdir}/conf.d/00-dejavu-persian-override.conf
install -m 0644 %{SOURCE6} %{buildroot}%{fontconfdir}/conf.d/00-dejavu-arabic-override.conf


%clean
/bin/rm -rf %{buildroot}


%post
if [ -x %{_bindir}/fc-cache ]; then 
  %{_bindir}/fc-cache %{_datadir}/fonts
fi


%postun
if [ "$1" = "0" ]; then
  if [ -x %{_bindir}/fc-cache ]; then 
    %{_bindir}/fc-cache %{_datadir}/fonts
  fi
fi


%post experimental
if [ -x %{_bindir}/fc-cache ]; then
  %{_bindir}/fc-cache %{_datadir}/fonts
fi


%postun experimental
if [ "$1" = "0" ]; then
  if [ -x %{_bindir}/fc-cache ]; then
    %{_bindir}/fc-cache %{_datadir}/fonts
  fi
fi


### Triggers yes I know I'm mad

# I hope this won't be necessary by FC6 time
%triggerin makedefault -- fontconfig, %{fontconfdir}/fonts.conf
if [ -w %{fontconfdir}/fonts.conf ] ; then
  TMPFILE=$(/bin/mktemp -q /tmp/fonts.conf.XXXXXX) && \
  %{_bindir}/xsltproc --novalid --output $TMPFILE \
    %{xsldir}/makedefault.xsl %{fontconfdir}/fonts.conf && \
  /bin/cat $TMPFILE > %{fontconfdir}/fonts.conf && /bin/rm $TMPFILE
fi


# These bits do not seem achieveable right now by dumping files in
# %{fontconfdir}/conf.d
%triggerin block -- fontconfig, %{fontconfdir}/fonts.conf
if [ -w %{fontconfdir}/fonts.conf ] ; then
  TMPFILE=$(/bin/mktemp -q /tmp/fonts.conf.XXXXXX) && \
  %{_bindir}/xsltproc --novalid --output $TMPFILE \
    %{xsldir}/block.xsl %{fontconfdir}/fonts.conf && \
  /bin/cat $TMPFILE > %{fontconfdir}/fonts.conf && /bin/rm $TMPFILE
fi


%preun block
if [ "$1" = "0" -a -w %{fontconfdir}/fonts.conf ] ; then
  TMPFILE=$(/bin/mktemp -q /tmp/fonts.conf.XXXXXX) && \
  %{_bindir}/xsltproc --novalid --output $TMPFILE \
    %{xsldir}/unblock.xsl %{fontconfdir}/fonts.conf && \
  /bin/cat $TMPFILE > %{fontconfdir}/fonts.conf && /bin/rm $TMPFILE
fi


%files
%defattr(0644,root,root,0755)
%doc *.txt AUTHORS BUGS LICENSE NEWS README

%{fontconfdir}/conf.d/20-DejaVu.conf

%dir %{fontdir}
%{fontdir}/DejaVu*.ttf
%exclude %{fontdir}/DejaVu*Condensed*.ttf
%exclude %{fontdir}/DejaVu*ExtraLight*.ttf
%exclude %{fontdir}/DejaVuSerif-*Oblique.ttf

%files experimental
%defattr(0644,root,root,0755)
%{fontdir}/DejaVu*Condensed*.ttf
%{fontdir}/DejaVu*ExtraLight*.ttf
%{fontdir}/DejaVuSerif-*Oblique.ttf


%files makedefault
%defattr(0644,root,root,0755)
%dir %{xsldir}
%{xsldir}/makedefault.xsl


%files block
%defattr(0644,root,root,0755)

%dir %{xsldir}
%{xsldir}/block.xsl
%{xsldir}/unblock.xsl

%exclude %{fontconfdir}/conf.d/20-DejaVu.conf
%{fontconfdir}/conf.d/*.conf


%changelog
* Sun Jun 18 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.19
- clean up descriptions

* Sun Jun 18 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.18
- update to 20060618-945 snapshot
- tighten up obsoletes

* Fri Jun 16 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.17
- all behold the power of the alphatag

* Wed Jun 14 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.15
- update to 20060614-943 snapshot
- do make dejavu the default in all cases when makedefault is installed
- alias Vera derivatives merged in DejaVu
- declare generics for all DejaVu faces
- remove more stuff moved to %{fontconfdir}/conf.d from the xslts

* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.14
- remove old blocking code before adding new one

* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.12
- replace triggerun by preun

* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.10
- block Sans instead of sans-serif - GNOME uses the first one

* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.9
- reintroduce xslt triggers in dejavu-fonts-block as fontconfig conf.d priority
  is not high enough for our needs

* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.8
- complete and clean up the Vera aliasing

* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.7
- addition of fontconfig blocking for Arabic and Persian
  (experimental but safe)
- tweak of the fontconfig aliasing to make DejaVu fonts the highest prio
  instead of following Vera ranking, and rename the subpackage accordingly

* Sun Jun 11 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.7.0-0.1
- preparation to 2.7.0 based on the current dejavu snapshot

* Mon May 15 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.6.0-1
- 2.6.0

* Sun Apr 23 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.5.0-1
- 2.5.0

* Wed Mar 29 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.4.1-1
- 2.4.1 (workaround pango problems)

* Wed Mar 22 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.4-1
- 2.4 A big thanks to Stepan Roh for getting the project there
- split out experimental typefaces

* Sat Mar 04 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.3-3
- split fontconfig registration in subpackage

* Sat Mar 04 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.3-2
- register dejavu in fontconfig aliases

* Mon Feb 20 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.3-1
- 2.3

* Mon Feb 13 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> - 2.2-6
- rebuilt for new gcc4.1 snapshot and glibc changes

* Sun Feb 12 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> 2.2-5
- downgrade fontforge requirement following bug #181052 resolution

* Sun Feb 12 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> 2.2-4
- WARNING: in an effort to get Fedora Extras as self-hosting as possible
  starting from this release ttf files are regenerated from sfd sources

* Mon Jan 16 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> 2.2-2
- bump release to ensure graceful FC4 -> FC5 update
- bump again because of bas CVS tag

* Mon Jan 16 2006 Nicolas Mailhot <nicolas.mailhot at laposte.net> 2.2-1
- 2.2

* Wed Dec 28 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 2.1-1
- 2.1

* Sun Nov 13 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 2.0-1
- 2.0!

* Fri Oct 28 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 1.15-2
- add ghosting of %{fontdir}/fonts.cache-2 since it seems
  needed nowadays

* Sun Oct 16 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 1.15-1
- 1.15

* Sat Oct 8 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 1.14-1
- 1.14
- still using prepackaged TTFs as the FE fontforge package is too old

* Sun Jul 31 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 1.12-1
- 1.12

* Thu Jun 23 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 1.11-1
- 1.11

* Mon May 22 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 1.10-1
- 1.10

* Sat May 21 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 1.9-2
- 1.9
- submission to FCE

* Sat Feb 19 2005 Nicolas Mailhot <nicolas.mailhot at laposte.net> 1.7-1
- initial build - using vera as template

* Sat Jan 08 2005 Florian La Roche <laroche@redhat.com>
- rebuilt to get rid of legacy selinux filecontexts