File crosti.spec of Package crosti

Name:		crosti
Summary:	Tool to create cross stitch scheme from custom image
Version:	1.7.0
Release:	1
License:	GPLv3+
%if 0%{?fedora}
Group:		Applications/Editors
%else
%if 0%{?suse_version}
Group:		Productivity/Graphics/Bitmap Editors
%else
%if 0%{?mdvver}
Group:		Graphics
%endif
%endif
%endif
URL:		https://sites.google.com/site/crostiapp/
Source0:	http://downloads.sourceforge.net/project/crosti/%{name}-%{version}-source.zip
Source1:	crosti.xml
Patch0:		crosti-1.7.0-mdv-desktop.patch
BuildRequires:	pkgconfig(QtCore) >= 4.3
BuildRequires:	pkgconfig(QtGui) >= 4.3
BuildRequires:	dos2unix
%if 0%{?suse_version}
BuildRequires:	fdupes
BuildRequires:	update-desktop-files
%endif
BuildRequires:	unzip
BuildRequires:	gcc-c++

%description
This tool allows you to make your own unique cross stitch scheme from custom
image. You can resize and rotate image, reduce the number of colors, change
image palette, make cross stitch scheme, preview it, save and print. Cross
stitch scheme edition available: colors and icons changing, new color addition,
color fill, scheme pixel draw, lines and half-stitches.

Features

* Convert custom image to cross stitch scheme.
* Edit cross stitch scheme.
* Save and print the scheme that you created.
* Input images: BMP, GIF, ICO, JPEG, JPG, MNG, PBM, PGM, PNG, PPM, SVG, TIF,
  TIFF, XBM, XPM.
* Output cross stitch scheme: BMP, ICO, JPEG, JPG, PNG, PPM, TIF, TIFF, XBM,
  XPM, PDF, CST (crosti scheme text file).

%prep
%setup -q -n source
%patch0 -p1
dos2unix crosti/readme.txt

%build
pushd Repository/%{name}-%{version}
%if 0%{?mdvver}
%qmake_qt4
%else
export CPPFLAGS="%{?optflags}"
%if 0%{?fedora}
%_qt4_qmake \
%else
%if 0%{?suse_version}
qmake \
%endif
%endif
QMAKE_CFLAGS="%{?optflags}" \
QMAKE_CXXFLAGS="%{?optflags}" \
QMAKE_LFLAGS="%{?ldflags}"
%endif
make %{?_smp_mflags}
popd

%install
rm -rf %{buildroot}
pushd Repository/%{name}-%{version}
make install INSTALL_ROOT=%{buildroot}
popd

rm -f %{buildroot}%{_datadir}/%{name}/readme.txt

for size in 16 32
do
install -d %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/
mv %{buildroot}%{_datadir}/%{name}/system/image/crosti${size}.png \
	%{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/%{name}.png
done

install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/mime/packages/%{name}.xml

%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%fdupes %{buildroot}%{_datadir}
%endif

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc crosti/readme.txt
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/icons/hicolor


%changelog
* Sun Apr 8 2012 Dmitry Mikhirev <dmikhirev@mandriva.org> 1.7.0-1
- update to 1.7.0
- mime type text/x-cst

* Fri Mar 09 2012 Dmitry Mikhirev <dmikhirev@mandriva.org> 1.6.0-4
- Fedora and openSUSE support

* Tue Mar 06 2012 Dmitry Mikhirev <dmikhirev@mandriva.org> 1.6.0-3
+ Revision: 782423
- move icons to iconsdir

* Tue Mar 06 2012 Dmitry Mikhirev <dmikhirev@mandriva.org> 1.6.0-2
+ Revision: 782379
- fix desktop file
- use home directory instead /usr/share

* Fri Mar 02 2012 Dmitry Mikhirev <dmikhirev@mandriva.org> 1.6.0-1
+ Revision: 781742
- imported package crosti

openSUSE Build Service is sponsored by