File yast2-rpm-handler.spec of Package yast2-rpm-handler

#
# spec file for package yast2-rpm-handler
#
# Copyright (c) 2015 Mindaugas B. <opensuse.lietuviu.kalba@gmail.com>
#
# 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:           yast2-rpm-handler
Version:        0.0.1
Release:        0

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        %{name}.sh
Source1:        %{name}.desktop

Requires:       yast2
Requires:       yast2-packager
# needed at runtime for invoking root mode
Requires:       /usr/bin/xdg-su
BuildRequires:  update-desktop-files
%if 0%{?suse_version} <= 1320 || 0%{?sle_version} == 150000
Requires:       yast2-branding
BuildRequires:  yast2-branding
%else
Requires:       yast2
BuildRequires:  yast2
%endif
BuildArch:      noarch
Requires(posttrans): desktop-file-utils
Requires(post):      desktop-file-utils
Requires(postun):    desktop-file-utils

Summary:        YaST2 - Installation of RPMs 
License:        GPL-2.0+
Group:          System/YaST

%description
Allows to directly open YaST2 package manager for installation of selected RPMs.

%prep

%build

%install
mkdir -p %buildroot/%{_bindir}
cp -f %{SOURCE0} %{buildroot}%{_bindir}/yast2-rpm-handler
mkdir -p %buildroot/%{_datadir}/applications/
cp -f %{SOURCE1} %{buildroot}%{_datadir}/applications/yast2-rpm-handler.desktop
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150100
sed "s/Icon=yast-software/Icon=yast-software-group/" -i %{buildroot}%{_datadir}/applications/yast2-rpm-handler.desktop
%endif
#%%suse_update_desktop_file yast2-rpm-handler

%post
#%%desktop_database_posttrans
if test -x /usr/bin/update-mime-database ; then
  /usr/bin/update-mime-database /usr/share/mime >/dev/null
fi

%postun
#%%desktop_database_postun
if test -x usr/bin/update-mime-database ; then
  /usr/bin/update-mime-database /usr/share/mime >/dev/null
fi

%files
%defattr(755,root,root,755)  
%{_bindir}/yast2-rpm-handler
%defattr(644,root,root,755)
%{_datadir}/applications/yast2-rpm-handler.desktop

%changelog
openSUSE Build Service is sponsored by