How to generate -lang packages with obsoletes and provides properties?

I was editing kf6-kio .spec file from factory branch.
I created my own version of KIO for WXConsoleSpawner.
I need to put my version of lang package, but do not known, how order to uninstall kf6-kio-lang-* packages.
My spec file looks like this:

spec file for package kf6-kio

Copyright (c) 2025 SUSE LLC and contributors

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/

Based on spec file for kf6-kio published on Open Build Service,

modified by author of WXConsoleSpawner

%define qt6_version 6.9.0

%define rname WXConsoleSpawner-kio

Full KF6 version (e.g. 6.29.0)

%{!?_kf6_version: %global _kf6_version %{version}}
%bcond_without released
Name: WXConsoleSpawner-kio
Version: 6.30.0
Release: 0
Summary: Network transparent access to files and data
License: LGPL-2.1-or-later
URL: https://www.sourceforge.net/p/WXConsoleSpawner
Source0: https://sourceforge.net/projects/WXConsoleSpawner/files/Sources/WXConsoleSpawner-KIO-0.91.tar.gz
Obsoletes: kf6-kio <= 6.30.0
Provides: kf6-kio = 6.30.0
BuildRequires: fdupes
BuildRequires: kf6-extra-cmake-modules >= %{_kf6_version}
BuildRequires: libattr-devel
BuildRequires: pkgconfig
BuildRequires: qt6-gui-private-devel >= %{qt6_version}
BuildRequires: cmake(KF6Archive) >= %{_kf6_version}
BuildRequires: cmake(KF6Auth) >= %{_kf6_version}
BuildRequires: cmake(KF6Bookmarks) >= %{_kf6_version}
BuildRequires: cmake(KF6ColorScheme) >= %{_kf6_version}
BuildRequires: cmake(KF6Completion) >= %{_kf6_version}
BuildRequires: cmake(KF6Config) >= %{_kf6_version}
BuildRequires: cmake(KF6ConfigWidgets) >= %{_kf6_version}
BuildRequires: cmake(KF6CoreAddons) >= %{_kf6_version}
BuildRequires: cmake(KF6Crash) >= %{_kf6_version}
BuildRequires: cmake(KF6DBusAddons) >= %{_kf6_version}
BuildRequires: cmake(KF6DocTools) >= %{_kf6_version}
BuildRequires: cmake(KF6GuiAddons) >= %{_kf6_version}
BuildRequires: cmake(KF6I18n) >= %{_kf6_version}
BuildRequires: cmake(KF6IconThemes) >= %{_kf6_version}
BuildRequires: cmake(KF6ItemViews) >= %{_kf6_version}
BuildRequires: cmake(KF6JobWidgets) >= %{_kf6_version}
BuildRequires: cmake(KF6KDED) >= %{_kf6_version}
BuildRequires: cmake(KF6Service) >= %{_kf6_version}
BuildRequires: cmake(KF6Solid) >= %{_kf6_version}
BuildRequires: cmake(KF6TextWidgets) >= %{_kf6_version}
BuildRequires: cmake(KF6Wallet) >= %{_kf6_version}
BuildRequires: cmake(KF6WidgetsAddons) >= %{_kf6_version}
BuildRequires: cmake(KF6WindowSystem) >= %{_kf6_version}
BuildRequires: cmake(Qt6Concurrent) >= %{qt6_version}
BuildRequires: cmake(Qt6Core) >= %{qt6_version}
BuildRequires: cmake(Qt6DBus) >= %{qt6_version}
BuildRequires: cmake(Qt6Network) >= %{qt6_version}
BuildRequires: cmake(Qt6Test) >= %{qt6_version}
BuildRequires: cmake(Qt6ToolsTools) >= %{qt6_version}
BuildRequires: cmake(Qt6UiPlugin) >= %{qt6_version}
BuildRequires: cmake(Qt6Widgets) >= %{qt6_version}
BuildRequires: cmake(Qt6Xml) >= %{qt6_version}
BuildRequires: pkgconfig(libacl)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libxslt)
BuildRequires: pkgconfig(mount)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(x11)
Requires: kf6-kded >= %{_kf6_version}

For discrete GPU discovery

Recommends: switcheroo-control

%description
This framework implements almost all the file management functions you
will ever need. In fact, the KDE file manager (Dolphin) and the KDE
file dialog also uses this to provide its network-enabled file management.
It also provides easy way to ran programs by click on it, but with
present of WXConsoleSpawner

%package doc
Obsoletes: kf6-kio-doc <= 6.30.0
Provides: kf6-kio-doc <= 6.30.0
Summary: HTML documentation for KIO

%description doc
This package contains documentation for the KIO framework.

%package libKF6KIO6
Obsoletes: libKF6KIO6 <= 6.30.0
Provides: libKF6KIO6 <= 6.30.0
Summary: KIO Libraries

%description libKF6KIO6
Network transparent access to files and data

%package devel
Summary: Network transparent access to files and data
Requires: libKF6KIO6 = %{version}
Requires: cmake(KF6Bookmarks) >= %{_kf6_version}
Requires: cmake(KF6Completion) >= %{_kf6_version}
Requires: cmake(KF6Config) >= %{_kf6_version}
Requires: cmake(KF6CoreAddons) >= %{_kf6_version}
Requires: cmake(KF6ItemViews) >= %{_kf6_version}
Requires: cmake(KF6JobWidgets) >= %{_kf6_version}
Requires: cmake(KF6Service) >= %{_kf6_version}
Requires: cmake(KF6Solid) >= %{_kf6_version}
Requires: cmake(KF6WindowSystem) >= %{_kf6_version}
Requires: cmake(KF6XmlGui) >= %{_kf6_version}
Requires: cmake(Qt6Concurrent) >= %{qt6_version}
Requires: cmake(Qt6DBus) >= %{qt6_version}
Requires: cmake(Qt6Network) >= %{qt6_version}

