File nm-tray.spec of Package nm-tray

#
# spec file for package nm-tray
#
# Copyright (c) 2016 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:           nm-tray
Version:        @SERVICE@
Release:        0
License:        GPL-2.0
Summary:        NetworkManager tray icon
Url:            https://github.com/palinek/nm-tray
Group:          System/GUI/Other
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake >= 3.1.0
BuildRequires:  cmake(KF5NetworkManagerQt) >= 5.36.0
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  pkgconfig(Qt5Gui) >= 5.4.0
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(uuid)
Recommends:     %{name}-lang
Requires:       NetworkManager
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
nm-tray is a simple NetworkManager front end with information icon residing in
system tray (like e.g. nm-applet). It's a pure Qt application.

%lang_package

%prep
%setup -q

%build
%cmake \
    -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}
make %{?_smp_mflags}

%install
%cmake_install

rm -rf %{buildroot}%{_datadir}/applications
rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/%{name}-autostart.desktop

install -dm 0755 %{buildroot}%{_sysconfdir}/xdg/autostart
cat > %{buildroot}%{_sysconfdir}/xdg/autostart/%{name}.desktop <<-EOF
[Desktop Entry]
Version=1.0
Name=LXQt Network applet
Exec=nm-tray
TryExec=nm-tray
Type=Application
OnlyShowIn=LXQt;
X-LXQt-Need-Tray=true
EOF

%find_lang %{name} --with-qt

%files
%defattr(-,root,root)
%doc COPYING README.md
%{_bindir}/%{name}
%{_sysconfdir}/xdg/autostart/%{name}.desktop
%{_datadir}/%{name}/%{name}.conf

%files lang -f %{name}.lang
%dir %{_datadir}/%{name}

%changelog
openSUSE Build Service is sponsored by