Bug 497619

Summary: RPM Specfile syntax is outdated (RPM 4.20.0)
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: Jan Felix Langenbach <JanFelix.Langenbach>
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: REPORTED ---    
Severity: normal CC: walter.von.entferndt
Priority: NOR    
Version First Reported In: 6.8.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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.