1 | #!/bin/sh |
---|
2 | #| ;;;; egg-template.scm -*- Scheme -*- |
---|
3 | exec csi -s $0 "$@" |
---|
4 | |# |
---|
5 | |
---|
6 | (use utils posix) |
---|
7 | |
---|
8 | |
---|
9 | (define *eggname* |
---|
10 | (match (command-line-arguments) |
---|
11 | ((name) name) ) ) |
---|
12 | |
---|
13 | |
---|
14 | (unless (file-exists? *eggname*) |
---|
15 | (create-directory *eggname*) ) |
---|
16 | |
---|
17 | (current-directory *eggname*) |
---|
18 | |
---|
19 | (current-output-port (open-output-file "doc.scm")) |
---|
20 | |
---|
21 | (print #<#EOF |
---|
22 | ;;;; doc.scm -*- Scheme -*- |
---|
23 | |
---|
24 | (use eggdoc) |
---|
25 | |
---|
26 | (define license |
---|
27 | "Copyright (c) 2006, %%AUTHOR%%. All rights reserved. |
---|
28 | |
---|
29 | Permission is hereby granted, free of charge, to any person obtaining a |
---|
30 | copy of this software and associated documentation files (the Software), |
---|
31 | to deal in the Software without restriction, including without limitation |
---|
32 | the rights to use, copy, modify, merge, publish, distribute, sublicense, |
---|
33 | and/or sell copies of the Software, and to permit persons to whom the |
---|
34 | Software is furnished to do so, subject to the following conditions: |
---|
35 | |
---|
36 | The above copyright notice and this permission notice shall be included |
---|
37 | in all copies or substantial portions of the Software. |
---|
38 | |
---|
39 | THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
40 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
41 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
---|
42 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
---|
43 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
---|
44 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
---|
45 | OTHER DEALINGS IN THE SOFTWARE.") |
---|
46 | |
---|
47 | (define doc |
---|
48 | `((eggdoc:begin |
---|
49 | (name "#{*eggname*}") |
---|
50 | (description (p "%%DESCRIPTION%%")) |
---|
51 | |
---|
52 | (author "%%AUTHOR%%") |
---|
53 | |
---|
54 | (history |
---|
55 | (version "1.0" "Initial release")) |
---|
56 | |
---|
57 | (requires |
---|
58 | (url "%%URL%%" "%%EGGNAME%") ...) |
---|
59 | |
---|
60 | (usage) |
---|
61 | (download "%%FILE%%") |
---|
62 | |
---|
63 | (documentation |
---|
64 | (p "%%TEXT%%") |
---|
65 | |
---|
66 | (group |
---|
67 | (procedure "(%%PROCNAME%% ...)" |
---|
68 | (p "%%PROCDOC%%") ) |
---|
69 | |
---|
70 | (examples |
---|
71 | (p "%%EXAMPLES%%") ) |
---|
72 | (section "License" (pre ,license)))))) |
---|
73 | |
---|
74 | (eggdoc->html doc) |
---|
75 | |
---|
76 | EOF |
---|
77 | ) |
---|
78 | |
---|
79 | (close-output-port (current-output-port)) |
---|
80 | (current-output-port (open-output-file (make-pathname #f *eggname* "meta"))) |
---|
81 | |
---|
82 | (print #<#EOF |
---|
83 | ;;; #{*eggname*}.meta -*- Scheme -*- |
---|
84 | |
---|
85 | ( |
---|
86 | (egg "#{*eggname*}.egg") |
---|
87 | (synopsis "%%SYNOPSIS%%") |
---|
88 | ;(needs %%EGGNAME%% ...) |
---|
89 | (category web) |
---|
90 | (license "BSD") |
---|
91 | (author "%%AUTHOR%%") |
---|
92 | (files "#{*eggname*}.setup" "#{*eggname*}.scm" "#{*eggname*}.html") |
---|
93 | ) |
---|
94 | |
---|
95 | |
---|
96 | EOF |
---|
97 | ) |
---|