nano/syntax/spec.nanorc

41 lines
1.9 KiB
Plaintext
Raw Normal View History

## Syntax highlighting for RPM spec files.
syntax spec "\.spec(\.[^/]+)?$"
comment "#"
# Main tags.
color brightblue "\<(BuildArch(itectures)?|Exclusive(Arch|OS)|Exclude(Arch|OS))[[:space:]]*:"
color brightblue "\<(Conflicts|Enhances|Obsoletes|Provides|Requires(\(.*\))?|Recommends|Suggests|Supplements|BuildConflicts|BuildRequires|PreReq)[[:space:]]*:"
color brightblue "\<(Epoch|Icon|Nosource|Nopatch|Serial)[[:space:]]*:"
color brightblue "\<(AutoReq|AutoProv|AutoReqProv)[[:space:]]*:"
color brightblue "\<(Copyright|License|Summary(\(.*\))?|Distribution|Vendor|Packager|Group|BuildRoot|Prefix)[[:space:]]*:"
color brightblue "\<(Name|Version|Release|URL|Url)[[:space:]]*:"
color brightblue "\<(Source|Patch)[0-9]*[[:space:]]*:"
# Architectures.
color brightred "\<(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppciseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x?|noarch)\>"
# Architecture and OS conditionals.
color brightred "%(ifarch|elifarch|ifnarch|ifos|elifos|ifnos)\>"
# %* strings.
color green "%([A-Z_a-z_0-9_]*)"
color magenta "%_([A-Z_a-z_0-9_]*)"
color yellow start="%__" end="\ "
color magenta start="%\{" end="\}"
color yellow start="%\{__" end="\}"
# Sections.
color red "^%(build$|changelog|check$|clean$|description|files|install$|package|prep$)"
color red "^%((pre|post)(trans|un)?|trigger(prein|in|un|postun)?|verifyscript)"
color red "^%(trans)?filetrigger(in|un|postun)?"
color red "^%(sourcelist|patchlist|generate_buildrequires)"
# Conditionals and defines.
color brightred "%(if|elif|else|endif|define|global|undefine)\>"
# Comments.
color cyan "(#|%dnl[[:space:]]).*"
# Special case: "# norootforbuild" is handled as main tag.
color brightblue "^# norootforbuild"
# First the author, then just the date of %changelog entries.
color yellow "^\* .+>"
color brightyellow "^\* [[:alnum:] ]+ [0-9]{4} "
# Trailing whitespace.
color ,green "[[:space:]]+$"