Bug 497619 - RPM Specfile syntax is outdated (RPM 4.20.0)
Summary: RPM Specfile syntax is outdated (RPM 4.20.0)
Status: REPORTED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: 6.8.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-17 20:18 UTC by Jan Felix Langenbach
Modified: 2024-12-17 20:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Felix Langenbach 2024-12-17 20:18:39 UTC
SUMMARY
The RPM spec file syntax is outdated as of RPM 4.20.0. As the last commit added support for the %generate_buildrequires section (RPM 4.15.0), I’ve looked at the changelogs of RPM 4.16.0–4.20.0 and found that at least the following constructs are not highlighted correctly.

- %[...] expression syntax (including Lua support)
- SourceLicense tag
- UpstreamReleases tag
- TranslationURL tag
- %conf section
- %preuntrans scriptlet
- %postuntrans scriptlet
- BuildSystem directive
- BuildOption directive
- Indentation before tags

STEPS TO REPRODUCE
1. Open an RPM spec file in Kate or KWrite
2. Type out these constructs
3. Observe the highlighting

OBSERVED RESULT
The constructs are highlighted incorrectly or marked as errors.

EXPECTED RESULT
The constructs are highlighted correctly.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 41
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0

ADDITIONAL INFORMATION
RPM also reads '.specpart' files now, which might need to be added to the file extension list and/or MIME type.
Comment 1 Jan Felix Langenbach 2024-12-17 20:40:54 UTC
Upon further inspection, there are even more constructs not supported by the current syntax.

- Comments (#) after conditionals
- %dnl comments
- BugURL tag
- ModularityLabel tag
- NoSource tag
- NoPatch tag

... and probably more.