Re: Bitstream Vera fonts rpm



Nicholas, thanks for the great work.

Some comments:
   1) these fonts aren't just for X: they should go into /usr/share/fonts              someplace, not in /usr/X11R6/.....
   2) let's try to coordinate this with the Debian folks so that we don't
have two different places for the same fonts or other gratuitous
differences between Linux systems.  Michael Fedrowitz I believe
is packaging them for Debian.
   3) History shows that there are bugs in fontconfig before 2.2 in
the caching code, so sometimes a "fc-cache -f" is necessary for fonts
to get detected properly.  Sigh...
                                - Jim

--
Jim Gettys
Cambridge Research Laboratory
HP Labs, Hewlett-Packard Company
Jim Gettys hp com

Hi,

        I did this quick packaging for install on my systems, I think other
people may be interested (resulting rpms available on select demands if
you don't have a rpm setup to use this spec file with)

Regards,

--
Nicolas Mailhot

%define name vera-fonts
%define archivename ttf-bitstream-vera
%define version 1.10
%define url http://www.gnome.org/fonts/
%define _x11bindir /usr/X11R6/bin
%define _x11encdir /usr/X11R6/lib/X11/fonts/encodings
%define prefix %{_datadir}/fonts/%{name}

Summary: Bitstream Vera Fonts
Name: %{name}
Version: %{version}
Release: 0
Epoch: 0
License: Free
URL: %{url}
Group: User Interface/X
Source0: http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/%{version}/%{archivename}-%{version}.tar.bz2
BuildArch: noarch
Requires:  %{_sbindir}/chkfontpath, %{_x11bindir}/mkfontdir, %{_bindir}/ttmkfdir
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
High quality hinted latin fonts donated by Bitstream
Very liberal license, see %{url}

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

%build

%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

install -d -m 0755 $RPM_BUILD_ROOT%{prefix}
install -m 0644 *.ttf  $RPM_BUILD_ROOT/%{prefix}/

# "touch" all fonts.dir, fonts.alias, etc files we've got flagged as %ghost
# but which are not present in the RPM_BUILD_ROOT when RPM looks for files
touch $RPM_BUILD_ROOT%{prefix}/encodings.dir
touch $RPM_BUILD_ROOT%{prefix}/fonts.{dir,scale,alias}
chmod 0644 $RPM_BUILD_ROOT%{prefix}/encodings.dir
chmod 0644 $RPM_BUILD_ROOT%{prefix}/fonts.{dir,scale,alias}

%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

%post
{
    #%{_bindir}/ttmkfdir is a requirement anyway -- NiM
    %{_bindir}/ttmkfdir -d %{prefix} -o %{prefix}/fonts.scale

    %{_x11bindir}/mkprefix -e %{_x11encdir} -e %{_x11encdir}/large %{prefix}

    %{_sbindir}/chkfontpath -q -a %{prefix}

    # This could be done via triggers but triggers are evil and not worth it
    if [ -x %{_bindir}/fc-cache ] ; then %{_bindir}/fc-cache ; fi

    if [ -x %{_bindir}/redhat-update-gnome-font-install ] ; then
        %{_bindir}/redhat-update-gnome-font-install
    fi

    if [ -x %{_bindir}/redhat-update-gnome-font-install2 ] ; then
        %{_bindir}/redhat-update-gnome-font-install2
    fi

} &> /dev/null || :

%postun
# Rehash the font dir to keep only stuff manually installed
{
if [ "$1" = "0" ]; then

   if [  $(find %{prefix} -follow -type f -iname "*.ttf" -printf "\b\b\b\btrue") ] ; then

        rm -f %{prefix}/fonts.alias
        %{_bindir}/ttmkfdir -d %{prefix} -o %{prefix}/fonts.scale
        %{_x11bindir}/mkprefix -e %{_x11encdir} -e %{_x11encdir}/large %{prefix}

   else
        rm -fr %{prefix}
        chkfontpath -q -r %{prefix}
   fi

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

   if [ -x %{_bindir}/redhat-update-gnome-font-install ] ; then
        %{_bindir}/redhat-update-gnome-font-install
   fi

   if [ -x %{_bindir}/redhat-update-gnome-font-install2 ] ; then
        %{_bindir}/redhat-update-gnome-font-install2
    fi
fi
} &> /dev/null || :

%files
%defattr(0644,root,root,0755)
%doc *.TXT local.conf
%dir %{prefix}
%{prefix}/*.ttf
%ghost %verify(not md5 size mtime) %config(noreplace) %{prefix}/fonts.alias
%ghost %verify(not md5 size mtime) %{prefix}/fonts.dir
%ghost %verify(not md5 size mtime) %{prefix}/fonts.scale
%ghost %verify(not md5 size mtime) %{prefix}/encodings.dir

%changelog
* Thu Apr 17 2003 Nicolas Mailhot <Nicolas.Mailhot at laPoste.net> 0:1.10-0
- initial packaging



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]