%define urwdir %{_datadir}/fonts/default/Type1 %define lesstifver 0.93.41 %define freetypever 2.1.5 %define x11dir /usr/X11R6 %define build_lesstif 1 %define build_freetype2 0 %define usefreetype2 1 %define fversion 3.01 Summary: A PDF file viewer for the X Window System Name: xpdf Version: %{fversion} Release: 1.2.20060mdk License: GPL Source: ftp://ftp.foolabs.com/pub/xpdf/%{name}-%{fversion}.tar.bz2 Source1: icons-%{name}.tar.bz2 Source2: ftp://ftp.foolabs.com/pub/xpdf/%{name}-chinese-simplified.tar.bz2 Source3: ftp://ftp.foolabs.com/pub/xpdf/%{name}-chinese-traditional.tar.bz2 Source4: ftp://ftp.foolabs.com/pub/xpdf/%{name}-cyrillic.tar.bz2 Source5: ftp://ftp.foolabs.com/pub/xpdf/%{name}-japanese.tar.bz2 Source6: ftp://ftp.foolabs.com/pub/xpdf/%{name}-korean.tar.bz2 Source7: ftp://ftp.foolabs.com/pub/xpdf/%{name}-thai.tar.bz2 Source8: ftp://ftp.foolabs.com/pub/xpdf/%{name}-greek.tar.bz2 Source9: ftp://ftp.foolabs.com/pub/xpdf/%{name}-latin2.tar.bz2 Source10: ftp://ftp.foolabs.com/pub/xpdf/%{name}-turkish.tar.bz2 Source11: ftp://ftp.foolabs.com/pub/xpdf/%{name}-hebrew.tar.bz2 Source12: ftp://ftp.hungry.com/pub/hungry/lesstif/srcdist/lesstif-%{lesstifver}.tar.bz2 Source13: ftp://ftp.freetype.org/freetype/freetype2/freetype-%{freetypever}.tar.bz2 Source14: ftp://ftp.foolabs.com/pub/xpdf/%{name}-arabic.tar.bz2 Patch2: %{name}-3.01-antihigh.patch.bz2 Patch3: %{name}-2.03-mozilla.patch.bz2 Patch4: %{name}-3.00-autohinting.patch.bz2 Patch5: %{name}-2.02-ext.patch.bz2 Patch6: %{name}-2.03-zoom.patch.bz2 # use some debian patches for static freetype 2.1.5 Patch9: %{name}-2.03-ft215deb.patch.bz2 # Patch10: %{name}-3.01-xpdfrc3.patch.bz2 Patch11: %{name}-3.00-pdftoppm.patch.bz2 Patch16: %{name}-chinese.patch.bz2 Patch17: %{name}-3.00-CAN-2005-0206.patch.bz2 Patch18: %{name}-3.00-gcc401.patch.bz2 Patch19: %{name}-3.01-core.patch.bz2 Patch20: %{name}-3.01-crash.patch.bz2 Patch21: %{name}-3.01-xfont.patch.bz2 Patch22: xpdf-3.01-CVE-2005-3191_2_3.patch.bz2 Patch23: xpdf-3.01-chris-overflows.patch.bz2 Patch24: xpdf-splash-overflow.diff.bz2 # URL: http://www.foolabs.com/xpdf/ Group: Office BuildRequires: XFree86-devel BuildRequires: xpm-devel BuildRequires: t1lib-devel BuildRequires: freetype2-devel >= 2.0.5 BuildConflicts: libpaper-devel BuildRequires: autoconf2.5 %if %build_lesstif BuildRequires: libfontconfig-devel BuildConflicts: lesstif-devel %else BuildRequires: lesstif-devel %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires: urw-fonts %description Xpdf is an X Window System based viewer for Portable Document Format (PDF) files. PDF files are sometimes called Acrobat files, after Adobe Acrobat (Adobe's PDF viewer). Xpdf is a small and efficient program which uses standard X fonts. %prep %setup -q -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a13 -a14 -n %{name}-%{fversion} %patch2 -p1 -b .antihigh %patch3 -p1 -b .mozilla %patch4 -p1 -b .autohint %patch5 -p1 -b .mktemp %patch6 -p1 -b .zoom %if %build_freetype2 %patch9 -p1 -b .deb %endif %patch10 -p1 -b .30 %patch11 -p1 -b .ppm %patch16 -p1 -b .chinese %patch17 -p1 -b .CAN-2005-0206 %patch18 -p1 -b .gcc401 %patch19 -p1 -b .core %patch20 -p1 -b .crash %patch21 -p1 -b .xfont %patch22 -p1 -b .cve-2005-3191_2_3 %patch23 -p1 -b .chris-overflows %patch24 -p1 -b .cve-2006-0301 %build CURRENTDIR=`pwd` # build a local lesstif library %if %build_lesstif (cd lesstif-%{lesstifver} libtoolize -c -f CFLAGS="$RPM_OPT_FLAGS" \ ./configure \ --prefix=%{x11dir} \ --libdir=%{x11dir}/%{_lib} \ --disable-shared \ --enable-static \ --disable-build-12 \ --disable-build-20 \ --enable-build-21 \ --enable-default-21 \ --disable-maintainer-mode \ --disable-debug %make make install \ prefix=$CURRENTDIR/lesstif-local \ libdir=$CURRENTDIR/lesstif-local/lib ) %endif # build a local freetype2 library %if %build_freetype2 (cd freetype-%{freetypever} %configure2_5x --disable-shared %make make install DESTDIR=$CURRENTDIR/freetype2-local \ ) %endif # build xpdf autoconf-2.5x export X_EXTRA_LIBS="-lXft -lXrender -lfontconfig -lz" %configure2_5x --with-gzip \ --bindir=%{_bindir} \ --mandir=%{_mandir} \ --enable-a4-paper \ --enable-opi \ %if %build_lesstif --with-Xm-library=$CURRENTDIR/lesstif-local/lib \ --with-Xm-includes=$CURRENTDIR/lesstif-local/include \ %endif %if %build_freetype2 --enable-freetype2 \ --with-freetype2-includes=$CURRENTDIR/freetype2-local%{_includedir}/freetype2 \ --with-freetype2-library=$CURRENTDIR/freetype2-local%{_libdir} \ %endif %if %usefreetype2 --enable-freetype2 \ --with-freetype2-includes=%{_includedir}/freetype2 \ %endif --enable-japanese \ --enable-chinese-gb \ --enable-chinese-cns make all perl -pi -e 's@/usr/local/etc/@%{_sysconfdir}/@' doc/*.1 doc/*.5 perl -pi -e 's@/usr/local/share/ghostscript/fonts@%{urwdir}@' doc/sample-xpdfrc doc/*.1 doc/*.5 perl -pi -e 's@^#displayFontT1@displayFontT1@' doc/sample-xpdfrc for i in chinese-simplified chinese-traditional cyrillic japanese \ korean thai greek latin2 turkish hebrew arabic; \ do perl -pi -e 's@/usr/local/share/xpdf@%{_datadir}/xpdf@' \ xpdf-$i/add-to-xpdfrc \ xpdf-$i/README echo >> doc/sample-xpdfrc cat xpdf-$i/add-to-xpdfrc >> doc/sample-xpdfrc rm xpdf-$i/add-to-xpdfrc done # Xpdf no longer supports X fonts perl -pi -e 's/^displayCIDFontX/#displayCIDFontX/g' doc/sample-xpdfrc perl -pi -e 's/^#urlCommand.*/urlCommand "www-browser %s"/' doc/sample-xpdfrc %install rm -rf %{buildroot} install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_menudir} make DESTDIR=%{buildroot} install for i in chinese-simplified chinese-traditional cyrillic japanese \ korean thai greek latin2 turkish hebrew arabic; \ do mkdir -p %{buildroot}%{_datadir}/%{name}/$i cp -a xpdf-$i/* %{buildroot}%{_datadir}/%{name}/$i/ done cat > %{buildroot}%{_menudir}/xpdf <<EOF ?package(xpdf): command="xpdf" needs="X11" \ icon="xpdf.png" section="Office/Publishing" title="Xpdf" \ mimetypes="text/pdf;text/x-pdf;application/pdf;application/x-pdf" \ longtitle="Views PDF files" EOF # mdk icons install -d %{buildroot}%{_iconsdir} tar xjf %SOURCE1 -C %{buildroot}%{_iconsdir} %post %update_menus %postun %clean_menus %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc CHANGES README %dir %{_datadir}/%{name} %{_bindir}/* %{_mandir}/man1/* %{_mandir}/man5/* %{_menudir}/* %{_iconsdir}/*.* %{_liconsdir}/*.* %{_miconsdir}/*.* %{_datadir}/%{name}/* %config(noreplace) %{_sysconfdir}/xpdfrc %changelog * Wed Feb 01 2006 Stew Benedict <sbenedict@mandriva.com> 3.01-1.2.20060mdk - P24: security fix for CVE-2006-0301 * Tue Jan 03 2006 Stew Benedict <sbenedict@mandriva.com> 3.01-1.1.20060mdk - security update for CVE-2005-3191,3192,3193 (P22) - additional overflow issues discovered by Chris Evans (P23) (CVE-2005-3624,3625,3626,3627) * Wed Aug 24 2005 Giuseppe Ghibò <ghibo@mandriva.com> 3.01-1mdk - Release 3.01. - Rebuilt Patch2. - Removed Patch7, Patch12, Patch13, Patch14, Patch19, Patch21 (merged upstream). - Removed Patch15, Patch20, Patch22. - Rebuilt Patch10. - Added Patch19 (core), Patch20 (crash), Patch21 (xfont) merged from RH. * Wed Aug 24 2005 Giuseppe Ghibò <ghibo@mandriva.com> 3.00pl3-9mdk - Added Patches from Funda Wang (Patch21, Patch22) for bug #17308. * Tue Aug 16 2005 Laurent MONTEL <lmontel@mandriva.com> 3.00pl3-8mdk - Fix crash on x86_64 - Add patch20: fix compile on x86_64 * Wed Aug 03 2005 Giuseppe Ghibò <ghibo@mandriva.com> 3.00pl3-7mdk - Added Patch18 for gcc 4.0.1. * Sat Apr 02 2005 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00pl3-6mdk - Fix bug #14236. * Wed Mar 16 2005 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00pl3-5mdk - Added Source14 (for fixing bug #12209). * Thu Mar 10 2005 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00pl3-4mdk - Added Patch17 for CAN-2005-0206 (from Stew's updates). * Wed Mar 09 2005 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00pl3-3mdk - Added entry for Chinese Traditional and Simplified (fix bug #14236). * Mon Feb 14 2005 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00pl3-2mdk - Added Patch15 for MDKSA-2005:017 (CAN-2005-0064). * Wed Jan 19 2005 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00pl3-1mdk - Added pl1,pl2,pl3 patches. * Wed Jan 19 2005 Frederic Lepied <flepied@mandrakesoft.com> 3.00-9mdk - use www-browser in urlCommand * Tue Jan 11 2005 Olivier Thauvin <thauvin@aerov.jussieu.fr> 3.00-8mdk - Rebuild for t1lib - remove redondant requires * Mon Jul 19 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00-7mdk - Rebuilt. * Thu Jun 3 2004 Laurent Montel <lmontel@mandrakesoft.com> 3.00-6mdk - Rebuild against new gcc * Mon Mar 01 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00-5mdk - Added mimetypes to menu. * Tue Feb 10 2004 Götz Waschk <waschk@linux-mandrake.com> 3.00-4mdk - fix buildrequires * Mon Feb 09 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00-3mdk - use shared freetype library. - Re-adapted Patch7 (ft217). - Reverted to lesstif 0.93.41 to avoid warnig "XtRemoveGrab asked to remove a widget not on the list". * Wed Feb 4 2004 Götz Waschk <waschk@linux-mandrake.com> 3.00-2mdk - fix the menu entry * Mon Jan 26 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.00-1mdk - Release 3.00. - Removed Patch1 (zapf). - Rebuilt Patch4 (autohint) but disabled. - Removed Patch7 (ft217). - Removed Patch8 (jbig2). - Added Patch10 for new syntax. - Added Patch11 for linking pdftoppm with zlib. * Wed Jan 21 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.03-4mdk - Use shared freetype2. * Thu Jan 08 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.03-3mdk - Fixed prototypes of JBIG2 function (Patch9). - Use static library freetype 2.1.5, because shared 2.1.7 doesn't work. * Sat Dec 20 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.03-2mdk - lesstif uses Xft, so xpdf should be linked against it. - add Patch7 to get xpdf working against freetype 2.1.7 (fixes bug #6595). - add zoom level of 600% and 800%. * Thu Dec 18 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.03-1mdk - Release 2.03. - Rebuilt Patch3, Patch4. * Sat Aug 30 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.02pl1-4mdk - Merged Patch5 from RH: more secure temp creation (use $TMPDIR & mktemp). * Wed Aug 27 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.02pl1-3mdk - Fixed DIRM distrilint prob. * Fri Aug 15 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.02pl1-2mdk - Use freetype2 library as default. * Fri Aug 15 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.02pl1-1mdk - Avoid FT_LOAD_NO_HINTING. - Upgraded lesstif to release 0.93.41. - Release 2.02pl1. - Removed Patch5 (merged into sources). - Updated Patch3. * Tue Jun 10 2003 Laurent MONTEL <lmontel@mandrakesoft.com> 2.01-4mdk - Rebuild without libpaper (add buildconflict) * Fri Jun 06 2003 Per Øyvind Karlsen <peroyvind@sintrax.net> 2.01-3mdk - use double %%'s in changelog * Wed Mar 12 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.01-2mdk - Rebuild using a local and statically linked lesstif, version 0.93.40, because lesstif version 0.93.36 causes xpdf to crash on certain PDF files, and upgrade main lesstif to release 0.93.40 could be dangerous right now. Fixes bug #3086. * Thu Feb 13 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.01-1mdk - Release: 2.01. - Removed Patch4 (chinese), now merged. * Sat Jan 04 2003 Vincent Danen <vdanen@mandrakesoft.com> 2.00-2mdk - apply security fix from author * Sat Nov 09 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.00-1mdk - Release 2.00. * Wed Aug 14 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 1.01-4mdk - Automated rebuild with gcc 3.2-0.3mdk * Thu Jul 25 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 1.01-3mdk - Automated rebuild with gcc3.2 * Thu Jun 13 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 1.01-2mdk - Fixed a bug for the Chinese simplified (report by <wtzhu@ustc.edu>). * Fri May 24 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 1.01-1mdk - New release: 1.01. - Use dynamic version of freetype2 library. * Sun Mar 03 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 1.00-2mdk - added changes netscape -> mozilla. - added missed xpdfrc man page. * Sat Feb 02 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 1.00-1mdk - updated to release 1.0. - enabled freetype2 support. - readapted -zapf and -antihigh patches. - png icons. - added CMap files for Chinese-simplified, Chinese-traditional, Cyrillic, Japanese, Korean, Thai. * Mon Oct 29 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.93-2mdk - added (conditional) freetype2 support, but disabled because PDF files currently files looks ugly when freetype2 enabled. - renamed patches. - added Patch4). - %%make reverted to make (it no longer works with freetype2 enabled). - currently freetype * Sun Oct 28 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 0.93-1mdk - 0.93, linked with t1lib 1.3. * Thu Aug 23 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.92-5mdk - rebuilt with latest t1lib 1.2. * Wed Jun 13 2001 Frederic Crozat <fcrozat@mandrakesoft.com> 0.92-4mdk - New office menu structure - Correct icons * Tue Mar 13 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.92-3mdk - removed unused patches. - build with new t1lib. * Sun Jan 07 2001 David BAUDENS <baudens@mandrakesoft.com> 0.92-2mdk - s/Copyright/License - Fix BuildRequires - Spec clean up * Mon Dec 04 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 0.92-1mdk - new and shiny version. - remove rgb patch (#7) for it seems to have been merged with the source. - re-enable Chinese and Japanese, why was it ever removed? - standard directory ownership problem, fixed. * Fri Nov 17 2000 David BAUDENS <baudens@mandrakesoft.com> 0.91-7mdk - Rebuild with gcc-2.96 & glibc-2.2 * Mon Oct 09 2000 Daouda Lo <daouda@mandrakesoft.com> 0.91-6mdk - build with generic optflags (ghibo ) * Mon Oct 09 2000 Daouda Lo <daouda@mandrakesoft.com> 0.91-5mdk - icons * Sat Oct 07 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.91-4mdk - fixed 0.91-t1urw patch. * Sat Oct 07 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.91-3mdk - re-adapted patch 0.90-t1urw to version 0.91 (it allows to use Type1 URW fonts for standard PDF 14 fonts for better quality). * Fri Oct 06 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.91-2mdk - fixed a typo in %%post and %%postun scripts. - added icons. - added rgb, patch from RedHat. - enabled opi. * Tue Aug 15 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 0.91-1mdk - s|0.90|0.91| aka decrypt me babe. - remove the font patch. * Wed Aug 09 2000 Thierry Vignaud <tvignaud@mandrakesoft.com> 0.90-11mdk - BM - spechelper * Tue Aug 08 2000 Frederic Lepied <flepied@mandrakesoft.com> 0.90-10mdk - automatically added BuildRequires * Fri Apr 21 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.90-9mdk - removed xpdf.desktop also from the %%install stage. * Sat Apr 01 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.90-8mdk - updated for t1lib 1.0.1. - added things for new menu entry. - removed xpdf.desktop. * Thu Mar 02 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 0.90-7mdk - increased default antialias font level from low to high. Files look nicer. * Tue Feb 08 2000 Geoffrey Lee <snailtalk@linux-mandrake.com> 0.90-6mdk - Correct the URL in the spec file - remove egcs as build require * Thu Jan 13 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 0.90-5mdk - Fix build as non-root. * Sat Dec 18 1999 Giuseppe Ghibò <ghibo@linux-mandrake.com> - fixed a bug for Times-Italic and Helvetica-BoldOblique name in URW fonts. * Tue Dec 07 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - Fix for gcc-2.95. * Fri Nov 11 1999 Giuseppe Ghibò <ghibo@linux-mandrake.com> - built for Oxygen. * Mon Sep 27 1999 Giuseppe Ghibò <ghibo@linux-mandrake.com> - added patch to use aliased Type 1 URW fonts by default for standard 14 PDF fonts. - added Preston Brown <pbrown@redhat.com>'s zapf patch. * Wed Aug 11 1999 Giuseppe Ghibò <ghibo@linux-mandrake.com> - update to version 0.90. - strip binaries. - added t1lib dependencies. * Thu May 6 1999 Bernhard Rosenkränzer <bero@mandrakesoft.com> - Mandrake adaptions - handle RPM_OPT_FLAGS * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> - auto rebuild in the new build environment (release 4) * Wed Mar 17 1999 Preston Brown <pbrown@redhat.com> - converted wmconfig to desktop entry * Wed Feb 24 1999 Preston Brown <pbrown@redhat.com> - Injected new description and group. * Mon Nov 30 1998 Preston Brown <pbrown@redhat.com> - updated to 0.80 * Fri Nov 06 1998 Preston Brown <pbrown@redhat.com> - patched to compile with new, stricter egcs * Tue May 05 1998 Cristian Gafton <gafton@redhat.com> - updated to 0.7a * Thu Nov 20 1997 Otto Hammersmith <otto@redhat.com> - added changelog - added wmconfig