File qnapi.spec of Package qnapi

# spec file for package qnapi
# Copyright (c) 2015 SUSE LINUX 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

Name:           qnapi
Version:        0.2.0
Release:        0
Summary:        A NapiProjekt client
License:        GPL-2.0+
Group:          Productivity/Multimedia/Other
Summary(pl):    Klient NapiProjekt
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Core) >= 5.2
BuildRequires:  pkgconfig(Qt5Gui) >= 5.2
BuildRequires:  pkgconfig(Qt5Network) >= 5.2
BuildRequires:  pkgconfig(Qt5Widgets) >= 5.2
BuildRequires:  pkgconfig(Qt5Xml) >= 5.2
Requires:       p7zip
Recommends:     ffmpeg
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

QNapi is unofficial clone of NapiProjekt program (
written using Qt5. It's focused to be functional on GNU/Linux and other
Unix-like systems, for which NapiProjekt is not available.

%description -l pl
QNapi jest nieoficjalnym klonem programu NapiProjekt (
napisanym w bibliotece Qt5 z myślą o użytkownikach Linuksa oraz innych
systemów, pod które oryginalny NapiProjekt nie jest dostępny.

%setup -q
### Fix paths specific for openSUSE
sed -i 's|doc.path = $${INSTALL_PREFIX}/share/doc/$${TARGET}|doc.path = $${INSTALL_PREFIX}/share/doc/packages/$${TARGET}|'

make %{?_smp_mflags}

make INSTALL_ROOT=%{buildroot} install %{?_smp_mflags}
# Add KDE4 service menu
install -m 644 -D doc/qnapi-download.desktop %{buildroot}%{_datadir}/kde4/services/ServiceMenus/qnapi-download.desktop
install -m 644 -D doc/qnapi-scan.desktop %{buildroot}%{_datadir}/kde4/services/ServiceMenus/qnapi-scan.desktop
# Add Plasma 5 service menu
install -m 644 -D doc/qnapi-download.desktop %{buildroot}%{_datadir}/kservices5/ServiceMenus/qnapi-download.desktop
install -m 644 -D doc/qnapi-scan.desktop %{buildroot}%{_datadir}/kservices5/ServiceMenus/qnapi-scan.desktop

### Fix for "wrong-file-end-of-line-encoding" doc/ChangeLog file
sed -i 's/\r//' doc/ChangeLog

%fdupes %{buildroot}%{_prefix}
%suse_update_desktop_file -i -r -n %{name} AudioVideo AudioVideoEditing

%doc doc/COPYRIGHT doc/ChangeLog doc/LICENSE doc/LICENSE-pl doc/qnapi-download.desktop doc/qnapi-download.schemas doc/qnapi-scan.desktop doc/qnapi-scan.schemas
%attr(644,root,root) %{_mandir}/man1/*
%dir %{_datadir}/kde4
%dir %{_datadir}/kde4/services
%dir %{_datadir}/kde4/services/ServiceMenus
%dir %{_datadir}/kservices5
%dir %{_datadir}/kservices5/ServiceMenus

openSUSE Build Service is sponsored by