Name:            pstoedit
Summary:         Translator of PostScript and PDF graphics into various vector formats
Summary(ja):     ポストスクリプトやPDFを多種多様なベクタ形式に変換
Version:         3.50
Release:         3%{?_dist_release}

Group:           Applications/Graphics
License:         GPLv2
URL:             http://www.pstoedit.net/pstoedit

Source0:         http://prdownloads.sourceforge.net/pstoedit/%{name}-%{version}.tar.gz
#Source1:         http://www.helga-glunz.homepage.t-online.de/plugins/plugins_linux_350.tgz

BuildRoot:       %{_tmppath}/%{name}-%{version}-root
BuildRequires:   libemf-devel libpng-devel gd-devel
BuildRequires:   ImageMagick-c++-devel zlib-devel
BuildRequires:   libtool sed

Vendor:          Project Vine
Distribution:    Vine Linux

%description
pstoedit translates PostScript and PDF graphics into other vector
formats. Currently pstoedit can generate the following formats:
    * Tgif .obj format (for tgif version >= 3)
    * .fig format for xfig
    * pdf - Adobe's Portable Document Format
    * gnuplot format
    * Flattened PostScript (with or without Bezier curves)
    * DXF - CAD exchange format
    * LWO - LightWave 3D
    * RIB - RenderMan
    * RPL - Real3D
    * Java 1 or Java 2 applet
    * Idraw format (in fact a special form of EPS that idraw can read)
    * Tcl/Tk
    * HPGL
    * AI (Adobe Illustrator) (based on ps2ai.ps - not a real pstoedit driver - see notes below and manual)
    * Windows Meta Files (WMF) (Windows 9x/NT only)
    * Enhanced Windows Meta Files (EMF) (Windows 9x/NT only)
    * OS/2 meta files (OS/2 only)
    * PIC format for troff/groff
    * MetaPost format for usage with TeX/LaTeX
    * LaTeX2e picture
    * Kontour
    * GNU Metafile (plotutils / libplot)
    * Sketch ( http://sketch.sourceforge.net )
    * Mathematica
    * via ImageMagick to any format supported by ImageMagick
    * SWF (beta release state - still lot's of features missing (fonts, dash handling, ...)

%description -l ja
pstoeditはポストスクリプトやPDFを多種多様なベクタ形式に変換します。サ
ポートしている出力ファイル形式は下記の通りです。
    *  Tgif .obj format (for tgif version >= 3)
    * .fig format for xfig
    * pdf - Adobe's Portable Document Format
    * gnuplot format
    * Flattened PostScript (with or without Bezier curves)
    * DXF - CAD exchange format
    * LWO - LightWave 3D
    * RIB - RenderMan
    * RPL - Real3D
    * Java 1 or Java 2 applet
    * Idraw format (in fact a special form of EPS that idraw can read)
    * Tcl/Tk
    * HPGL
    * AI (Adobe Illustrator) (based on ps2ai.ps - not a real pstoedit driver - see notes below and manual)
    * Windows Meta Files (WMF) (Windows 9x/NT only)
    * Enhanced Windows Meta Files (EMF) (Windows 9x/NT only)
    * OS/2 meta files (OS/2 only)
    * PIC format for troff/groff
    * MetaPost format for usage with TeX/LaTeX
    * LaTeX2e picture
    * Kontour
    * GNU Metafile (plotutils / libplot)
    * Sketch ( http://sketch.sourceforge.net )
    * Mathematica
    * via ImageMagick to any format supported by ImageMagick
    * SWF (beta release state - still lot's of features missing (fonts, dash handling, ...)

%package        devel
Summary:        pstoedit C Library developer.
Summary(ja):    pstoedit 開発ライブラリ
Group:          Development/Libraries
URL:            http://www.pstoedit.net/pstoedit
Requires:       pstoedit = %{version}-%{release}
Requires:       libpng-devel libstdc++-devel zlib-devel 

%description devel
pstoedit library

%description -l ja devel
pstoedit 開発ライブラリ

%prep
%setup -q 
 %{__perl} -p -i -e 's|BINDIR=/usr/local/bin||' autogen.sh

%build
./autogen.sh
libtoolize -c -f

# needed because of definitions in imagemagick headers that break with -pedantic
sed -ie 's/-pedantic//' configure

%configure  \
	--disable-static \
	--without-swf \
	--with-emf \
	--with-libemf-lib=%{_libdir} \
	--with-libemf-include=%{_includedir}/libEMF 
  
# don't use _smp_mflags
%{__make}

%install
rm -rf $RPM_BUILD_ROOT

%makeinstall
#ifarch %{ix86}
#{__install} -m 755 plugins_linux_350.so %{buildroot}%{_libdir}/%{name}
#endif

%{__mkdir_p} $RPM_BUILD_ROOT%{_mandir}/man1
%{__install} -m 644 doc/%{name}.1  %{buildroot}%{_mandir}/man1

%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d
echo "%{_libdir}/%{name}" > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d/pstoedit.conf

# %{__mkdir_p} %{buildroot}%{_bindir}
# %{__install} -c config/pstoedit-config %{buildroot}%{_bindir}
# %{__mkdir_p} %{buildroot}%{_datadir}
# %{__install} -c -m 644 config/pstoedit.m4  %{buildroot}%{_datadir}/aclocal
# %{__mkdir_p} %{buildroot}%{_datadir}/pstoedit/swffonts
# %{__install} -c -m 644 misc/swffonts/default.fdb %{buildroot}%{_datadir}/pstoedit/swffonts
# %{__install} -c -m 644 misc/latex2e.fmp %{buildroot}%{_datadir}/pstoedit
# %{__install} -c -m 644 misc/mpost.fmp %{buildroot}%{_datadir}/pstoedit
# %{__install} -c -m 644 misc/safer.ps %{buildroot}%{_datadir}/pstoedit
# %{__install} -c -m 644 misc/svg.fmp %{buildroot}%{_datadir}/pstoedit
# %{__install} -c -m 644 misc/wemf.fmp %{buildroot}%{_datadir}/pstoedit
# %{__install} -c -m 644 misc/examplefigmap.fmp %{buildroot}%{_datadir}/pstoedit
# ./libtool --mode=install %{__install} -c  src/libpstoedit.la  %{buildroot}%{_libdir}
# ./libtool --mode=install %{__install} -c  src/pstoedit  %{buildroot}%{_bindir}
# %{__mkdir_p} %{buildroot}%{_libdir}/pstoedit
# ./libtool --mode=install %{__install} -c  src/libp2edrvstd.la   %{buildroot}%{_libdir}/pstoedit
# ./libtool --mode=install %{__install} -c  src/libp2edrvmagick++.la  -inst-prefix %{buildroot} %{buildroot}%{_libdir}/pstoedit
# %{__install} -c -m 644 src/pstoedit.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/pstoedll.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/pstoeditoutputlib.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/pstoeditoptions.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/pstoeditoptions.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/cppcomp.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/drvbase.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/drvfuncs.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/miscutil.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/base64writer.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/poptions.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/ordlist.h  %{buildroot}%{_prefix}/include/pstoedit
# %{__install} -c -m 644 src/psimage.h  %{buildroot}%{_prefix}/include/pstoedit
# 
# %{__install} -m 775 lib/pstoedit/plugins_linux.so %{buildroot}%{_libdir}/pstoedit
# for i in %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/pstoedit/*.la
#  do cp -p $i $i~
#  sed s:%{buildroot}::g <$i~ >$i
#  rm $i~
# done
# 

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc copying doc/*.htm
%{_sysconfdir}/ld.so.conf.d/%{name}.conf
%{_bindir}/pstoedit
%{_libdir}/*.so.*
%dir %{_libdir}/pstoedit
%{_libdir}/%{name}/*.so
%{_libdir}/%{name}/*.so.*
%{_datadir}/%{name}
%{_mandir}/*/*

%files devel
%defattr(-,root,root)
%{_libdir}/*.so
%{_includedir}/pstoedit/*
%{_libdir}/pkgconfig/*.pc
%{_datadir}/aclocal/*
%exclude %{_libdir}/*.la
%exclude %{_libdir}/pstoedit/*.la

%changelog
* Sat Oct  2 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.50-3
- rebuilt with ImageMagick-6.6.4.8

* Thu Sep 30 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.50-2
- rebuilt with rpm-4.8.1 for pkg-config

* Thu Apr 29 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.50-1
- new upstream release
- built with new toolchain and ImageMagick-6.6.1.5
- used ld.so.conf.d instead of ld.so.conf

* Sun Jun 14 2009 Shu KONNO <owa@bg.wakwak.com> 3.45-1
- applied new versioning policy, and spec in utf-8
- update pstoedit to 3.45
- added --disable-static option to %%configure
- added --without-swf option, because of fail to compile

* Fri Oct 13 2006 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 3.44-0vl2
- install plugins_linux.3.42.so only on ix86 archs
  (what should we do with the intel binary file on other archs, huh?)

* Thu Aug 17 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.44-0vl1
- rebuilt for VineSeed (4.0)
- updated to 3.44
- fixed build dependancy

* Wed Sep 28 2005 Susumu Tanimura <stanimura-ngs@umin.ac.jp>
- Updated to 3.42

* Tue Jan 11 2005 Susumu Tanimura  <stanimura-ngs@umin.ac.jp>
- Updated to 3.40

* Fri Sep 24 2004 Susumu Tanimura  <stanimura-ngs@umin.ac.jp>
- Added plugins
- Disable emf support

* Wed Sep 22 2004 Susumu Tanimura  <stanimura-ngs@umin.ac.jp>
- Added buildrequires

* Thu Oct  2 2003  Susumu Tanimura  <stanimura-ngs@umin.ac.jp>
- initial package