File menulibre.spec of Package menulibre

# spec file for package menulibre
# Copyright (c) 2023 SUSE LLC
# 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

%bcond_with git
%define _ver %(echo %{version} | cut -c 1-5)

Name:           menulibre
Version:        2.4.0+git.10.90fa613
Release:        0
Summary:        Desktop menu editor
License:        GPL-3.0-only
Group:          System/GUI/Other
Source:         %{name}-%{version}.tar.xz
BuildRequires:  desktop-file-utils
BuildRequires:  fdupes
BuildRequires:  gnome-menus
BuildRequires:  gobject-introspection
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  python3
BuildRequires:  python3-base
BuildRequires:  python3-distutils-extra
BuildRequires:  python3-gobject
BuildRequires:  python3-psutil
BuildRequires:  update-desktop-files
BuildRequires:  xdg-utils
BuildRequires:  typelib(Gtk) = 3.0
Requires:       gnome-menus
Requires:       hicolor-icon-theme
Requires:       python3
Requires:       python3-gobject
Requires:       python3-psutil
Requires:       xdg-utils
Recommends:     %{name}-lang
BuildArch:      noarch

A desktop menu editor. Budgie, Cinnamon, GNOME, KDE (Plasma), LXDE, LXQt, MATE,
Pantheon, Unity, and Xfce are supported.




%{__python3} install --root=%{buildroot}

# Remove hashbang line from non-executable library files
for lib in %{buildroot}%{python3_sitelib}/menulibre{,_lib}/*.py; do
    sed '1{\@^#!/usr/bin/python3@d}' $lib > $ &&
    touch -r $lib $ &&
    mv $ $lib

# Fix name issue in menulibre.desktop with Budgie and Pantheon
desktop-file-edit %{buildroot}%{_datadir}/applications/%{name}.desktop --remove-only-show-in="Pantheon" \
desktop-file-edit %{buildroot}%{_datadir}/applications/%{name}.desktop --add-only-show-in="X-Pantheon" \

# Fix python-bytecode-inconsistent-mtime.
pushd %{buildroot}%{python3_sitelib}/%{name}_lib
%py3_compile .

# Fix duplicate doc folder
rm -rf %{buildroot}%{_datadir}/doc

rm -rf %{buildroot}%{python3_sitelib}/__pycache__
rm -f %{buildroot}%{python3_sitelib}/

# Fix duplicate icon
%fdupes %{buildroot}%{_datadir}/icons/hicolor/

rm -f %{buildroot}%{_datadir}/menulibre/metainfo/
desktop-file-validate %{buildroot}/%{_datadir}/applications/menulibre.desktop

%find_lang %{name}

%files -f %{name}.lang

%license COPYING

openSUSE Build Service is sponsored by