Bug 2370231

Summary: Fedora builds put the wrong file in ` /usr/share/mime/packages/qgis.xml`
Product: [Fedora] Fedora Reporter: dolfandringa <dolfandringa>
Component: qgisAssignee: Sandro Mani <manisandro>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 41CC: bruno, cz172638, jonathan, manisandro, orion
Target Milestone: ---Keywords: Desktop
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://kojipkgs.fedoraproject.org//packages/qgis/3.40.7/1.fc41/x86_64/qgis-3.40.7-1.fc41.x86_64.rpm
Whiteboard:
Fixed In Version: qgis-3.40.7-3.fc41 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-06-06 02:07:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dolfandringa@gmail.com 2025-06-04 12:01:46 UTC
When updating some packages on fedora 41, update-alternatives runs which throws the following error:

```
>>> Scriptlet output:
>>> update-alternatives is /sbin/update-alternatives
>>> /usr/share/mime/packages/qgis.xml:1: parser error : Start tag expected, '<' not found
>>> ==================================================
>>> ^
>>> Failed to parse '/usr/share/mime/packages/qgis.xml'
```

Inspecting the file, it seems the file is a plain text file (some Readme or something) instead of the expected xml mime-type data. 

Reproducible: Always

Steps to Reproduce:
1. sudo dnf install qgis
2. head -n 10 /usr/share/mime/packages/qgis.xml
Actual Results:
==================================================
QGIS server
==================================================

QGIS server allows you to publish your QGIS projects as Web Map
Services (WMS). Simply layout your map in QGIS. The WMS will look
exactly the same, because QGIS server uses the same libraries for
rendering, as the desktop application does.

A sample configuration file for Httpd is installed under

Expected Results:
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>

  <mime-type type="application/x-qgis-project">
    <comment>QGIS Project</comment>
    <comment xml:lang="de">QGIS-Projekt</comment>
    <sub-class-of type="application/xml"/>
    <alias type="application/x-qgis"/>
    <icon name="qgis-qgs"/>
    <magic priority="50">

Additional Information:
I double checked by downloading the rpm files and check their contents and those all seem to contain the same issue.

This seems to be the case at least in:

* [Fedora 42 3.42.3](https://koji.fedoraproject.org/koji/buildinfo?buildID=2715791)
* [Fedora 41 3.40.7](https://koji.fedoraproject.org/koji/buildinfo?buildID=2715856)

Checking the [source rpm build scripts from QGIS itself](https://github.com/qgis/QGIS/blob/499873d76966e4e869dcfa3d8d8f519fe09b794b/rpm/qgis.spec.template#L257), the build script does contain a valid file for it. The fedora build script just deviates from it.

Comment 1 Fedora Update System 2025-06-04 12:03:45 UTC
FEDORA-2025-b2b73f5bc4 (qgis-3.40.7-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-b2b73f5bc4

Comment 2 dolfandringa@gmail.com 2025-06-04 12:30:52 UTC
It looks like the [testing version](https://koji.fedoraproject.org/koji/buildinfo?buildID=2721248) actually fixed it. 
Running `sudo dnf update --enablerepo=updates-testing qgis` seems to install the correct file there. So I guess its just a matter of time before its fixed.

Comment 3 Fedora Update System 2025-06-05 01:41:48 UTC
FEDORA-2025-4e80be5a1e has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-4e80be5a1e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-4e80be5a1e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2025-06-06 02:07:30 UTC
FEDORA-2025-4e80be5a1e (qgis-3.40.7-3.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.