File viewpdf.spec of Package viewpdf

#
# spec file for package viewpdf
#
# Copyright (c) 2013 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:           viewpdf
Version:        0.6.2
Release:        0
License:        GPL-2.0+
Summary:        PDF Files Viewer
Url:            http://www.qtrac.eu/viewpdf.html
Group:          Productivity/Publishing/PDF
Source0:        http://www.qtrac.eu/%{name}-%{version}.tar.gz
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(enchant)
BuildRequires:  pkgconfig(poppler-qt4) >= 0.18
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
ViewPDF shows PDF files, clearly indicating annotations and possible
mistakes (such as spelling errors).

%prep
%setup -q

%build
qmake \
    QMAKE_CXXFLAGS+="%{optflags}" \
    QMAKE_CFLAGS+="%{optflags}" \
    QMAKE_STRIP=""
make %{?_smp_mflags}

%install
# Create desktop file.
cat > %{name}.desktop << EOF
[Desktop Entry]
Name=ViewPDF
GenericName=PDF Files Viewer
GenericName[ru]=Просмотрщик PDF-файлов
Comment=ViewPDF shows PDF files
Comment[ru]=ViewPDF показывает PDF-файлы
Type=Application
Exec=viewpdf %f
Icon=viewpdf
Categories=Office;Viewer;
StartupNotify=true
Terminal=false
MimeType=application/pdf;
EOF

install -Dm 0755 %{name} \
    %{buildroot}%{_bindir}/%{name}
install -Dm 0644 %{name}.1 \
    %{buildroot}%{_mandir}/man1/%{name}.1
install -Dm 0644 images/icon.png \
    %{buildroot}%{_datadir}/pixmaps/%{name}.png
%suse_update_desktop_file -i %{name}

%post
%desktop_database_post

%postun
%desktop_database_postun

%files
%defattr(-,root,root,-)
%doc CHANGES README
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.*
%doc %{_mandir}/man?/*

%changelog
openSUSE Build Service is sponsored by