
%define texmf_dir %_datadir/texmf
%define prefix %texmf_dir
%define fontsbase public/urwcyr
%define texpackname urwcyr

Name: urw-tex
Version: 2.0
Release: alt6

Summary: Using cyrillic URW fonts in TeX.
License: GPL
Group: Publishing
Url: none
Packager: Viktor S. Grichenko <gritzko@altlinux.ru>
BuildArch: noarch

Source0: %name-%version.tar.bz2
Patch0: %name-%version-alt.patch
Patch1: %name-%version-path.patch
AutoReq: yes, perl
PreReq: tetex-core >= 2.0-alt0.8, fonts-cm-super-tex-dvips

Requires: urw-fonts = %version

BuildRequires: tetex-latex >= 2.0-alt0.8, tetex-dvips, fonts-cm-super-tex-dvips, 
BuildRequires: urw-fonts = %version, tetex-afm

%package doc
Summary: TeX and LaTeX samples for usage of URW fonts in TeX
Group: Publishing
Requires: tetex-latex >= 2.0, %name = %version-%release

%package afm
Summary: AFM metrics for URW fonts in TeX
Group: Publishing
Requires: tetex-afm >= 2.0, %name = %version-%release

%description
A bunch of links, metrics and styles to easily use cyrillized URW Type1 fonts
in TeX. For styles see %texmf_dir/tex/latex/urwcyr; most probably, you'll
have to insert "\usepackage{urwcyr}" into your LaTeX document preamble.

%description afm
AFM metrics for URW fonts in TeX

%description doc
TeX and LaTeX samples for usage of URW fonts in TeX

%prep
%setup
%patch0 -p1

%build
./build.sh
pushd dvips/config
%__mv -f urw-cm-super-t1.map urw-t1.map
%__mv -f urw-cm-super-t2a.map urw-t2a.map
popd
pushd dvipdfm/config
mv * ../
cd ..
rm -rf config
popd
pushd tex/latex/urwcyr
	for fd in ot1*.fd; do
		cp $fd $(echo $fd|sed -e "s/^o//")
	done
	%__subst "s/[oO]\([tT]1\)/\1/" t1*.fd
popd

%install

%__mkdir -p %buildroot%texmf_dir
%__cp -Rd * %buildroot%texmf_dir/
%__mkdir -p %buildroot%_sysconfdir/tex-fonts.d
echo "Map urw-t1.map" > %buildroot%_sysconfdir/tex-fonts.d/%name.cfg
echo "Map urw-t2a.map" >> %buildroot%_sysconfdir/tex-fonts.d/%name.cfg

%post
if [ $1 = 1 ] ; then
    [ -x /usr/bin/texhash ] && /usr/bin/texhash 2>/dev/null ||:
    [ -x /usr/bin/updmap ] && /usr/bin/updmap 2>/dev/null ||:
fi

%postun
if [ $1 = 0 ] ; then
    [ -x /usr/bin/texhash ] && /usr/bin/texhash 2>/dev/null ||:
    [ -x /usr/bin/updmap ] && /usr/bin/updmap 2>/dev/null ||:
fi

%post afm
if [ $1 = 1 ] ; then
    [ -x /usr/bin/texhash ] && /usr/bin/texhash 2>/dev/null ||:
fi

%postun afm
if [ $1 = 0 ] ; then
    [ -x /usr/bin/texhash ] && /usr/bin/texhash 2>/dev/null ||:
fi

%post doc
if [ $1 = 1 ] ; then
    [ -x /usr/bin/texhash ] && /usr/bin/texhash 2>/dev/null ||:
fi

%postun doc
if [ $1 = 0 ] ; then
    [ -x /usr/bin/texhash ] && /usr/bin/texhash 2>/dev/null ||:
fi

%files afm
%dir %texmf_dir/fonts/afm/%fontsbase
%texmf_dir/fonts/afm/%fontsbase/*

%files doc
%dir %texmf_dir/doc/%texpackname
%texmf_dir/doc/%texpackname/*

%files
%_sysconfdir/tex-fonts.d/%name.cfg
%texmf_dir/dvipdfm/*
%texmf_dir/dvips/config/*
%dir %texmf_dir/fonts/tfm/%fontsbase
%texmf_dir/fonts/tfm/%fontsbase/*
%dir %texmf_dir/fonts/type1/%fontsbase
%texmf_dir/fonts/type1/%fontsbase/*
%dir %texmf_dir/tex/latex/urwcyr
%texmf_dir/tex/latex/urwcyr/*
%doc readme-motygin
%doc problem
%doc license-motygin
%doc README
%doc LICENSE

%changelog
* Sat May 1 2004 Viktor S. Grishchenko <gritzko@altlinux.ru> 2.0-alt6
- T1 family description patch by Yurix <yurix@altlinux.org>

* Fri Jan 17 2003 Alexander Bokovoy <ab@altlinux.ru> 2.0-alt5
- Rebuild against tetex-2.0-alt0.8 since dvipdfm is now part
  of tetex-core and its texmf subtree changed a structure

* Mon Nov 25 2002 Alexander Bokovoy <ab@altlinux.ru> 2.0-alt4
- Rebuild against tetex-2.0
- Split on subpackages

* Sun Jun 10 2002 Viktor S. Grichenko <gritzko@ural.ru> 2.0-alt3
- Merged (+ perl generation script)

* Fri Jun 07 2002 Alexander Bokovoy <ab@altlinux.ru> 2.0-alt2
- Changed to confirm ALT Linux packaging policy
- Added pdftex support

* Sat Jun 01 2002 Viktor S. Grichenko <gritzko@ural.ru> 0.1-1vsg
- spec file created

