diff options
Diffstat (limited to 'imports/codemirror/mode/rpm')
-rwxr-xr-x | imports/codemirror/mode/rpm/changes/changes.js | 19 | ||||
-rwxr-xr-x | imports/codemirror/mode/rpm/changes/index.html | 53 | ||||
-rwxr-xr-x | imports/codemirror/mode/rpm/spec/index.html | 99 | ||||
-rwxr-xr-x | imports/codemirror/mode/rpm/spec/spec.css | 5 | ||||
-rwxr-xr-x | imports/codemirror/mode/rpm/spec/spec.js | 66 |
5 files changed, 242 insertions, 0 deletions
diff --git a/imports/codemirror/mode/rpm/changes/changes.js b/imports/codemirror/mode/rpm/changes/changes.js new file mode 100755 index 00000000..cb45f9e5 --- /dev/null +++ b/imports/codemirror/mode/rpm/changes/changes.js | |||
@@ -0,0 +1,19 @@ | |||
1 | CodeMirror.defineMode("changes", function(config, modeConfig) { | ||
2 | var headerSeperator = /^-+$/; | ||
3 | var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; | ||
4 | var simpleEmail = /^[\w+.-]+@[\w.-]+/; | ||
5 | |||
6 | return { | ||
7 | token: function(stream) { | ||
8 | if (stream.sol()) { | ||
9 | if (stream.match(headerSeperator)) { return 'tag'; } | ||
10 | if (stream.match(headerLine)) { return 'tag'; } | ||
11 | } | ||
12 | if (stream.match(simpleEmail)) { return 'string'; } | ||
13 | stream.next(); | ||
14 | return null; | ||
15 | } | ||
16 | }; | ||
17 | }); | ||
18 | |||
19 | CodeMirror.defineMIME("text/x-rpm-changes", "changes"); | ||
diff --git a/imports/codemirror/mode/rpm/changes/index.html b/imports/codemirror/mode/rpm/changes/index.html new file mode 100755 index 00000000..b7ff952d --- /dev/null +++ b/imports/codemirror/mode/rpm/changes/index.html | |||
@@ -0,0 +1,53 @@ | |||
1 | <!doctype html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>CodeMirror: RPM changes mode</title> | ||
5 | <link rel="stylesheet" href="../../../lib/codemirror.css"> | ||
6 | <script src="../../../lib/codemirror.js"></script> | ||
7 | <script src="changes.js"></script> | ||
8 | <link rel="stylesheet" href="../../../doc/docs.css"> | ||
9 | <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> | ||
10 | </head> | ||
11 | <body> | ||
12 | <h1>CodeMirror: RPM changes mode</h1> | ||
13 | |||
14 | <div><textarea id="code" name="code"> | ||
15 | ------------------------------------------------------------------- | ||
16 | Tue Oct 18 13:58:40 UTC 2011 - misterx@example.com | ||
17 | |||
18 | - Update to r60.3 | ||
19 | - Fixes bug in the reflect package | ||
20 | * disallow Interface method on Value obtained via unexported name | ||
21 | |||
22 | ------------------------------------------------------------------- | ||
23 | Thu Oct 6 08:14:24 UTC 2011 - misterx@example.com | ||
24 | |||
25 | - Update to r60.2 | ||
26 | - Fixes memory leak in certain map types | ||
27 | |||
28 | ------------------------------------------------------------------- | ||
29 | Wed Oct 5 14:34:10 UTC 2011 - misterx@example.com | ||
30 | |||
31 | - Tweaks for gdb debugging | ||
32 | - go.spec changes: | ||
33 | - move %go_arch definition to %prep section | ||
34 | - pass correct location of go specific gdb pretty printer and | ||
35 | functions to cpp as HOST_EXTRA_CFLAGS macro | ||
36 | - install go gdb functions & printer | ||
37 | - gdb-printer.patch | ||
38 | - patch linker (src/cmd/ld/dwarf.c) to emit correct location of go | ||
39 | gdb functions and pretty printer | ||
40 | </textarea></div> | ||
41 | <script> | ||
42 | var editor = CodeMirror.fromTextArea(document.getElementById("code"), { | ||
43 | mode: {name: "changes"}, | ||
44 | lineNumbers: true, | ||
45 | indentUnit: 4, | ||
46 | tabMode: "shift", | ||
47 | matchBrackets: true | ||
48 | }); | ||
49 | </script> | ||
50 | |||
51 | <p><strong>MIME types defined:</strong> <code>text/x-rpm-changes</code>.</p> | ||
52 | </body> | ||
53 | </html> | ||
diff --git a/imports/codemirror/mode/rpm/spec/index.html b/imports/codemirror/mode/rpm/spec/index.html new file mode 100755 index 00000000..e3bca152 --- /dev/null +++ b/imports/codemirror/mode/rpm/spec/index.html | |||
@@ -0,0 +1,99 @@ | |||
1 | <!doctype html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>CodeMirror: RPM spec mode</title> | ||
5 | <link rel="stylesheet" href="../../../lib/codemirror.css"> | ||
6 | <script src="../../../lib/codemirror.js"></script> | ||
7 | <script src="spec.js"></script> | ||
8 | <link rel="stylesheet" href="spec.css"> | ||
9 | <link rel="stylesheet" href="../../../doc/docs.css"> | ||
10 | <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> | ||
11 | </head> | ||
12 | <body> | ||
13 | <h1>CodeMirror: RPM spec mode</h1> | ||
14 | |||
15 | <div><textarea id="code" name="code"> | ||
16 | # | ||
17 | # spec file for package minidlna | ||
18 | # | ||
19 | # Copyright (c) 2011, Sascha Peilicke <saschpe@gmx.de> | ||
20 | # | ||
21 | # All modifications and additions to the file contributed by third parties | ||
22 | # remain the property of their copyright owners, unless otherwise agreed | ||
23 | # upon. The license for this file, and modifications and additions to the | ||
24 | # file, is the same license as for the pristine package itself (unless the | ||
25 | # license for the pristine package is not an Open Source License, in which | ||
26 | # case the license is the MIT License). An "Open Source License" is a | ||
27 | # license that conforms to the Open Source Definition (Version 1.9) | ||
28 | # published by the Open Source Initiative. | ||
29 | |||
30 | |||
31 | Name: libupnp6 | ||
32 | Version: 1.6.13 | ||
33 | Release: 0 | ||
34 | Summary: Portable Universal Plug and Play (UPnP) SDK | ||
35 | Group: System/Libraries | ||
36 | License: BSD-3-Clause | ||
37 | Url: http://sourceforge.net/projects/pupnp/ | ||
38 | Source0: http://downloads.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2 | ||
39 | BuildRoot: %{_tmppath}/%{name}-%{version}-build | ||
40 | |||
41 | %description | ||
42 | The portable Universal Plug and Play (UPnP) SDK provides support for building | ||
43 | UPnP-compliant control points, devices, and bridges on several operating | ||
44 | systems. | ||
45 | |||
46 | %package -n libupnp-devel | ||
47 | Summary: Portable Universal Plug and Play (UPnP) SDK | ||
48 | Group: Development/Libraries/C and C++ | ||
49 | Provides: pkgconfig(libupnp) | ||
50 | Requires: %{name} = %{version} | ||
51 | |||
52 | %description -n libupnp-devel | ||
53 | The portable Universal Plug and Play (UPnP) SDK provides support for building | ||
54 | UPnP-compliant control points, devices, and bridges on several operating | ||
55 | systems. | ||
56 | |||
57 | %prep | ||
58 | %setup -n libupnp-%{version} | ||
59 | |||
60 | %build | ||
61 | %configure --disable-static | ||
62 | make %{?_smp_mflags} | ||
63 | |||
64 | %install | ||
65 | %makeinstall | ||
66 | find %{buildroot} -type f -name '*.la' -exec rm -f {} ';' | ||
67 | |||
68 | %post -p /sbin/ldconfig | ||
69 | |||
70 | %postun -p /sbin/ldconfig | ||
71 | |||
72 | %files | ||
73 | %defattr(-,root,root,-) | ||
74 | %doc ChangeLog NEWS README TODO | ||
75 | %{_libdir}/libixml.so.* | ||
76 | %{_libdir}/libthreadutil.so.* | ||
77 | %{_libdir}/libupnp.so.* | ||
78 | |||
79 | %files -n libupnp-devel | ||
80 | %defattr(-,root,root,-) | ||
81 | %{_libdir}/pkgconfig/libupnp.pc | ||
82 | %{_libdir}/libixml.so | ||
83 | %{_libdir}/libthreadutil.so | ||
84 | %{_libdir}/libupnp.so | ||
85 | %{_includedir}/upnp/ | ||
86 | |||
87 | %changelog</textarea></div> | ||
88 | <script> | ||
89 | var editor = CodeMirror.fromTextArea(document.getElementById("code"), { | ||
90 | mode: {name: "spec"}, | ||
91 | lineNumbers: true, | ||
92 | indentUnit: 4, | ||
93 | matchBrackets: true | ||
94 | }); | ||
95 | </script> | ||
96 | |||
97 | <p><strong>MIME types defined:</strong> <code>text/x-rpm-spec</code>.</p> | ||
98 | </body> | ||
99 | </html> | ||
diff --git a/imports/codemirror/mode/rpm/spec/spec.css b/imports/codemirror/mode/rpm/spec/spec.css new file mode 100755 index 00000000..d0a5d430 --- /dev/null +++ b/imports/codemirror/mode/rpm/spec/spec.css | |||
@@ -0,0 +1,5 @@ | |||
1 | .cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;} | ||
2 | .cm-s-default span.cm-macro {color: #b218b2;} | ||
3 | .cm-s-default span.cm-section {color: green; font-weight: bold;} | ||
4 | .cm-s-default span.cm-script {color: red;} | ||
5 | .cm-s-default span.cm-issue {color: yellow;} | ||
diff --git a/imports/codemirror/mode/rpm/spec/spec.js b/imports/codemirror/mode/rpm/spec/spec.js new file mode 100755 index 00000000..3b5c08c9 --- /dev/null +++ b/imports/codemirror/mode/rpm/spec/spec.js | |||
@@ -0,0 +1,66 @@ | |||
1 | // Quick and dirty spec file highlighting | ||
2 | |||
3 | CodeMirror.defineMode("spec", function(config, modeConfig) { | ||
4 | var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; | ||
5 | |||
6 | var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; | ||
7 | var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preun|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; | ||
8 | var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros | ||
9 | var control_flow_simple = /^%(else|endif)/; // rpm control flow macros | ||
10 | var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros | ||
11 | |||
12 | return { | ||
13 | startState: function () { | ||
14 | return { | ||
15 | controlFlow: false, | ||
16 | macroParameters: false, | ||
17 | section: false, | ||
18 | }; | ||
19 | }, | ||
20 | token: function (stream, state) { | ||
21 | var ch = stream.peek(); | ||
22 | if (ch == "#") { stream.skipToEnd(); return "comment"; } | ||
23 | |||
24 | if (stream.sol()) { | ||
25 | if (stream.match(preamble)) { return "preamble"; } | ||
26 | if (stream.match(section)) { return "section"; } | ||
27 | } | ||
28 | |||
29 | if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' | ||
30 | if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' | ||
31 | |||
32 | if (stream.match(control_flow_simple)) { return "keyword"; } | ||
33 | if (stream.match(control_flow_complex)) { | ||
34 | state.controlFlow = true; | ||
35 | return "keyword"; | ||
36 | } | ||
37 | if (state.controlFlow) { | ||