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 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
# Test file for rpmspec.xml
# Comments start with a # in column="0":
# Some comment
# When they don't start in column="0", that they are recognized as comments, but with an alert:
# This is a bad comment.
# RPM spec says clear that comments must start at the begin of the line. However, in practice
# the RPM software is more permissive, depending on the context. But for our syntax highlighting,
# we give, while recognizing the as comment, at least a little alert. Comments should not contain
# the character % (which is marked as warning), but 2 of them are okay: %%. TODO is higlighted.
# A spec file starts with "Normal" context. Here, you can specify values for some tags:
Name: kradioripper-unstable # Note that here in no comment possible!
Name: name only _one_ word allowed
Name: %macro no further syntax check after macro!
# Some tags support only _one_ word as value
Version: 0.4test5 up-from-the-space-this-is-an-error
# Some tag can have parameters: Any char in paranthesis:
Summary: Recorder for internet radios (based on Streamripper)
Summary(de.UTF-8): Aufnahmeprogramm für Internetradios (basiert auf Streamripper)
# requiere free text:
License: License 1 2 3
# requiere a well defines value:
Requires( / ( = ): Some, value()
# new type "switch" accepts: yes, no, 0, 1
AutoReq: yes
AutoReq: yes invalid
AutoReq: %macro no further syntax check after macro!
AutoReq: no
AutoReq: 0
AutoReq: 1
# requiere a number:
Epoch: 123123
Epoch: 123123 invalid
Epoch: %macro no further syntax check afer macro!
# If tags are used that are not known, they are not highlighted:
Invalidtag: Some value
Invalid content in this section (only tags are allowed)
# You can use conditions in specs (highlighted with region markers):
%if 0%{?mandriva_version}
# numbers and strings are distingished: string:
%if lsdksfj
# number:
%if 23472398
# string:
%if lksdjfsl72939
# invalid:
%if 92437lsdkfjdsl
# valid:
%if "lsdfj %ksdf(sdfs) 3489"
Release: %mkrel 1.2
%else
Release: 0
%endif
# requiere a well defined value:
%ifos fixed_value
# You must use these special macros (%%if etc.) always at the start of the line - if not,
# that's bad but not an arror. You must also always use the specified form. Everything else is an
# error:
%if
something %if
%{if}
%if(some options)
# However, this are different macros and therefore correct:
%ifx
%{ifx}
%ifx(some options)
# the \ is escaped in the line. At the end of the line it escapes the line break:
echo This is \" a text \\ and here\
it continues.
%define name value
%define invalid_näme value
%define macroname multi\
line content with references like %0 %* %# %{-f} %{-f*} %1 %2 and so on
%global name value
%global invalid_näme value
%undefine name
%undefine name too-many-parameters
# shell command
%define buildoutputdir %{expand:build/jdk%{featurever}.build%{?1}}
%define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}}
%define save_alternatives() %{expand:
# bash comment
function foo {
LANG=en_US.UTF-8 alternatives --display "$MASTER"
}
MASTER="%{?1}"
rm -f %{_localstatedir}/lib/rpm-state/"$MASTER"_$FAMILY > /dev/null
if foo > /dev/null | bar -q ; then
zeta 2 > %{_localstatedir}/lib/rpm-state/"$MASTER"_"$FAMILY"
fi
}
# lua command
%define save_alternatives() %{lua:
-- a lua code
local posix = require "posix"
if (os.getenv("debug") == "true") then
debug = true;
print("debug")
else
debug = false;
end
}
# This special comment is treated and highlighted like a tag:
# norootforbuild
# It can't have parameters, so every following non-whitespace character is not good:
# norootforbuild DONT WRITE ANYTHING HERE!
# wrong spacing is also recognized:
# norootforbuild
# and also an indeet is not fine for norootforbuild:
# norootforbuild
# This following "Conflicts" tag will be removed by set-version.sh,
# if it is a "kradioripper" release (and not a "kradioripper-unstable" release)...
Conflicts: kradioripper
%description
# Here, a new section starts. It contains a value for the RPM field "description" and is therefor
# colored like values:
A KDE program for ripping internet radios. Based on StreamRipper.
# A section start can have parameters:
%description -l de.UTF-8
Ein KDE-Aufnahmeprogramm für Internetradios. Basiert auf StreamRipper.
# These sections starts are errors:
%description not at the first line
%{description} wrong form
%description(no options allowed, only parameters!)
%prep
# This starts a section that defines the commands to prepare the build.
# q means quit. n sets the directory:
%setup -q -n kradioripper
echo Test
# Macros can have different forms: Valid:
%abc
%abcÄndOfMacro
%abc(def)EndOfMacro
%{abc}EndOfMacro
%{something but no single %}EndOfMacro
%{abc:def}EndOfMacro
%(abc)
# Invalid:
%ÄInvalidChar
%
%)
%}
# You can use macros inside of macro calls: Fine:
%{something %but no %{sin%(fine)gle} }EndOfMacro
# Bad:
%{No closing paranthesis (No syntax highlightig for this error available)
%build
cmake ./ -DCMAKE_INSTALL_PREFIX=%{_prefix}
%__make %{?jobs:-j %jobs}
%{!?_licensedir:%global license %%doc}
%install
%if 0%{?suse_version}
%makeinstall
%suse_update_desktop_file kradioripper
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || !0%{?centos_version}
make install DESTDIR=%{buildroot}
desktop-file-install --delete-original --vendor fedora --dir=%{buildroot}/%{_datadir}/applications/kde4 %{buildroot}/%{_datadir}/applications/kde4/kradioripper.desktop
%endif
%if 0%{?mandriva_version}
%makeinstall_std
%endif
%clean
rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
%{_datadir}/applications/kde4/fedora-kradioripper.desktop
%else
%{_datadir}/applications/kde4/kradioripper.desktop
%endif
%{_bindir}/kradioripper
%{_datadir}/locale/*/LC_MESSAGES/kradioripper.mo
%if 0%{?mandriva_version}
# TODO The %%doc macro is actually broken for mandriva 2009 in build service...
%dir %{_datadir}/apps/kradioripper
%{_datadir}/apps/kradioripper/*
%else
%doc COPYING LICENSE LICENSE.GPL2 LICENSE.GPL3 NEWS WARRANTY
%dir %{_datadir}/kde4/apps/kradioripper
%{_datadir}/kde4/apps/kradioripper/*
%endif
# lua section
%pretrans headless -p <lua>
-- a lua code
local posix = require "posix"
if (os.getenv("debug") == "true") then
debug = true;
print("debug")
else
debug = false;
end
%changelog
* Sun May 04 2008 email@email.com
- some text
- some text
in two lines
- some text
in two lines
+ with subtext
- and more subtext
in two lines
* Tue Apr 24 2007 Name
- text
* When the star isn't at column 0, than it doesn't indicate
a new date
* Wen Sep 08 2003 Wrong weekday
* Mon Mai 08 2003 Wrong month
* Mon Sep 0 2003 bad day
* Mon Sep 8 2003 good day
* Mon Sep 08 2003 good day
* Mon Sep 32 2003 bad day
* Mon Sep 08 03 bad year
* Mon Sep 08 2003 Name
# When using macros, the error check is disabled:
* %myDataMacro Title of the entry
- Text
- can
- be
- indeeded
- without
- problems
|