File mypaint.spec of Package mypaint

#
# spec file for package mypaint
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           mypaint
Version:        1.2.0
Release:        0
Summary:        Fast and easy open-source graphics application for digital painters
License:        GPL-2.0+
Group:          Productivity/Graphics/Other
Url:            http://mypaint.intilinux.com
Source:         https://github.com/mypaint/mypaint/releases/download/v1.2.0/mypaint-1.2.0.tar.xz
Source1:        https://github.com/mypaint/mypaint/releases/download/v1.2.0/mypaint-1.2.0.tar.xz.asc
BuildRequires:  ImageMagick
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  python-cairo-devel
BuildRequires:  python-devel
BuildRequires:	gtk3-devel
BuildRequires:  python-gtk-devel
BuildRequires:  python-gobject-devel
BuildRequires:  python-numpy >= 1.5
BuildRequires:  python-numpy-devel
BuildRequires:  rsvg-view
BuildRequires:  scons >= 1.2
BuildRequires:  swig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(json)
BuildRequires:  pkgconfig(lcms2)
Requires:       %{name}-lang = %{version}
%if 0%{?suse_version} >= 1220
Requires:       python-numpy >= 1.7
%else
Requires:       python-numpy >= 1.5
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{py_requires}
%lang_package

%description
MyPaint is a fast and easy open-source graphics application for
digital painters. It lets you focus on the art instead of the program.
You work on your canvas with minimum distractions, bringing up the
interface only when you need it.

%package devel
Summary:        Fast and easy open-source graphics application for digital painters
License:        GPL-2.0+
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
MyPaint is a fast and easy open-source graphics application for
digital painters. It lets you focus on the art instead of the program.
You work on your canvas with minimum distractions, bringing up the
interface only when you need it.

%prep
%setup -q

#FIXME Set correct library path for build arch
sed -i 's|lib/mypaint|%{_lib}/mypaint|g' SConscript SConstruct mypaint.py
sed -i "s|prefix, 'lib', 'mypaint'|prefix, '%{_lib}', 'mypaint'|g" mypaint.py
sed -i 's|lib/pkgconfig|%{_lib}/pkgconfig|g' brushlib/SConscript
#FIXME fix incorrect icon sizes as per rpmlint report
#cd desktop/icons/hicolor/
#ICONSIZE="16 22 24 32 48"
#for i in $ICONSIZE; do
#    rsvg-convert -h $i -w $i scalable/actions/mypaint-tool-scratchpad.svg -o ${i}x${i}/actions/mypaint-tool-scratchpad.png
#done

%build
scons prefix=%{_prefix} \
    %{?jobs:-j %jobs}

%install
scons prefix=%{_prefix} \
    --install-sandbox=install_tmp
cp -r {.,po,brushlib,brushlib/po}/install_tmp/* %{buildroot}
%ifarch x86_64 ppc64 ppc64le aarch64
mv %{buildroot}/usr/lib/lib%{name}.a %{buildroot}/%{_libdir}
sed -i 's|/usr/lib|/usr/%{_lib}|g' %{buildroot}/%{_libdir}/pkgconfig/lib%{name}.pc
%endif
#FIXME incorrect file permissions, source has them as 0755
chmod 0755 %{buildroot}%{_datadir}/%{name}/brushes/label-brush-mypaint.sh
#chmod 0755 %{buildroot}%{_datadir}/%{name}/brushlib/generate.py
mkdir -p %{buildroot}%{_datadir}/pixmaps/
install -Dm0644 desktop/icons/hicolor/48x48/apps/%{name}.png \
        %{buildroot}%{_datadir}/pixmaps/
%suse_update_desktop_file %{name}
%find_lang %{name}
%find_lang lib%{name}
%fdupes %{buildroot}

%if 0%{?suse_version} >= 1140

%post
/sbin/ldconfig
%desktop_database_post
%icon_theme_cache_post
%else

%post -p /sbin/ldconfig
%endif

%if 0%{?suse_version} >= 1140

%postun
/sbin/ldconfig
%desktop_database_postun
%icon_theme_cache_postun
%else

%postun -p /sbin/ldconfig
%endif

%files
%defattr(-,root,root)
%doc COPYING README.md Licenses.dep5 Licenses.md
%{_bindir}/%{name}
%{_bindir}/mypaint-ora-thumbnailer
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/_mypaintlib.so
%{_datadir}/%{name}/
%{_datadir}/lib%{name}/
%{_datadir}/applications/%{name}.desktop
%dir /usr/share/icons/hicolor/512x512
%dir /usr/share/icons/hicolor/512x512/apps
%{_datadir}/icons/hicolor/*/*/mypaint*
%{_datadir}/pixmaps/%{name}.png
%dir %{_datadir}/thumbnailers
%{_datadir}/thumbnailers/mypaint-ora.thumbnailer
%dir %{_datadir}/appdata
%{_datadir}/appdata/%{name}.appdata.xml

%files lang -f %{name}.lang -f lib%{name}.lang

%files devel
%defattr(-, root, root)
%{_includedir}/lib%{name}
%{_libdir}/pkgconfig/lib%{name}.pc
%{_libdir}/lib%{name}.a

%changelog
openSUSE Build Service is sponsored by