#
# spec file for package transfig (Version 3.2.5)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           transfig
BuildRequires:  libjpeg-devel libpng-devel netpbm texlive-latex xorg-x11 xorg-x11-devel
License:        MIT License (or similar)
Group:          Productivity/Graphics/Convertors
Provides:       transfig.3.2.3d
Requires:       netpbm ghostscript-library ghostscript-fonts-std
AutoReqProv:    on
Version:        3.2.5
Release:        160
Summary:        Graphic Converter
Source:         transfig.%{version}.tar.bz2
Patch0:         transfig.%{version}.dif
Patch1:         transfig.%{version}-cups.dif
Patch2:         transfig.%{version}-binderman.dif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)}
%if "%_exec_prefix" == "/usr/X11R6"
%global _mandir     %{_exec_prefix}/man
%define _x11data    %{_exec_prefix}/lib/X11
%define _data       $(LIBDIR)
%else
%define _x11data    %{_datadir}/X11
%define _data       $(SHAREDIR)
%endif

%description
TransFig is a set of tools for creating TeX documents with graphics
that are portable in the sense that they can be printed in a wide
variety of environments.

The transfig directory contains the source for the transfig command
which generates a Makefile which translates Fig code to various
graphics description languages using the fig2dev program.  In previous
releases, this command was implemented as a shell script.

Documentation: man transfig



Authors:
--------
    Anthony Starks     <ajs@merck.com>
    George Ferguson    <ferguson@cs.rochester.edu>
    Herbert Bauer      <heb@regent.e-technik.tu-muenchen.de>
    Micah Beck         <supoj@sally.utexas.edu>
    Supoj Sutantavibul <beck@cs.utk.ecu>

%prep
%setup -q -n transfig.%{version}
%patch0
%patch1
xmkmf -a -D_DATA='%{_data}'

%build
make CCOPTIONS="$RPM_OPT_FLAGS -fno-strict-aliasing -w"
make -C doc/manual/
rm -f   doc/manual/*.{log,toc,div}

%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_x11data}/xfig/fig2dev
mkdir -p %{buildroot}%{_x11data}/xfig/bitmaps
make DESTDIR=%{buildroot} install      CCOPTIONS="$RPM_OPT_FLAGS -fno-strict-aliasing -w"
make DESTDIR=%{buildroot} install.man  CCOPTIONS="$RPM_OPT_FLAGS -fno-strict-aliasing -w"
mkdir -p %{buildroot}%{_docdir}/transfig/manual
install -m 644 [CLNR]*      %{buildroot}%{_docdir}/transfig/
install -m 644 doc/manual/* %{buildroot}%{_docdir}/transfig/manual/
rm -vf %{buildroot}%{_docdir}/transfig/manual/Makefile.orig
rm -vf %{buildroot}%{_docdir}/transfig/manual/*.aux
rm -vf %{buildroot}%{_docdir}/transfig/manual/*.toc
rm -vf %{buildroot}%{_docdir}/transfig/manual/*.log
rm -vf %{buildroot}%{_docdir}/transfig/manual/*.div

%files
%defattr(-,root,root)
%{_bindir}/fig2dev
%{_bindir}/fig2ps2tex
%{_bindir}/fig2ps2tex.sh
%{_bindir}/pic2tpic
%{_bindir}/transfig
%dir %{_x11data}/xfig
%{_x11data}/xfig/fig2dev/
%{_x11data}/xfig/bitmaps/
%doc %{_mandir}/man1/fig2dev.1x.gz
%doc %{_mandir}/man1/fig2ps2tex.1x.gz
%doc %{_mandir}/man1/pic2tpic.1x.gz
%doc %{_mandir}/man1/transfig.1x.gz
%doc %{_docdir}/transfig/

%changelog