%bcond_without xaw3dxft %bcond_without libpgf %bcond_with Xaw3d %bcond_with neXtaw %define run_autoreconf 1 %if 0%{?rhel} && 0%{?rhel} <= 6 %define run_autoreconf 0 %endif %define dir_appdata metainfo %if 0%{?rhel} && 0%{?rhel} <= 7 %define dir_appdata appdata %endif %if 0%{!?_metainfodir:1} %define _metainfodir %{_datadir}/%{dir_appdata} %endif %define dir_metainfo %( echo "%{_metainfodir}" | xargs -I{} basename '{}' ) %define support_appdata 1 %if 0%{?rhel} && 0%{?rhel} <= 6 %define support_appdata 0 %endif %{!?_licensedir:%global license %doc} Name: xpaint Version: 2.10.2 Release: 1.1%{?dist} Group: Applications/Multimedia License: GPLv3+ URL: https://sourceforge.net/projects/sf-xpaint Summary: An X Window System image editing or paint program Source0: https://downloads.sourceforge.net/sf-xpaint/%{name}-%{version}.tar.bz2 # GenericName from kolourpaint # https://koji.fedoraproject.org/koji/buildinfo?buildID=1206147 Source1: %{name}-desktop-GenericName.txt # Add AppData file Source2: %{name}.appdata.xml # patches from Debian # http://deb.debian.org/debian/pool/main/x/xpaint/xpaint_2.9.1.4-3.2.debian.tar.xz Patch0: xpaint-2.10.2-Local.config.patch Patch1: xpaint-2.9.1.4-imgmerge-sensible-editor.patch Patch2: xpaint-2.9.1.4-xpaint-ocr-sensible-editor.patch Patch3: xpaint-2.9.1.4-imakefile-extra-includes.patch # Enhance desktop file # - Update Categories # - Add Keywords # - Add MimeType # - Add StartupWMClass Patch10: xpaint-2.10.2-enhance-desktop-file.patch BuildRequires: pkgconfig %if 0%{?run_autoreconf} BuildRequires: intltool BuildRequires: libtool BuildRequires: automake >= 1.11.2 # for autoreconf BuildRequires: autoconf %endif # for config.{guess,sub} BuildRequires: rpm-build BuildRequires: gcc BuildRequires: make BuildRequires: glibc-common BuildRequires: bison BuildRequires: flex BuildRequires: imake BuildRequires: chrpath # to convert SVG icon to PNG %if 0%{?rhel} && 0%{?rhel} <= 6 BuildRequires: librsvg2 %else BuildRequires: librsvg2-tools %endif # for desktop-file-validate BuildRequires: desktop-file-utils # for appstream-util %if 0%{?support_appdata} BuildRequires: libappstream-glib %endif BuildRequires: openjpeg-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libtiff-devel BuildRequires: libSM-devel BuildRequires: libXaw-devel BuildRequires: libXdmcp-devel BuildRequires: libXext-devel BuildRequires: libXp-devel BuildRequires: Xaw3d-devel BuildRequires: libXaw3dXft-devel >= 1.6.2d %{?with_libpgf:BuildRequires: libpgf} %{?with_neXtaw:BuildRequires: neXtaw-devel} Requires: cups Requires: gv Requires: netpbm Requires: psutils # https://bugzilla.redhat.com/show_bug.cgi?id=542967 Requires: emacs Requires: hicolor-icon-theme # https://fedoraproject.org/wiki/Packaging:Scriptlets # https://fedoraproject.org/wiki/PackagingDrafts/ScriptletSnippets Requires(post): coreutils Requires(postun): coreutils Requires(posttrans): coreutils # gtk-update-icon-cache #Requires(post): gtk-update-icon-cache Requires(postun): gtk-update-icon-cache Requires(posttrans): gtk-update-icon-cache # update-mime-database #Requires(post): shared-mime-info #Requires(postun): shared-mime-info #Requires(posttrans): shared-mime-info # update-desktop-database Requires(post): desktop-file-utils Requires(postun): desktop-file-utils #Requires(posttrans): desktop-file-utils # glib-compile-schemas #Requires(post): glib2 #Requires(postun): glib2 #Requires(posttrans): glib2 # ldconfig Requires(post): glibc /sbin/ldconfig Requires(postun): glibc /sbin/ldconfig #Requires(posttrans): glibc /sbin/ldconfig # The only way of compiling and linking plugins on the fly. Obsoletes: %{name}-devel < %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} %if "no%{?_isa}" != "no" Provides: xpaint-devel%{?_isa} = %{version}-%{release} %endif %description XPaint is an X Window System color image bitmap editing program. It also supports advanced features, such as image processing algorithms, scripting and batch jobs. XPaint allows the edition of multiple images simultaneously and supports a wide variety of image formats, including: GIF, JPG, PNG, PPM, TIFF, XBM, XPM, etc. xpaint is now fully UTF8 compliant, and is capable of using anti-aliased truetype fonts in its operations and in the menus (in particular, translating to oriental languages should now be quite easy - also the X core font protocol is no longer used anywhere.) xpaint also offers optional editing features based on programmable filters and user defined procedures written as scripts in plain C. The package includes a substantial list of examples and some support for batch processing. %prep %setup -q #%%patch0 -p1 #%%patch1 -p1 #%%patch2 -p1 %patch3 -p1 %patch10 -p1 # Add translations for GenericName %{__cat} "%{SOURCE1}" >> "%{name}.desktop" %{__sed} -i -e 's|/usr/lib|%{_libdir}|g' "configure" %{__sed} -i -e 's|/usr/lib|%{_libdir}|g' "configure.old" %{__sed} -i -e 's|ln -s xpaint|ln -sf xpaint|g' "configure.old" %{__sed} -i -e 's|CFLAGS="-O3 -s -DNDEBUG=1"|CFLAGS=$RPM_OPT_FLAGS|g' "util/pdfconcat.c" %{__sed} -i -e 's|@echo|echo|g' "util/Makefile" for f in "ChangeLog" "README"; do iconv -f iso-8859-1 -t utf-8 "${f}" > "${f}.utf8" touch -r $f "${f}.utf8" %{__mv} "${f}.utf8" "${f}" done %{__cp} -pf "/usr/lib/rpm"/config.{guess,sub} . %build %{__sed} -i -e "s|XCOMM CDEBUGFLAGS =|CDEBUGFLAGS = %{optflags}\nCXXDEBUGFLAGS = %{optflags}|g" "Local.config" # this is for debugging, to save the temporary file Imakefile.c touch "fake" ln "fake" "Imakefile.c" %if 0%{?run_autoreconf} autoreconf -vfi %endif ./configure.old --libdir="%{_libdir}" # make %{?_smp_mflags} \ # avoids laygram.h not found %{__make} \ %{?with_xaw3dxft:xaw3dxft} \ %{?with_Xaw3d:xaw3dg} \ %{?with_neXtaw:nextaw} cd "util" %{__make} %install %{__make} \ DESTDIR="%{buildroot}" \ BINDIR="%{_bindir}" \ LIBDIR="%{_libdir}" \ MANDIR="%{_mandir}/man1" install install.man # icons %{__install} -d "%{buildroot}%{_datadir}/pixmaps" for file in "icons"/*; do %{__install} -Dpm 0644 "${file}" -t "%{buildroot}%{_datadir}/pixmaps/" done %{__install} -d "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/" %{__install} -Dpm 0644 "icons/%{name}.svg" -t "%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/" icon_in="icons/%{name}.svg" icon_out="%{name}.png" %{__mkdir_p} "rpm_icons" for s in {16,22,24,32,36,48,64,72,96,128,192,256,512}; do [[ ! -f "%{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/${icon_out}" ]] || continue rsvg-convert "${icon_in}" -w "${s}" -h "${s}" -a -f png -o "rpm_icons/${icon_out}" %{__install} -d "%{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/" %{__install} -Dpm 0644 "rpm_icons/${icon_out}" -t "%{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/" done # menu entry %{__install} -d "%{buildroot}/%{_datadir}/applications/" %{__install} -Dpm 0644 "%{name}.desktop" "%{buildroot}/%{_datadir}/applications/" # appdata %{__install} -d "%{buildroot}%{_metainfodir}/" %{__install} -Dpm 0644 "%{SOURCE2}" -t "%{buildroot}%{_metainfodir}/" # rpath chrpath --delete "%{buildroot}%{_bindir}/xpaint" # remove needless symlink to /etc/X11/app-defaults %{__rm} -rf "%{buildroot}%{_libdir}/app-defaults" %{__install} -d "%{buildroot}%{_includedir}/" %{__mv} "%{buildroot}%{_datadir}/%{name}/include" "%{buildroot}%{_includedir}/%{name}" %{__ln_s} "../../include/%{name}" "%{buildroot}%{_datadir}/%{name}/include" %check /usr/bin/desktop-file-validate "%{buildroot}/%{_datadir}/applications/%{name}.desktop" %if 0%{?support_appdata} /usr/bin/appstream-util validate-relax --nonet "%{buildroot}%{_metainfodir}/%{name}.appdata.xml" %endif %post /bin/touch --no-create "%{_datadir}/icons/hicolor" &> /dev/null || : #/usr/bin/update-mime-database -n "%{_datadir}/mime" &> /dev/null || : /usr/bin/update-desktop-database &> /dev/null || : /sbin/ldconfig %postun #if [[ "${1}" -eq "0" ]]; then # /usr/bin/glib-compile-schemas "%{_datadir}/glib-2.0/schemas" &> /dev/null || : #fi /usr/bin/update-desktop-database &> /dev/null || : if [[ "${1}" -eq "0" ]]; then /bin/touch --no-create "%{_datadir}/icons/hicolor" &> /dev/null || : /usr/bin/gtk-update-icon-cache "%{_datadir}/icons/hicolor" &> /dev/null || : #/usr/bin/update-mime-database -n "%{_datadir}/mime" &> /dev/null || : fi /sbin/ldconfig %posttrans #/usr/bin/glib-compile-schemas "%{_datadir}/glib-2.0/schemas" &> /dev/null || : /usr/bin/gtk-update-icon-cache "%{_datadir}/icons/hicolor" &> /dev/null || : #update-mime-database -n "%{_datadir}/mime" &> /dev/null || : %files %doc AUTHORS ChangeLog NEWS README README.old README.PNG TODO Doc/sample.Xdefaults Doc/Operator.doc %{_bindir}/%{name} %{_bindir}/pdfconcat %{_bindir}/ppmtops %{_bindir}/imgmerge %{_includedir}/%{name} %{_datadir}/X11/app-defaults/XPaint* %{_datadir}/applications/%{name}.desktop %{_metainfodir}/%{name}.appdata.xml %{_datadir}/%{name} %{_datadir}/pixmaps/%{name}* %{_datadir}/pixmaps/XPaintIcon*.png %{_datadir}/icons/hicolor/*x*/apps/%{name}.png %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{_mandir}/man1/%{name}.1x* %{_mandir}/man1/pdfconcat.1.gz %changelog * Mon Feb 18 2019 Tomasz Tomasik - 2.10.2-1.1 - Add fixes for EL6 - Rebuild for EL7 * Mon Feb 18 2019 Tomasz Tomasik - 2.10.2-1 - Update to 2.10.2 - Add patches from Debian - Enhance desktop file - Add AppData file - Add scalable icon - Add %%check, %%post, %%postun and %%posttrans sections - Use %%license macro - Update requirements - Rebuild for EL7 * Mon Feb 18 2019 Tomasz Tomasik - 2.9.10.3-4.1 - Rebuild for EL7 * Fri Feb 05 2016 Fedora Release Engineering - 2.9.10.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Fri Jun 19 2015 Fedora Release Engineering - 2.9.10.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri May 15 2015 Paulo Roma - 2.9.10.3-2 - Removed some deprecated sed replacements. * Sun May 10 2015 Paulo Roma - 2.9.10.3-1 - Update to 2.9.10.3 * Mon Aug 18 2014 Fedora Release Engineering - 2.9.9.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sun Jun 08 2014 Fedora Release Engineering - 2.9.9.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Sat Sep 21 2013 Paulo Roma 2.9.9.4-1 - Updated to 2.9.9.4 * Sun Aug 04 2013 Fedora Release Engineering - 2.9.8.3-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Fri Feb 15 2013 Fedora Release Engineering - 2.9.8.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Mon Jan 21 2013 Adam Tkac - 2.9.8.3-6 - rebuild due to "jpeg8-ABI" feature drop * Fri Dec 21 2012 Adam Tkac - 2.9.8.3-5 - rebuild against new libjpeg * Sun Jul 22 2012 Fedora Release Engineering - 2.9.8.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Thu Feb 09 2012 Rex Dieter 2.9.8.3-3 - rebuild (openjpeg) * Sat Jan 14 2012 Fedora Release Engineering - 2.9.8.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Nov 15 2011 Paulo Roma 2.9.8.3-1 - Updated to 2.9.8.3 * Mon Jun 27 2011 Paulo Roma 2.9.8.2-1 - Updated to 2.9.8.2 - Added new png files. * Fri Dec 24 2010 Paulo Roma 2.9.8.1-1 - Updated to 2.9.8.1 - Removed deprecated gcc 4.5 patch. * Sun Nov 07 2010 Paulo Roma 2.9.8-1 - Update to 2.9.8 - Patched for gcc 4.5 * Sat Nov 06 2010 Paulo Roma 2.9.7-1 - Update to 2.9.7 * Sun Aug 01 2010 Paulo Roma 2.9.2-1 - Update to 2.9.2 - Added BR openjpeg-devel. * Mon Mar 08 2010 Paulo Roma 2.8.19-1 - Update to 2.8.19 - BRs: xaw/xaw3d are optional. - Added BR libXft-devel. * Sun Feb 14 2010 Paulo Roma 2.8.16-1 - Update to 2.8.16 - Removed obsolete patch text-ctrlH-segfault. - Source is no longer stripped by default. * Sat Feb 13 2010 Paulo Roma 2.8.15-3 - Fixed the ImplicitDSOLinking. * Fri Feb 05 2010 Paulo Roma 2.8.15-2 - Applied patch text-ctrlH-segfault. * Tue Feb 02 2010 Paulo Roma 2.8.15-1 - Updated to 2.8.15: #BUG 559938 - Added BR psutils. * Fri Jan 29 2010 Paulo Roma 2.8.13.1-3 - Obsoleting xpaint-devel. * Fri Jan 29 2010 Paulo Roma 2.8.13.1-2 - Not stripping xpaint: #BUG 540223 - Dropped devel package. * Fri Jan 29 2010 Paulo Roma 2.8.13.1-1 - Updated to 2.8.13.1 - Removed emacs dependency: #BUG 542967 * Thu Nov 19 2009 Paulo Roma 2.8.7.3-1 - Updated to 2.8.7.3 * Mon Nov 16 2009 Paulo Roma 2.8.7.2-1 - Updated to 2.8.7.2 * Wed Nov 04 2009 Paulo Roma 2.8.7-1 - Updated to 2.8.7 - Changed license to GPLv3+ - Applied patch xpaint-2.8.7-graphic.c.patch * Mon Nov 02 2009 Paulo Roma 2.8.6.1-2 - Moved c_scripts and the include symbolic link to the main package, as they are not needed to compile 3th party plugins (if there will ever be a 3th party plugin). * Tue Oct 27 2009 Paulo Roma 2.8.6.1-1 - Updated to 2.8.6.1 - Added devel subpackage as noarch. * Thu Oct 22 2009 Paulo Roma 2.8.5-8 - Updated to 2.8.5 - Using %%configure. - Removed rpath. * Wed Oct 14 2009 Paulo Roma 2.8.4-7 - Changed license to GPLv3. * Mon Oct 05 2009 Paulo Roma 2.8.3-6 - Removed devel package. * Sat Oct 03 2009 Paulo Roma 2.8.3-5 - Updated to 2.8.3 - Using supplied desktop entry. * Thu Oct 01 2009 Paulo Roma 2.8.2-5 - Updated to 2.8.2 - New icons. * Sat Jun 30 2007 Paulo Roma 2.7.8.1-4 - Created devel package. - Fixed configure. - Conditionally building with Xaw3d or neXtaw. * Mon Apr 02 2007 Paulo Roma 2.7.8-4 - Rebuilt for x86_64. - Moved rm -rf %%{buildroot} from "prep" to "build". - Fixed rm -rf %%{buildroot}%%{_libdir}/app-defaults - Removed all .c and .h files. * Sun Dec 31 2006 Paulo Roma 2.7.8-3 - Included missing build requirements. * Thu Sep 14 2006 Paulo Roma 2.7.8-1 - Update to 2.7.8 - Changed spec file for Fedora. * Mon Apr 04 2005 Lenny Cartier 2.7.6-1mdk - 2.7.6 * Mon Mar 14 2005 Lenny Cartier 2.7.4-1mdk - 2.7.4 * Mon Jan 31 2005 Lenny Cartier 2.7.3-1mdk - 2.7.3 * Tue Oct 19 2004 Lenny Cartier 2.7.2-1mdk - 2.7.2 * Wed Sep 22 2004 Lenny Cartier 2.7.1-1mdk - 2.7.1 * Fri Aug 20 2004 Thierry Vignaud 2.7.0-4mdk - fix typo in menu entry * Mon Dec 29 2003 Michael Scherer 2.7.0-3mdk - fix BuildRequires ( remove lib ) - remove /usr/X11R6/lib/X11/app-defaults link to /etc * Sun Sep 14 2003 Michael Scherer 2.7.0-2mdk - BuildRequires flex * Mon Jun 16 2003 Stew Benedict 2.7.0-1mdk - 2.7.0 * Mon Apr 28 2003 Stew Benedict 2.6.9-2mdk - BuildRequires, distriblint * Fri Apr 4 2003 Stew Benedict 2.6.9-1mdk - 2.6.9, new URL, Source tag - some new features finally, add patch1 to fix make install * Mon Dec 30 2002 Stew Benedict 2.6.2-2mdk - rebuild for new glibc/rpm, add patch1 for errno * Sat Nov 16 2002 Stew Benedict 2.6.2-1mdk - new version, add installed but unpackaged file, icons->png * Fri Oct 19 2001 Sebastien Dupont 2.6.1-2mdk - License - srcs permissions - remove patchs: xpaint-2.4.7-config.patch & xpaint-2.4.7-glibc.patch. * Sun May 27 2001 Daouda Lo 2.6.1-1mdk - release 2.6.1 - stop Nono complains. - cleanups * Tue Oct 03 2000 Daouda Lo 2.6.0-2mdk - icons should be transparent - let spec helper do its jobs - menu entry in the body of the spec - more macroz.. * Sun Aug 27 2000 Geoffrey Lee 2.6.0-1mdk - new and shiny version. * Tue Aug 08 2000 Frederic Lepied 2.4.9-16mdk - automatically added BuildRequires * Mon May 15 2000 David BAUDENS 2.4-9-15mdk - Fix build for i486 - Use %%{_tmppath} for BuildRoot * Wed May 03 2000 dam's 2.4.9-14mdk - Corrected icons. * Tue Apr 18 2000 dam's 2.4.9-13mdk - Convert gif icon to xpm. * Mon Apr 17 2000 dam's 2.4.9-12mdk - Added menu entry. * Mon Mar 27 2000 dam's 2.4.9-11mdk - Release. * Tue Nov 02 1999 Pablo Saratxaga - corrected status of resource file * Thu May 06 1999 Bernhard Rosenkraenzer - Mandrake adaptions - handle RPM_OPT_FLAGS * Sun Mar 21 1999 Cristian Gafton - auto rebuild in the new build environment (release 8) * Thu Dec 17 1998 Michael Maher - built package for 6.0 * Mon Aug 3 1998 Jeff Johnson - build root. * Tue Jun 09 1998 Mike Wangsmo - changed the docs from being %%config files. * Fri May 01 1998 Prospector System - translations modified for de, fr, tr * Thu Apr 16 1998 Erik Troan - built against libpng 1.0 * Fri Oct 24 1997 Marc Ewing - new release - wmconfig * Wed Oct 15 1997 Erik Troan - build against new libpng * Thu Jul 31 1997 Erik Troan - built against glibc * Tue Mar 25 1997 Erik Troan - "make install.man" places man page in wrong location