%description devel
This framework implements almost all the file management functions you
will ever need. In fact, the KDE file manager (Dolphin) and the KDE
file dialog also uses this to provide its network-enabled file management.
Development files.
It also provides easy way to ran programs by click on it, but with
present of WXConsoleSpawner

%lang_package

%prep
%autosetup -n WXConsoleSpawner-0.91

%build
%ifarch ppc64
%define _lto_cflags %{nil}
%endif

cd src/kio

%cmake_kf6

%kf6_build

%install

cd src/kio
%kf6_install

%fdupes %{buildroot}

%find_lang kio --with-man --all-name

%ldconfig_scriptlets libKF6KIO6

%files
%{_kf6_applicationsdir}/ktelnetservice6.desktop
%{_kf6_applicationsdir}/org.kde.kiod6.desktop
%{_kf6_bindir}/ktelnetservice6
%{_kf6_bindir}/ktrash6
%{_kf6_datadir}/searchproviders/
%{_kf6_debugdir}/kio.categories
%{_kf6_debugdir}/kio.renamecategories
%{_kf6_libdir}/libkuriikwsfiltereng_private.so
%{_kf6_libexecdir}/kiod6
%{_kf6_libexecdir}/kioexec
%{_kf6_libexecdir}/kioworker
%{_kf6_plugindir}/designer/kio6widgets.so
%{_libdir}/qt6/plugins/kf6/urifilters/localdomainurifilter.so
%{_libdir}/qt6/plugins/kf6/urifilters/kuriikwsfilter.so
%{_libdir}/qt6/plugins/kf6/urifilters/kurisearchfilter.so
%{_libdir}/qt6/plugins/kf6/urifilters/kshorturifilter.so
%{_libdir}/qt6/plugins/kf6/urifilters/fixhosturifilter.so
%{_libdir}/qt6/plugins/kf6/kded/remotenotifier.so
%{_libdir}/qt6/plugins/kf6/kio/kio_file.so
%{_libdir}/qt6/plugins/kf6/kio/kio_ftp.so
%{_libdir}/qt6/plugins/kf6/kio/kio_ghelp.so
%{_libdir}/qt6/plugins/kf6/kio/kio_help.so
%{_libdir}/qt6/plugins/kf6/kio/kio_http.so
%{_libdir}/qt6/plugins/kf6/kio/kio_remote.so
%{_libdir}/qt6/plugins/kf6/kio/kio_trash.so
%dir %{_libdir}/qt6/plugins/kf6/kiod
%{_libdir}/qt6/plugins/kf6/kiod/kioexecd.so
%{_libdir}/qt6/plugins/kf6/kiod/kpasswdserver.so
%{_libdir}/qt6/plugins/kf6/kiod/kssld.so
%dir %{_libdir}/qt6/plugins/kf6/kio_dnd/
%{_libdir}/qt6/plugins/kf6/kio_dnd/dropintonewfolder.so
%{_libdir}/qt6/plugins/kf6/urifilters/
%{_kf6_sharedir}/dbus-1/services/org.kde.kiod6.service
%{_kf6_sharedir}/dbus-1/services/org.kde.kioexecd6.service
%{_kf6_sharedir}/dbus-1/services/org.kde.kpasswdserver6.service
%{_kf6_sharedir}/dbus-1/services/org.kde.kssld6.service

%files doc
%{_kf6_htmldir}/*

%files libKF6KIO6
%license src/kio/LICENSES/*
%doc src/kio/README.md
%{_kf6_libdir}/libKF6KIOCore.so.*
%{_kf6_libdir}/libKF6KIOFileWidgets.so.*
%{_kf6_libdir}/libKF6KIOGui.so.*
%{_kf6_libdir}/libKF6KIOWidgets.so.*

%files devel
%{_kf6_cmakedir}/KF6KIO/
%{_kf6_includedir}/KIO/
%{_kf6_includedir}/KIOCore/
%{_kf6_includedir}/KIOFileWidgets/
%{_kf6_includedir}/KIOGui/
%{_kf6_includedir}/KIOWidgets/
%{_kf6_libdir}/libKF6KIOCore.so
%{_kf6_libdir}/libKF6KIOFileWidgets.so
%{_kf6_libdir}/libKF6KIOGui.so
%{_kf6_libdir}/libKF6KIOWidgets.so
%{_kf6_sharedir}/kdevappwizard/templates/kioworker6.tar.bz2

%files lang -f src/kio/kio.lang

%changelog

Interesting parts are:>

%lang_package

and

%files lang -f src/kio/kio.lang

Gemini suggested to do something like that:

%lang_package
Obsoletes: kf6-kio-lang <= 6.30.0
Provides: kf6-kio-lang = 6.30.0

But this not work.

The equal mark is important. You are obsoleting the same version which you are providing?! So this is a wrong AI recommendation…

Correct would be:

Obsoletes: kf6-kio-lang < 6.30.0
Provides: kf6-kio-lang = 6.30.0

There are quite some wiki articles which describe packaging guidelines. One which might help is:
https://en.opensuse.org/openSUSE:Upgrade_dependencies_explanation

1 Like