File lxqt-admin.spec of Package lxqt-admin

#
# spec file for package lxqt-admin
#
# Copyright (c) 2016 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 http://bugs.opensuse.org/
#


%define _qtver 5.10.0
Name:           lxqt-admin
Version:        @SERVICE@
Release:        0
Summary:        Admin tools
License:        LGPL-2.1+
Group:          System/GUI/LXQt
Url:            https://github.com/lxde/lxqt-admin
Source:         %{name}-%{version}.tar.xz
Source1:        %{name}-rpmlintrc
BuildRequires:  cmake >= 3.0.2
%if 0%{?suse_version} == 1315
BuildRequires:  gcc5-c++
%else
BuildRequires:  gcc-c++ >= 4.9.0
%endif
BuildRequires:  lxqt-build-tools
BuildRequires:  pkgconfig
BuildRequires:  cmake(KF5WindowSystem)
BuildRequires:  pkgconfig(Qt5DBus) >= %{_qtver}
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(lxqt)
BuildRequires:  pkgconfig(polkit-qt5-1)
Recommends:     %{name}-lang = %{version}-%{release}
Requires:       polkit
#equires:       system-tools-backends
Requires(post): desktop-file-utils
Requires(pre):  desktop-file-utils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Administration tools for lxqt

%lang_package

%prep
%setup -q
sed -i '/^Categories/s/\(LXQt\;\)/X-\1/' %{name}-*/%{name}-*.desktop.in
sed -i '/^OnlyShowIn/s/\(LXQt\)/X-\1/' %{name}-*/%{name}-*.desktop.in
sed -i 's/\(Icon=\).*/\1preferences-system-time/' %{name}-time/%{name}-time.desktop.in
sed -i 's/\(Icon=\).*/\1preferences-desktop-user/' %{name}-user/%{name}-user.desktop.in

%build
%cmake \
%if 0%{?suse_version} == 1315
    -DCMAKE_CXX_COMPILER=%{_bindir}/g++-5
%endif

make %{?_smp_mflags}

%install
%cmake_install

%find_lang %{name} --with-qt --all-name
for lng in ast arn ; do
for i in $(find %{buildroot}// -name "*_$lng.qm" | cut -d \/ -f7-) ; do
  echo "%lang($lng) $i" >> %{name}.lang
done
done

%if 0%{?suse_version} < 1500
%post
%desktop_database_post

%postun
%desktop_database_postun
%endif

%files
%defattr(-,root,root)
%doc AUTHORS COPYING README.md
%{_bindir}/%{name}-user
%{_bindir}/%{name}-user-helper
%{_bindir}/%{name}-time
%{_bindir}/%{name}-time-helper
%{_datadir}/applications/%{name}*.desktop
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
%{_datadir}/polkit-1/actions/org.lxqt.%{name}-user.policy
%{_datadir}/polkit-1/actions/org.lxqt.%{name}-time.policy

%files lang -f %{name}.lang
%defattr(-,root,root)
%dir %{_datadir}/lxqt
%dir %{_datadir}/lxqt/translations
%dir %{_datadir}/lxqt/translations/%{name}-time
%dir %{_datadir}/lxqt/translations/%{name}-user

%changelog
openSUSE Build Service is sponsored by