# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify Alma, CentOS, CentOS Stream and Rocky Linux as rhel %if "%{__distinit}" == "a" || "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "cs" || "%{__distinit}" == "rl" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif %global desktopvendor city-fan.org %global vjumbo 20070520 Name: xv Version: 3.10a Release: 43.0.%{__distinit}%{__distvers} Summary: X based image viewer for darned near all images Summary(de.UTF-8): X-basierender Bild-Viewer für praktische sämtliche Grafiken Summary(es.UTF-8): Visualizador de imágenes para X para cuasi todos los formatos de imágenes Summary(fr.UTF-8): Visualisateur sous X pour quasiment tous les types d'images Summary(pl.UTF-8): Przeglądarka różnego rodzaju plików graficznych pracująca w X Window Summary(pt_BR.UTF-8): Visualizador de imagens para X para quase todos os formatos de imagens Summary(ru.UTF-8): Программа для просмотра и преобразования файлов изображений для X Summary(tr.UTF-8): X tabanlı resim görüntüleyici Summary(uk.UTF-8): Програма для перегляду та перетворення файлів зображень для X License: Shareware URL: http://www.trilon.com/xv/xv.html Source0: ftp://ftp.trilon.com/pub/xv/xv-%{version}.tar.gz Source1: http://downloads.sf.net/png-mng/xv-3.10a-jumbo-patches-%{vjumbo}.tar.gz Source2: DISTRIBUTE.txt Source3: xv.desktop Source4: xv.png Source5: ftp://ftp.trilon.com/pub/xv/xvman310a-html.tar.gz Source6: xv-non-english-Xman-pages.tar.bz2 Patch0: xv-jumbo-20070520-makefile.patch Patch1: http://www.gregroelofs.com/code/xv-3.10a-enhancements.20070520-20081216.diff Patch2: xv-3.10a-cleanup.patch Patch3: xv-FLmask.v2.1.patch Patch4: xv-wait.patch Patch5: xv-3.10a-libpng15.patch Patch6: xv-3.10a-namemax.patch Patch7: xv-3.10a-xvcut.patch Patch8: xv-3.10a-format.patch Patch9: xv-3.10a-png-itxt.patch Patch10: xv-3.10a-smooth-fix2.patch Patch11: xv-3.10a-signal.patch Patch12: xv-3.10a-gcc10.patch Patch13: xv-3.10a-20220127-jasper.patch Patch14: xv-3.10a-c99isms.patch Patch15: xv-3.10a-utf8-docs.patch Patch16: xv-3.10a-LDFLAGS.patch Patch17: xv-3.10a-multi-APP1.patch Patch18: xv-3.10a-corrupt-GIF.patch Patch19: xv-3.10a-libjpeg-messages.patch Patch20: xv-3.10a-dirw.patch Patch21: xv-3.10a-jpeg8.patch Patch22: xv-3.10a-ticks.patch BuildRequires: coreutils BuildRequires: desktop-file-utils BuildRequires: gcc BuildRequires: grep BuildRequires: jasper-devel BuildRequires: libjpeg-devel %if 0%{?fedora} < 32 && 0%{?rhel} < 8 BuildRequires: libpng10-devel %else BuildRequires: libpng-devel %endif BuildRequires: libtiff-devel BuildRequires: libX11-devel BuildRequires: libXt-devel BuildRequires: make BuildRequires: patch BuildRequires: sed # Require hicolor-icon-theme ownership of %%{_datadir}/icons/hicolor/48x48/apps/ Requires: hicolor-icon-theme %description This is the famous 'xv' by John Bradley. It is shareware, but we ship it with the permission of the authors. It is a graphics viewer for many file types, including gif, jpg, tiff, xwd, etc. It also has manipulation features such as cropping, expanding, etc. Patched to include flmask, a popular feature in Japan. %description -l de.UTF-8 Dies ist das berühmte 'xv' von John Bradley, ein Shareware- Programm, das wir mit Erlaubnis des Autors liefern. Es ist ein Grafik-Viewer für diverse Dateitypen, einschließlich gif, funktionen wie Trimmen, Strecken u.ä. Mit flmask. %description -l es.UTF-8 Este es el famoso 'xv' de John Bradley. Es shareware, pero nosotros lo distribuimos con la permisión de los autores. Es un visor gráfico para varios tipos de archivos, incluyendo gif, jpg, tiff, xwd, etc. También posee características de manejo como corte, expansión, etc. %description -l fr.UTF-8 Le célébre xv de John Bradley. C'est shareware, mais nous le distribuons avec la permission de l'auteur. C'est un visualiseur graphique pour de nombreux formats de fichier dont gif, jpg, tiff, xwd, etc. Il offre aussi des fonctionnalités comme la capture, l'extension, la retouche de palette, etc. Flmask. %description -l pl.UTF-8 Słynne 'xv' Johna Bradleya. Jest to program shareware, ale udostępniamy go za zgodą autora. Jest to przeglądarka plików graficznych w różnych formatach, takich jak: gif, jpg, tiff, xwd i innych. Ma też proste możliwości obróbki obrazków, takie jak obcinanie czy rozszerzanie. Zawiera obsługę flmask. %description -l pt_BR.UTF-8 Este é o famoso 'xv' de John Bradley. Ele é shareware, mas nós o distribuimos com a permissão dos autores. É um visualizador gráfico para vários tipos de arquivos, incluindo gif, jpg, tiff, xwd, etc. Também possui características de manipulação como corte, expansão, etc. %description -l ru.UTF-8 Xv - это программа для просмотра и преобразования изображений для X Window System. Xv умеет показывать GIF, JPEG, TIFF, PBM, PPM, PDF, X11 bitmap, Utah Raster Toolkit RLE, PDS/VICAR, Sun Rasterfile, BMP, PCX, IRIS RGB, XPM, Targa, XWD, PostScript(TM) и PM. Xv также умеет делать простую обработку изображений - cropping, expanding, снимки экрана и т.п. %description -l tr.UTF-8 xv başta PNG, GIF, JPG, BMP, XBM, XPM olmak üzere birçok resim dosyasını görüntüleyebilir, değişik formatlarda kaydedebilir ve üzerinde boyutlandırma, renk değiştirme gibi bazı temel işlemleri yapabilir. Çok detaylı işlemler yapamamasına rağmen temel resim işlemlerinde öncellikle kullanılabilecek, kullanışlı arayüzüne sahip bir programdır. Flmask. %description -l uk.UTF-8 Xv - це програма для перегляду та перетворення зображень для X Window System. Xv вміє показувати GIF, JPEG, TIFF, PBM, PPM, PDF, X11 bitmap, Utah Raster Toolkit RLE, PDS/VICAR, Sun Rasterfile, BMP, PCX, IRIS RGB, XPM, Targa, XWD, PostScript(TM) та PM. Xv також вміє робити просту обробку зображень - cropping, expanding, знімки экрану і т.і. %package doc Summary: Manuals in various formats for the xv image viewer BuildArch: noarch %description doc Manuals in various formats for the xv image viewer, plus technical details of the various image file formats supported. %prep %setup -q -b 1 -a 5 -a 6 # Apply 20070520 jumbo enhancement patch, bundled with %%{SOURCE1} patch -p1 < ../xv-3.10a-jumbo-fix-enh-patch-%{vjumbo}.txt rm ../xv-3.10a-jumbo-fix-enh-patch-%{vjumbo}.txt # Interim jumbo patch update %patch -P 1 -p1 # Clean up code %patch -P 2 -p1 # Add FLmask feature (rebased patch; original version won't apply after jumbo patch) %patch -P 3 -p1 # Replace CLK_TCK with sysconf(_SC_CLK_TCK) (http://bugzilla.rpmfusion.org/1929) %patch -P 4 -p1 # libpng 1.5 compatibility %patch -P 5 -p0 # NAME_MAX buffer overflow fix %patch -P 6 -p1 # Cut/paste fix for 24bit+ images %patch -P 7 -p1 # Fix build with -Werror=format-security %patch -P 8 # Fix crash when viewing PNGs with iTXt/utf8 comments %if %([ -f /usr/include/libpng10/png.h ] && echo 0 || echo 1) # libpng10 does not support iTXt chunks %patch -P 9 -p1 %endif # Fix crash due to off-by-one smoothing bug %patch -P 10 -p1 # Hopefully fix signal issue (#3044) %patch -P 11 -p0 # Fix FTBFS with GCC 10 %patch -P 12 -p0 # Fix Jasper support to use proper library APIs (patch from Jasper upstream maintainer) %patch -P 13 -p0 # Fix some C99-isms introduced in previous patch, breaks build with older compilers %patch -P 14 -p2 # Recode docs as UTF-8 %patch -P 15 -p2 # Honour LDFLAGS if present in the environment %patch -P 16 -p2 # Ignore multiple APP1 data structs; libjpeg can't write them %patch -P 17 -p2 # Fix segfault seen with some corrupt GIF file %patch -P 18 -p2 # Report errors from libjpeg %patch -P 19 -p2 # In file selection box, do not move cursor if no filename is there # [Novell BZ #506573] %patch -P 20 -p2 # In libjpeg the numbers of out_color_components and color_components are # different for quantize_colors, i.e. color_components is the colormap # (normally 1) [Novell BZ #412491] %patch -P 21 -p2 # More thorough version of CLK_TCK patch (patch4) # [Novell BZ #237214] %patch -P 22 -p2 # Fix compiler options, install directories; enable JPEG 2000 support %patch -P 0 -p1 # Include permission to distribute install -m 0644 -p %{SOURCE2} . # Reorganize docs # # Note: Man pages for p?m file formats would conflict with netpbm-progs if installed under %%{_mandir} mv 00_README README.FLmask mv docs/README README.docs mkdir docs/{formats,manuals}/ mv docs/{bmp.doc,epsf.ps,gif*,p[bgp]m.5,xpm.ps} docs/formats/ mv docs/{xvdocs.{ps,pdf},xvtitle.ps} docs/manuals/ # HTML manual mv -f xvman310a docs/manuals/html # Fix line endings for doc in docs/manuals/xv*.ps; do sed -e 's/\r$//' ${doc} > ${doc}.unix touch -r ${doc} ${doc}.unix mv -f ${doc}.unix ${doc} done # Fix directory location of X libs and link with libXt sed -i -e 's@-L/usr/X11R6/lib[[:space:]]@-L%{_libdir} -lXt @' Makefile %build # Use libpng10 rather than latest libpng # # This is not because later versions won't work, it's because I'm using xv as a # test vehicle for libpng10 updates make %{?_smp_mflags} \ %if %([ -f /usr/include/libpng10/png.h ] && echo 0 || echo 1) CCOPTS="%{optflags}" %else CCOPTS="%{optflags} `pkg-config --cflags libpng10 2>/dev/null`" \ PNGLIB=-lpng10 %endif %install make install DESTDIR=%{buildroot} desktop-file-install \ --vendor %{desktopvendor} \ --dir %{buildroot}%{_datadir}/applications \ %{SOURCE3} install -D -p -m 0644 %{SOURCE4} \ %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/xv.png # Non-English man pages install -D -p -m 0644 fi/man1/xv.1 \ %{buildroot}%{_mandir}/fi/man1/xv.1 install -D -p -m 0644 pl/man1/xvpictoppm.1 \ %{buildroot}%{_mandir}/pl/man1/xvpictoppm.1 # Populate the docs directory mkdir -p %{buildroot}%{_docdir}/xv-%{version}/ for doc in \ BUGS \ CHANGELOG \ copyright.h \ CPMASK \ DISTRIBUTE.txt \ IDEAS \ README \ README.docs \ README.FLmask \ README.jumbo \ README.pcd \ xv_mgcsfx.sample \ docs/bigxv.jpg \ docs/formats/ \ docs/manuals/ do cp -a ${doc} %{buildroot}%{_docdir}/xv-%{version}/ done # Icon cache and desktop database updates redundant from Fedora 26 onwards %if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 25) %post touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : update-desktop-database &> /dev/null || : %postun if [ $1 -eq 0 ] ; then touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi update-desktop-database &> /dev/null || : %posttrans gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %files %doc %{_docdir}/xv-%{version}/BUGS %doc %{_docdir}/xv-%{version}/CHANGELOG %doc %{_docdir}/xv-%{version}/copyright.h %doc %{_docdir}/xv-%{version}/CPMASK %doc %{_docdir}/xv-%{version}/DISTRIBUTE.txt %doc %{_docdir}/xv-%{version}/IDEAS %doc %{_docdir}/xv-%{version}/README %doc %{_docdir}/xv-%{version}/README.FLmask %doc %{_docdir}/xv-%{version}/README.jumbo %doc %{_docdir}/xv-%{version}/README.pcd %doc %{_docdir}/xv-%{version}/xv_mgcsfx.sample %{_bindir}/bggen %{_bindir}/vdcomp %{_bindir}/xcmap %{_bindir}/xv %{_bindir}/xvpictoppm %{_datadir}/applications/%{desktopvendor}-xv.desktop %{_datadir}/icons/hicolor/48x48/apps/xv.png %{_mandir}/man1/bggen.1* %{_mandir}/man1/vdcomp.1* %{_mandir}/man1/xcmap.1* %{_mandir}/man1/xv.1* %{_mandir}/man1/xvpictoppm.1* %lang(fi) %{_mandir}/fi/man1/xv.1* %lang(pl) %{_mandir}/pl/man1/xvpictoppm.1* %files doc %doc %{_docdir}/xv-%{version}/README.docs %doc %{_docdir}/xv-%{version}/bigxv.jpg %doc %{_docdir}/xv-%{version}/formats/ %doc %{_docdir}/xv-%{version}/manuals/ %changelog * Thu Mar 30 2023 Paul Howarth - 3.10a-43.0 - Avoid deprecated patch syntax * Tue Aug 9 2022 Paul Howarth - 3.10a-42.0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Thu Mar 3 2022 Paul Howarth - 3.10a-41.0 - Fix incorrectly applied corrupt GIF patch * Fri Feb 25 2022 Paul Howarth - 3.10a-40.0 - Ignore multiple APP1 data structs; libjpeg can't write them - Fix segfault seen with some corrupt GIF file - Report errors from libjpeg - In file selection box, do not move cursor if no filename is there - Add fix for colormap in 8-bit JPEG mode - Add more thorough version of CLK_TCK patch * Wed Feb 16 2022 Paul Howarth - 3.10a-39.0 - Fix Jasper support to use proper library APIs (patch from Michael Adams, Jasper upstream maintainer) - Honour LDFLAGS if present in the environment * Tue Mar 2 2021 Paul Howarth - 3.10a-36.0 - Fix jas_memdump replacement function * Sun May 17 2020 Paul Howarth - 3.10a-34.3 - Build dependencies should not include %%{?_isa} as it makes the resulting source packages arch-specific * Wed Feb 26 2020 Paul Howarth - 3.10a-34.2 - Builds for Fedora 32 also use libpng rather than libpng10 * Wed Feb 26 2020 Paul Howarth - 3.10a-34.1 - Builds for Fedora 33 and RHEL 8 onwards use libpng rather than libpng10 * Sun Feb 9 2020 Paul Howarth - 3.10a-34 - Fix FTBFS with GCC 10 * Tue Mar 12 2019 Paul Howarth - 3.10a-31 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Tue Sep 18 2018 Paul Howarth - 3.10a-30 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Feb 7 2018 Paul Howarth - 3.10a-27 - Hopefully fix signal bug (#3044) - Icon cache and desktop database updates redundant from Fedora 26 onwards - Drop support for EOL distributions prior to Fedora 13, EL-6 - Always have modular X - Always have Jasper - Always have noarch sub-packages - Always have hicolor-icon-theme - Always have %%posttrans support in rpm - Drop redundant explicit buildroot cleaning - Drop legacy BuildRoot: and Group: tags - Drop redundant %%defattr * Mon Jul 6 2015 Paul Howarth - 3.10a-23 - Patch by Erling A. Jacobsen to fix iTXt/utf8 png comment bug (#3141, #3704) - Patch by Erling A. Jacobsen to fix smoothing off-by-one bug (#3142) * Wed Oct 22 2014 Paul Howarth - 3.10a-20 - Fix build with -Werror=format-security * Fri Mar 29 2013 Paul Howarth - 3.10a-18 - Patch for cut/paste bug in 24+ bit mode (by Mark Brader ) - Further buffer overflow fix for overly long command line argument * Thu Mar 14 2013 Paul Howarth - 3.10a-17 - Additional fix for long filename buffer overflow * Tue Mar 5 2013 Paul Howarth - 3.10a-16 - Fix buffer overflow caused by filenames longer than the window title limit * Mon Aug 6 2012 Paul Howarth - 3.10a-15 - Rebuild for libtiff.so.5 (libtiff 4.0) in Rawhide * Fri Dec 9 2011 Paul Howarth - 3.10a-13 - Add patch from Gentoo for libpng 1.5 compatibility * Thu Sep 8 2011 Paul Howarth - 3.10a-12 - Fix wait timer for slideshows (http://bugzilla.rpmfusion.org/1929) * Mon Aug 1 2011 Paul Howarth - 3.10a-9 - Use patch instead of scripted iconv to convert character encodings - Nobody else likes macros for commands - Fix dist tag for CentOS 6 and Scientific Linux * Sun Jul 18 2010 Paul Howarth - 3.10a-8 - Drop dependency on man from RHEL-5 onwards, where %%{_mandir}/{fi,pl} are included in the filesystem package * Wed May 12 2010 Paul Howarth - 3.10a-7 - Fix dist tag for RHEL-6 Beta * Mon Feb 22 2010 Paul Howarth - 3.10a-6 - Dist tag for Rawhide no longer needs special-casing * Wed Sep 16 2009 Paul Howarth - 3.10a-5 - Update desktop file MimeType list (thanks to goeran@uddeborg.se) * Sat Sep 5 2009 Paul Howarth - 3.10a-4 - Resync with RPM Fusion package (cosmetic changes mainly) - Add image format docs in doc subpackage * Thu Aug 20 2009 Paul Howarth - 3.10a-3 - Include Greg Roelofs' jumbo patch (20070520) - Include Greg Roelofs' jumbo patch update (20081216) - Drop patches included in/superseded by the jumbo patch: - xv-3.10a-lvalue.patch - xv-3.10a-png-1.2d.tar.gz - xv-croppad.patch - xv-deepcolor.patch - xv-exceed_grab_patch.txt - xv-gifpatch - xv-grabpatch - xv-JPEG.patch - xv-longname.patch - xv-mp-tiff-patch - xv-pdf.patch - xv-png-fix2.patch - xv-TIFF.patch - xv-vispatch - Include RPM Fusion Makefile patch (adds JPEG2000 support) - Drop xv-PLD.patch, superseded by combination of jumbo and RPM Fusion patches - Only explicitly buildrequire pkgconfig for FC5 build - Define RPM macros in global scope - Switch upstream URL to ftp.trilon.com - Add DISTRIBUTE.txt - permission to distribute from John Bradley - Add doc subpackage for XV manual in PS, PDF, and HTML formats - Disable JPEG2000 (jasper) support for releases prior to Fedora 7 - Install icon in %%{_datadir}/icons/hicolor/48x48/apps/ rather than %%{_datadir}/pixmaps/ - Add scriptlets for updating the icon cache and MIME databases (desktop-file-utils scriptlet dependencies only needed prior to FC5) - Include non-English man pages from PLD in package - Add translations for spec and desktop file from PLD - Make docs package noarch where possible (RHEL6, FC10 onwards) * Wed Oct 29 2008 Paul Howarth - 3.10a-2 - Fixed up patches to apply without fuzz * Wed May 30 2007 Paul Howarth - 3.10a-1 - Import from PLD release 3.10a-21; reluctantly removed the translations in the spec file because I couldn't figure out what encoding(s) they were in (certainly not UTF-8)