Warning, /frameworks/syntax-highlighting/autotests/input/highlight.spec is written in an unsupported language. File is not indexed.
0001 # Test file for rpmspec.xml 0002 0003 # Comments start with a # in column="0": 0004 0005 # Some comment 0006 0007 # When they don't start in column="0", that they are recognized as comments, but with an alert: 0008 # This is a bad comment. 0009 # RPM spec says clear that comments must start at the begin of the line. However, in practice 0010 # the RPM software is more permissive, depending on the context. But for our syntax highlighting, 0011 # we give, while recognizing the as comment, at least a little alert. Comments should not contain 0012 # the character % (which is marked as warning), but 2 of them are okay: %%. TODO is higlighted. 0013 0014 # A spec file starts with "Normal" context. Here, you can specify values for some tags: 0015 Name: kradioripper-unstable # Note that here in no comment possible! 0016 Name: name only _one_ word allowed 0017 Name: %macro no further syntax check after macro! 0018 # Some tags support only _one_ word as value 0019 Version: 0.4test5 up-from-the-space-this-is-an-error 0020 # Some tag can have parameters: Any char in paranthesis: 0021 Summary: Recorder for internet radios (based on Streamripper) 0022 Summary(de.UTF-8): Aufnahmeprogramm für Internetradios (basiert auf Streamripper) 0023 # requiere free text: 0024 License: License 1 2 3 0025 # requiere a well defines value: 0026 Requires( / ( = ): Some, value() 0027 # new type "switch" accepts: yes, no, 0, 1 0028 AutoReq: yes 0029 AutoReq: yes invalid 0030 AutoReq: %macro no further syntax check after macro! 0031 AutoReq: no 0032 AutoReq: 0 0033 AutoReq: 1 0034 # requiere a number: 0035 Epoch: 123123 0036 Epoch: 123123 invalid 0037 Epoch: %macro no further syntax check afer macro! 0038 # If tags are used that are not known, they are not highlighted: 0039 Invalidtag: Some value 0040 Invalid content in this section (only tags are allowed) 0041 0042 # You can use conditions in specs (highlighted with region markers): 0043 %if 0%{?mandriva_version} 0044 # numbers and strings are distingished: string: 0045 %if lsdksfj 0046 # number: 0047 %if 23472398 0048 # string: 0049 %if lksdjfsl72939 0050 # invalid: 0051 %if 92437lsdkfjdsl 0052 # valid: 0053 %if "lsdfj %ksdf(sdfs) 3489" 0054 Release: %mkrel 1.2 0055 %else 0056 Release: 0 0057 %endif 0058 # requiere a well defined value: 0059 %ifos fixed_value 0060 # You must use these special macros (%%if etc.) always at the start of the line - if not, 0061 # that's bad but not an arror. You must also always use the specified form. Everything else is an 0062 # error: 0063 %if 0064 something %if 0065 %{if} 0066 %if(some options) 0067 # However, this are different macros and therefore correct: 0068 %ifx 0069 %{ifx} 0070 %ifx(some options) 0071 0072 # the \ is escaped in the line. At the end of the line it escapes the line break: 0073 echo This is \" a text \\ and here\ 0074 it continues. 0075 0076 %define name value 0077 %define invalid_näme value 0078 %define macroname multi\ 0079 line content with references like %0 %* %# %{-f} %{-f*} %1 %2 and so on 0080 %global name value 0081 %global invalid_näme value 0082 %undefine name 0083 %undefine name too-many-parameters 0084 0085 # shell command 0086 %define buildoutputdir %{expand:build/jdk%{featurever}.build%{?1}} 0087 %define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}} 0088 %define save_alternatives() %{expand: 0089 # bash comment 0090 function foo { 0091 LANG=en_US.UTF-8 alternatives --display "$MASTER" 0092 } 0093 MASTER="%{?1}" 0094 rm -f %{_localstatedir}/lib/rpm-state/"$MASTER"_$FAMILY > /dev/null 0095 if foo > /dev/null | bar -q ; then 0096 zeta 2 > %{_localstatedir}/lib/rpm-state/"$MASTER"_"$FAMILY" 0097 fi 0098 } 0099 0100 # lua command 0101 %define save_alternatives() %{lua: 0102 -- a lua code 0103 local posix = require "posix" 0104 if (os.getenv("debug") == "true") then 0105 debug = true; 0106 print("debug") 0107 else 0108 debug = false; 0109 end 0110 } 0111 0112 0113 # This special comment is treated and highlighted like a tag: 0114 # norootforbuild 0115 # It can't have parameters, so every following non-whitespace character is not good: 0116 # norootforbuild DONT WRITE ANYTHING HERE! 0117 # wrong spacing is also recognized: 0118 # norootforbuild 0119 # and also an indeet is not fine for norootforbuild: 0120 # norootforbuild 0121 0122 # This following "Conflicts" tag will be removed by set-version.sh, 0123 # if it is a "kradioripper" release (and not a "kradioripper-unstable" release)... 0124 Conflicts: kradioripper 0125 0126 0127 %description 0128 # Here, a new section starts. It contains a value for the RPM field "description" and is therefor 0129 # colored like values: 0130 A KDE program for ripping internet radios. Based on StreamRipper. 0131 0132 0133 # A section start can have parameters: 0134 %description -l de.UTF-8 0135 Ein KDE-Aufnahmeprogramm für Internetradios. Basiert auf StreamRipper. 0136 0137 # These sections starts are errors: 0138 %description not at the first line 0139 %{description} wrong form 0140 %description(no options allowed, only parameters!) 0141 0142 0143 %prep 0144 # This starts a section that defines the commands to prepare the build. 0145 # q means quit. n sets the directory: 0146 %setup -q -n kradioripper 0147 echo Test 0148 # Macros can have different forms: Valid: 0149 %abc 0150 %abcÄndOfMacro 0151 %abc(def)EndOfMacro 0152 %{abc}EndOfMacro 0153 %{something but no single %}EndOfMacro 0154 %{abc:def}EndOfMacro 0155 %(abc) 0156 # Invalid: 0157 %ÄInvalidChar 0158 % 0159 %) 0160 %} 0161 # You can use macros inside of macro calls: Fine: 0162 %{something %but no %{sin%(fine)gle} }EndOfMacro 0163 # Bad: 0164 %{No closing paranthesis (No syntax highlightig for this error available) 0165 0166 0167 %build 0168 cmake ./ -DCMAKE_INSTALL_PREFIX=%{_prefix} 0169 %__make %{?jobs:-j %jobs} 0170 %{!?_licensedir:%global license %%doc} 0171 0172 0173 %install 0174 %if 0%{?suse_version} 0175 %makeinstall 0176 %suse_update_desktop_file kradioripper 0177 %endif 0178 %if 0%{?fedora_version} || 0%{?rhel_version} || !0%{?centos_version} 0179 make install DESTDIR=%{buildroot} 0180 desktop-file-install --delete-original --vendor fedora --dir=%{buildroot}/%{_datadir}/applications/kde4 %{buildroot}/%{_datadir}/applications/kde4/kradioripper.desktop 0181 %endif 0182 %if 0%{?mandriva_version} 0183 %makeinstall_std 0184 %endif 0185 0186 0187 %clean 0188 rm -rf "%{buildroot}" 0189 0190 0191 %files 0192 %defattr(-,root,root) 0193 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} 0194 %{_datadir}/applications/kde4/fedora-kradioripper.desktop 0195 %else 0196 %{_datadir}/applications/kde4/kradioripper.desktop 0197 %endif 0198 %{_bindir}/kradioripper 0199 %{_datadir}/locale/*/LC_MESSAGES/kradioripper.mo 0200 %if 0%{?mandriva_version} 0201 # TODO The %%doc macro is actually broken for mandriva 2009 in build service... 0202 %dir %{_datadir}/apps/kradioripper 0203 %{_datadir}/apps/kradioripper/* 0204 %else 0205 %doc COPYING LICENSE LICENSE.GPL2 LICENSE.GPL3 NEWS WARRANTY 0206 %dir %{_datadir}/kde4/apps/kradioripper 0207 %{_datadir}/kde4/apps/kradioripper/* 0208 %endif 0209 0210 # lua section 0211 %pretrans headless -p <lua> 0212 -- a lua code 0213 local posix = require "posix" 0214 if (os.getenv("debug") == "true") then 0215 debug = true; 0216 print("debug") 0217 else 0218 debug = false; 0219 end 0220 0221 %changelog 0222 * Sun May 04 2008 email@email.com 0223 - some text 0224 - some text 0225 in two lines 0226 - some text 0227 in two lines 0228 + with subtext 0229 - and more subtext 0230 in two lines 0231 * Tue Apr 24 2007 Name 0232 - text 0233 * When the star isn't at column 0, than it doesn't indicate 0234 a new date 0235 * Wen Sep 08 2003 Wrong weekday 0236 * Mon Mai 08 2003 Wrong month 0237 * Mon Sep 0 2003 bad day 0238 * Mon Sep 8 2003 good day 0239 * Mon Sep 08 2003 good day 0240 * Mon Sep 32 2003 bad day 0241 * Mon Sep 08 03 bad year 0242 * Mon Sep 08 2003 Name 0243 # When using macros, the error check is disabled: 0244 * %myDataMacro Title of the entry 0245 - Text 0246 - can 0247 - be 0248 - indeeded 0249 - without 0250 - problems