%global version_major 1 %global version_minor 1 %global version_patch 5 %undefine version_postfix %global srcname uniconvertor %define version_full %{version_major}%{?version_minor:.%{version_minor}}%{?version_patch:.%{version_patch}}%{?version_postfix:~%{version_postfix}} %define version_base %{version_major}%{?version_minor:.%{version_minor}}%{?version_patch:.%{version_patch}}%{?version_postfix:%{version_postfix}} %define version_package %{?version_major:%{version_major}} %define version_priority %{?version_major:%{version_major}}%{!?version_major:0}%{?version_minor:%{version_minor}}%{!?version_minor:0}%{?version_patch:%{version_patch}}%{!?version_patch:0} %{!?python2_sitearch: %define python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{!?_licensedir:%global license %doc} Name: %{srcname}%{version_package} Epoch: 1 Version: %{version_full} Release: 2%{?dist} Group: Applications/Multimedia License: LGPLv2+ and GPLv2+ and MIT URL: https://sk1project.net/modules.php?name=Products&product=uniconvertor Summary: Universal vector graphics translator Source0: https://sk1project.net/dc.php?target=%{srcname}-%{version}.tar.gz#/%{srcname}-%{version}.tar.gz Source1: README_fonts.txt # Upstream notified via forum: http://sk1project.org/forum/topic.php?forum=2&topic=19 Patch0: UniConvertor-1.1.0-simplify.patch # Upstream notified via forum: http://sk1project.org/forum/topic.php?forum=2&topic=11 Patch1: UniConvertor-%{version}-rename-in-help.patch Patch10: UniConvertor-1.1.4-fake-fallback-font.patch Patch11: UniConvertor-1.1.4-fontwarning.patch BuildRequires: gcc %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python-devel Requires: python-imaging Requires: python-reportlab %else BuildRequires: python2-devel Requires: python2-imaging Requires: python2-reportlab %endif BuildRequires: sk1libs Requires: sk1libs Requires: urw-base35-nimbus-mono-ps-fonts Requires: urw-base35-nimbus-roman-fonts Requires: urw-base35-nimbus-sans-fonts Provides: %{srcname} = %{?epoch:%{epoch}:}%{version}-%{release} Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives %description UniConvertor is a universal vector graphics translator. It uses sK1 engine to convert one format to another. %prep %setup -q -n "%{srcname}-%{version}" %patch0 -p1 -b .simplify %patch1 -p1 -b .rename-in-help %patch10 -p1 -b .fake-fallback-font %patch11 -p1 -b .fontwarning # Prepare for inclusion into documentation part %{__install} -p -m644 "src/COPYRIGHTS" "COPYRIGHTS" %{__install} -p -m644 "src/GNU_GPL_v2" "GNU_GPL_v2" %{__install} -p -m644 "src/GNU_LGPL_v2" "GNU_LGPL_v2" %{__install} -p -m644 "%{SOURCE1}" . # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808112 # https://sk1project.net/forum/viewthread.php?thread_id=125#post_447 %{__rm} "src/app/scripts/export_raster.py" find * -xtype f -name '*.py' | xargs -I{} sed -i -re 's;^#! *(/usr)?/bin/(env +)?python *$;#!/usr/bin/env python2;' '{}' %build CFLAGS="%{optflags}" %{__python2} setup.py "build" %install %{__python2} setup.py install --skip-build --root "%{buildroot}" # Fix permissions %{__chmod} a+x "%{buildroot}%{python2_sitearch}/%{srcname}/__init__.py" %{__chmod} g-w "%{buildroot}%{python2_sitearch}/%{srcname}/app/modules"/*.so # Don't duplicate documentation %{__rm} -f "%{buildroot}%{python2_sitearch}/%{srcname}"/{COPYRIGHTS,GNU_GPL_v2,GNU_LGPL_v2} # Satisfy rpmlint claim on debuginfo subpackage %{__chmod} 644 "src/modules"/*/*.{c,h} %{__mv} "%{buildroot}%{_bindir}/%{srcname}" "%{buildroot}%{_bindir}/%{name}" touch "%{buildroot}%{_bindir}/%{srcname}" %post if [[ -e "%{_bindir}/%{srcname}" && ! -h "%{_bindir}/%{srcname}" ]]; then %{__rm} -rf "%{_bindir}/%{srcname}" fi "%{_sbindir}/update-alternatives" --install "%{_bindir}/%{srcname}" "%{srcname}" "%{_bindir}/%{name}" "%{version_priority}" %postun if [[ "${1}" -eq "0" ]]; then "%{_sbindir}/update-alternatives" --remove "%{srcname}" "%{_bindir}/%{name}" fi %files %doc README README_fonts.txt %license COPYRIGHTS GNU_GPL_v2 GNU_LGPL_v2 %ghost %{_bindir}/%{srcname} %{_bindir}/%{name} %{python2_sitearch}/* %changelog * Tue Apr 30 2019 Tomasz Tomasik - 1.1.5-2 - Improve scripts * Sun Apr 21 2019 Tomasz Tomasik - 1.1.5-1 - Update to 1.1.5 - Rebuild for EL7 - Rename package * Sun Apr 21 2019 Tomasz Tomasik - 1.1.4-8.1 - Rebuild for EL7 - Rename package * Sun Aug 04 2013 Fedora Release Engineering - 1.1.4-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Fri Feb 15 2013 Fedora Release Engineering - 1.1.4-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Sun Jul 22 2012 Fedora Release Engineering - 1.1.4-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Sat Jan 14 2012 Fedora Release Engineering - 1.1.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Mon Feb 07 2011 Fedora Release Engineering - 1.1.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Thu Jul 22 2010 David Malcolm - 1.1.4-3 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Sun Jul 26 2009 Fedora Release Engineering - 1.1.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sun Jun 21 2009 Andy Shevchenko - 1.1.4-1 - update to 1.1.4 - remove upstreamed patches - adjust Fedora related patches * Sat May 02 2009 Andy Shevchenko - 1.1.3-6 - Fix WMF saver * Wed Feb 25 2009 Fedora Release Engineering - 1.1.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Wed Feb 11 2009 Andy Shevchenko - 1.1.3-4 - cover code in __init__.py by function (#484301) * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 1.1.3-3 - Rebuild for Python 2.6 * Sun Jul 27 2008 Andy Shevchenko 1.1.3-2 - update to 1.1.3 - new requirement python-reportlab * Sun May 04 2008 Andy Shevchenko 1.1.2-2 - update to 1.1.2 - apply two useful patches from Debian * Thu Mar 06 2008 Andy Shevchenko 1.1.1-2 - just fix Source0 URL * Wed Feb 13 2008 Andy Shevchenko 1.1.1-1 - update to 1.1.1 * Sat Jan 12 2008 Andy Shevchenko 1.1.0-1 - update to 1.1.0 * Thu Nov 29 2007 Andy Shevchenko 1.0.0-5 - fix conflict with netatalk: rename uniconv to uniconvertor (#405011) * Thu Nov 22 2007 Andy Shevchenko 1.0.0-4 - use python_sitearch and CFLAGS * Thu Nov 22 2007 Andy Shevchenko 1.0.0-3 - prepare to include to Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=393971) * Tue Nov 20 2007 Andy Shevchenko 1.0.0-2 - adjust License: tag (thanks Tom 'spot' Callaway) * Thu Nov 15 2007 Andy Shevchenko 1.0.0-1 - initial build