This file is indexed.

/usr/share/medit-1/language-specs/rpmspec.lang is in medit 1.0.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<?xml version="1.0" encoding="UTF-8"?>
<!--

 This file is part of GtkSourceView

 Author: Konstantin Ryabitsev <icon@fedoraproject.org>
 Copyright (C) 2007 Konstantin Ryabitsev <icon@fedoraproject.org>

 GtkSourceView is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 GtkSourceView is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

-->
<language id="rpmspec" _name="RPM spec" version="2.0" _section="Others">
  <metadata>
    <property name="mimetypes">text/x-rpm-spec</property>
    <property name="globs">*.spec</property>
    <property name="line-comment-start">#</property>
  </metadata>

  <styles>
    <style id="define" _name="Define" map-to="def:preprocessor"/>
    <style id="header" _name="Header" map-to="def:keyword"/>
    <style id="section" _name="Section" map-to="def:type"/>
    <style id="spec-macro" _name="Spec Macro" map-to="def:preprocessor"/>
    <style id="directory-macro" _name="Directory Macro" map-to="def:identifier"/>
    <style id="command-macro" _name="Command Macro" map-to="def:identifier"/>
    <style id="conditional-macro" _name="Conditional Macro" map-to="def:preprocessor"/>
    <style id="other-macro" _name="Other Macro" map-to="def:identifier"/>
    <style id="flow-conditional" _name="Flow Conditional" map-to="def:preprocessor"/>
    <style id="rpm-var" _name="RPM Variable" map-to="def:identifier"/>
    <style id="switch" _name="Switch" map-to="def:operator"/>
    <style id="changelog-date" _name="Date" map-to="changelog:date"/>
    <style id="changelog-email" _name="Email" map-to="changelog:email"/>
  </styles>

  <definitions>

    <context id="define" style-ref="define" end-at-line-end="true">
      <start>%define</start>
      <include>
        <context ref="def:line-continue" ignore-style="true"/>
      </include>
    </context>

    <context id="conditional-define" style-ref="define" end-at-line-end="true">
      <start>%\{\!\?.*%define</start>
      <end>\}</end>
      <include>
        <context ref="def:line-continue" ignore-style="true"/>
      </include>
    </context>

    <context id="header" style-ref="header">
      <prefix>^</prefix>
      <suffix>:</suffix>
      <keyword>Name</keyword>
      <keyword>Version</keyword>
      <keyword>Release</keyword>
      <keyword>Epoch</keyword>
      <keyword>Summary</keyword>
      <keyword>Group</keyword>
      <keyword>License</keyword>
      <keyword>Packager</keyword>
      <keyword>Vendor</keyword>
      <keyword>Icon</keyword>
      <keyword>URL</keyword>
      <keyword>Patch[0-9]*</keyword>
      <keyword>Source[0-9]*</keyword>
      <keyword>Requires\(?[a-z]*\)?</keyword>
      <keyword>[A-Za-z]+Req</keyword>
      <keyword>Obsoletes</keyword>
      <keyword>Provides</keyword>
      <keyword>Conflicts</keyword>
      <keyword>Build[A-Za-z]+</keyword>
      <keyword>[A-Za-z]+Arch</keyword>
      <keyword>Auto[A-Za-z]+</keyword>
    </context>

    <context id="section" style-ref="section">
      <prefix>^%</prefix>
      <keyword>description</keyword>
      <keyword>package</keyword>
      <keyword>prep</keyword>
      <keyword>build</keyword>
      <keyword>install</keyword>
      <keyword>clean</keyword>
      <keyword>check</keyword>
      <keyword>pre[a-z]*</keyword>
      <keyword>post[a-z]*</keyword>
      <keyword>trigger[a-z]*</keyword>
      <keyword>files</keyword>
      <!-- the "changelog" section is handled as a special
           case below.
           TODO: In the future it would be nice to do the
           same for other sections to enforce that some of the
           things are highlighted only when in the correct
           section.
      -->
    </context>

    <context id="spec-macro" style-ref="spec-macro">
      <prefix>%</prefix>
      <keyword>defattr</keyword>
      <keyword>docdir</keyword>
      <keyword>doc</keyword>
      <keyword>setup</keyword>
      <keyword>config</keyword>
      <keyword>configure</keyword>
      <keyword>make</keyword>
      <keyword>makeinstall</keyword>
      <keyword>dir</keyword>
      <keyword>ghost</keyword>
      <keyword>patch[0-9]+</keyword>
      <keyword>find_lang</keyword>
      <keyword>exclude</keyword>
    </context>

    <context id="directory-macro" style-ref="directory-macro">
        <match>%\{?_([a-z_]+dir|[a-z_]+path|prefix)\}?</match>
    </context>

    <context id="command-macro" style-ref="command-macro">
        <match>%\{?__[a-z_]+\}?</match>
    </context>

    <context id="conditional-macro" style-ref="conditional-macro">
        <match>%\{\?[A-Za-z0-9_]+\}</match>
    </context>

    <context id="other-macro" style-ref="other-macro">
        <match>%\{[a-zA-Z][a-zA-Z0-9_]+\}</match>
    </context>

    <context id="flow" style-ref="flow-conditional">
      <prefix>%</prefix>
      <keyword>ifarch</keyword>
      <keyword>if</keyword>
      <keyword>else</keyword>
      <keyword>elif</keyword>
      <keyword>endif</keyword>
    </context>

    <context id="rpm-var" style-ref="rpm-var">
        <match>\$\{?RPM_[A-Z0-9_]+\}?</match>
    </context>

    <!-- TODO: this is one of the context which would be nice
         to restrict to the proper sections -->
    <context id="command-switch" style-ref="switch">
        <match>\s(-\w+|--\w[a-zA-Z_-]+)</match>
    </context>

    <define-regex id="weekday">Mon|Tue|Wed|Thu|Fri|Sat|Sun</define-regex>
    <define-regex id="month">Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec</define-regex>
    <define-regex id="date" extended="true">
      \%{weekday}\s+\%{month}\s+\d{1,2}\s+(\d{1,2}:\d{1,2}:\d{1,2}\s+)?\d{4} |   # Wed Jun 27 13:27:21 2007
      \d{4}-\d{2}-\d{2}                                                          # 2007-06-28
    </define-regex>

    <context id="changelog-section">
      <start>%changelog</start>
      <end>^(?=%)</end>
      <include>
        <context sub-pattern="0" where="start" style-ref="section"/>
        <context id="date" style-ref="changelog-date">
          <match>\%{date}</match>
        </context>
        <context id="email" style-ref="changelog-email">
          <match>&lt;[A-Za-z0-9._+-]+@[A-Za-z0-9._+-]+\.[A-Za-z0-9]{2,4}&gt;</match>
        </context>
      </include>
    </context>

    <context id="rpmspec">
      <include>
        <context ref="def:shell-like-comment"/>
        <context ref="define"/>
        <context ref="header"/>
        <context ref="section"/>
        <context ref="spec-macro"/>
        <context ref="directory-macro"/>
        <context ref="command-macro"/>
        <context ref="conditional-macro"/>
        <context ref="other-macro"/>
        <context ref="flow"/>
        <context ref="rpm-var"/>
        <context ref="command-switch"/>
        <context ref="changelog-section"/>
      </include>
    </context>

  </definitions>

</language>