File deepin-printer.spec of Package deepin-printer

#
# spec file for package deepin-printer
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2021 Hillwood Yang <hillwood@opensuse.org>
#
# 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 https://bugs.opensuse.org/
#

%define _name dde-printer

Name:           deepin-printer
Version:        0.9.10
Release:        0
Summary:        The deepin Document Viewer
License:        GPL-3.0+
Group:          Hardware/Printing
URL:            https://github.com/linuxdeepin/dde-printer
Source0:        https://github.com/linuxdeepin/dde-printer/archive/%{version}/%{name}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  libqt5-linguist
BuildRequires:  gtest
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
%ifarch ppc ppc64 ppc64le s390 s390x
BuildRequires:  deepin-desktop-base
%else
BuildRequires:  deepin-manual
%endif
BuildRequires:  pkgconfig(dtkwidget)
BuildRequires:  pkgconfig(dtkgui)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(smbclient)
BuildRequires:  cups-devel
BuildRequires:  cups-ddk
Requires:       xdg-utils

%description
Graphical interface to configure the printing system. It is a GUI written in C++
using QT to configure a CUPS server. Its primary use is to configure the
printing system on the local host,but can also be used to setup a remote
printer. In terms of features, it aims to be as complete as the CUPS web
administration tool, while being integrated to the desktop.

%lang_package

%prep
%setup -q -n %{_name}-%{version}
sed -i '/#include <strings.h>/a #include <stdexcept>' src/cppcups/cupssnmp.cpp
sed -i 's/lrelease/lrelease-qt5/g' src/*/*.sh
sed -i '1,2d' src/Deamon/platform/linux/watch/dde-printer-watch.desktop

%build
%qmake5 DEFINES+="VERSION=%{version}" \
        DEFINES+=QT_NO_DEBUG_OUTPUT
%make_build

%install
%qmake5_install

find %{buildroot}%{_datadir}/deepin-manual -name '*.svg' -type f -print -exec chmod -x {} \;
find %{buildroot}%{_datadir}/deepin-manual -name '*.md' -type f -print -exec chmod -x {} \;

%find_lang %{_name} --with-qt
%find_lang %{_name}-helper --with-qt
%find_lang desktop --with-qt

%fdupes %{buildroot}%{_datadir}

%files
%doc README.md
%license LICENSE
%{_bindir}/%{_name}
%{_bindir}/%{_name}-helper
%{_datadir}/applications/%{_name}.desktop
%config %{_sysconfdir}/xdg/autostart/%{_name}-watch.desktop
%{_datadir}/deepin-manual/manual-assets/application/%{_name}
%{_datadir}/icons/hicolor/48x48/apps/%{_name}.svg
%{_datadir}/polkit-1/actions/com.deepin.pkexec.devPrinter.policy
%dir %{_datadir}/dde-printer
%{_datadir}/dde-printer/offline.json

%files lang -f %{_name}.lang -f %{_name}-helper.lang -f desktop.lang
%dir %{_datadir}/%{_name}
%dir %{_datadir}/%{_name}-helper
%dir %{_datadir}/%{_name}/translations
%dir %{_datadir}/%{_name}-helper/translations
%{_datadir}/%{_name}-helper/translations/%{_name}-helper.qm
%{_datadir}/%{_name}/translations/%{_name}.qm
%{_datadir}/%{_name}/translations/desktop.qm

openSUSE Build Service is sponsored by