]> gitweb.michael.orlitzky.com - dead/htsn.git/blob - htsn.cabal
Add more cabal description.
[dead/htsn.git] / htsn.cabal
1 name: htsn
2 version: 0.0.1
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 category: Utils
7 license: GPL-3
8 license-file: doc/LICENSE
9 build-type: Simple
10 extra-source-files:
11 doc/man1/htsn.1 test/xml/*.xml
12 synopsis:
13 Parse XML files from The Sports Network feed.
14 description:
15 /Usage/:
16 .
17 @
18 htsn [OPTIONS] [HOSTNAMES]
19 @
20 .
21 The Sports Network <http://www.sportsnetwork.com/> offers an XML feed
22 containing various sports news and statistics. The goal of /htsn/
23 is to watch the XML feed and parse the individual XML documents into
24 files.
25 .
26 Once started, we will choose an XML feed host to connect to. The
27 choice is made from a list in a round-robin fashion, and by default,
28 the list contains all known TSN feed hosts. Once we have a connection,
29 your username and password are sent. If they are accepted, we begin to
30 parse the feed saving all XML files to the configured output directory
31 (see @--output-directory@).
32 .
33 If we encounter an error (say, the connection is dropped), then we
34 will attempt to connect to the next host in the list after waiting
35 five seconds. This process continues indefinitely.
36 .
37 The program can run either interactively (that is, outputting to the
38 console), or as a daemon with the @--daemonize@ flag.
39 .
40 /Input/:
41 .
42 The program takes no input; a username and password must be supplied
43 on the command-line or in a configuration file.
44 .
45 /Output/:
46 .
47 Output is not generated when running as a daemon; otherwise, standard
48 out and standard error are fairly noisy. All traffic between /htsn/ and
49 the feed server is displayed on stdout. Status messages are
50 interspersed when they are generated with warnings and errors going to
51 stderr. The following can be expected:
52 .
53 * The only data we send to the feed are the username and password.
54 These will be highlighted in green on stdout.
55 .
56 * All data received from the feed will be echoed in the default color
57 to stdout.
58 .
59 * Informational messages will be highlighted in cyan and sent to stdout.
60 .
61 * Warnings will be highlighted in yellow and sent to stderr.
62 .
63 * Errors will be highlighted in red and sent to stderr.
64 .
65 /Logging/:
66 .
67 Logging is done either to syslog or a file. The destination and
68 verbosity are controlled by the @--log-file@, @--log-level@,
69 and @--syslog@ parameters which may be specified either on the command
70 line or in the configuration file.
71 .
72 /Options/:
73 .
74 @
75 \--daemonize, -d
76 @
77 .
78 Run as a daemon, in the background. When running as a daemon the
79 \--pidfile, --run-as-group, and --run-as-user flags become relevant.
80 .
81 Default: disabled
82 .
83 @
84 \--log-file
85 @
86 .
87 If you specify a file here, logs will be written to it (possibly in
88 addition to syslog). Can be either a relative or absolute path. It
89 will not be auto-rotated; use something log logrotate for that.
90 .
91 Default: none
92 .
93 @
94 \--log-level
95 @
96 .
97 How verbose should the logs be? We log notifications at three levels:
98 INFO, WARN, and ERROR. Specify the "most boring" level of
99 notifications you would like to receive (in all-caps); more
100 interesting notifications will be logged as well.
101 .
102 Default: INFO
103 .
104 @
105 \--output-directory, -o
106 @
107 .
108 To which directory should we write the XML files?
109 .
110 Default: .
111 .
112 @
113 \--password
114 @
115 .
116 The password associated with your TSN username. A password is
117 required, so you must supply one either on the command line or in a
118 configuration file.
119 .
120 Default: none
121 .
122 @
123 \--pidfile
124 @
125 .
126 (Daemon mode only) Create a PID file in the given location. This is
127 used by the init system on Unix to keep track of the running daemon.
128 .
129 Default: \/run\/htsn.pid
130 .
131 @
132 \--run-as-group
133 @
134 .
135 (Daemon mode only) Run as the given system group. The PID file is
136 written before privileges are dropped, so the only privileges needed
137 by /htsn/ are those necessary to write the XML files and (optionally)
138 the log file.
139 .
140 Default: the current group
141 .
142 @
143 \--run-as-user
144 @
145 .
146 (Daemon mode only) Run as the given system user. The PID file is
147 written before privileges are dropped, so the only privileges needed
148 by /htsn/ are those necessary to write the XML files and (optionally)
149 the log file.
150 .
151 Default: the current user
152 .
153 @
154 \--syslog, -s
155 @
156 .
157 Enable logging to syslog. On Windows this will attempt to communicate
158 (over UDP) with a syslog daemon on localhost, which will most likely
159 not work.
160 .
161 Default: disabled
162 .
163 @
164 \--username, -u
165 @
166 .
167 Your TSN username. A username is required, so you must supply one
168 either on the command line or in a configuration file.
169 .
170 Default: none
171 .
172 /Feed Hosts/:
173 .
174 It is possible to pass a list of feed hostnames on the command-line
175 (see [HOSTNAMES] in the synopsis). By default /htsn/ will attempt
176 to connect to every known TSN XML feed host in a round-robin fashion,
177 so there is rarely a need to do this.
178 .
179 /Configuration File/:
180 .
181 Any of the command-line options mentioned above can be specified in a
182 configuration file instead. We look for a file named ".htsnrc"
183 in the user's home directory; its syntax is given by examples in the
184 htsnrc.example file (included with /htsn/).
185 .
186 If you are using the @--run-as-user@ option, that means that
187 the configuration file will need to go in that user's home directory
188 (and not, for example, root's).
189 .
190 Options specified on the command-line override those in the
191 configuration file.
192
193
194 executable htsn
195 build-depends:
196 ansi-terminal == 0.6.*,
197 base == 4.*,
198 cmdargs >= 0.10.6,
199 configurator == 0.2.*,
200 directory == 1.2.*,
201 filepath == 1.3.*,
202 hdaemonize == 0.4.*,
203 hslogger == 1.2.*,
204 hxt == 9.3.*,
205 MissingH == 1.2.*,
206 network == 2.4.*,
207 tasty == 0.5.*,
208 tasty-hunit == 0.4.*,
209 transformers == 0.3.*,
210 unix == 2.6.*
211
212 main-is:
213 Main.hs
214
215 hs-source-dirs:
216 src/
217
218 other-modules:
219 CommandLine
220 Configuration
221 ExitCodes
222 Logging
223 OptionalConfiguration
224 Terminal
225 TSN.FeedHosts
226 TSN.Xml
227 Unix
228
229 ghc-options:
230 -Wall
231 -fwarn-hi-shadowing
232 -fwarn-missing-signatures
233 -fwarn-name-shadowing
234 -fwarn-orphans
235 -fwarn-type-defaults
236 -fwarn-tabs
237 -fwarn-incomplete-record-updates
238 -fwarn-monomorphism-restriction
239 -fwarn-unused-do-bind
240 -rtsopts
241 -threaded
242 -optc-O3
243 -optc-march=native
244 -O2
245
246 ghc-prof-options:
247 -prof
248 -auto-all
249 -caf-all
250
251
252
253 test-suite testsuite
254 type: exitcode-stdio-1.0
255 hs-source-dirs: src test
256 main-is: TestSuite.hs
257 build-depends:
258 ansi-terminal == 0.6.*,
259 base == 4.*,
260 cmdargs >= 0.10.6,
261 configurator == 0.2.*,
262 directory == 1.2.*,
263 filepath == 1.3.*,
264 hdaemonize == 0.4.*,
265 hslogger == 1.2.*,
266 hxt == 9.3.*,
267 MissingH == 1.2.*,
268 network == 2.4.*,
269 tasty == 0.5.*,
270 tasty-hunit == 0.4.*,
271 transformers == 0.3.*,
272 unix == 2.6.*
273
274 -- It's not entirely clear to me why I have to reproduce all of this.
275 ghc-options:
276 -Wall
277 -fwarn-hi-shadowing
278 -fwarn-missing-signatures
279 -fwarn-name-shadowing
280 -fwarn-orphans
281 -fwarn-type-defaults
282 -fwarn-tabs
283 -fwarn-incomplete-record-updates
284 -fwarn-monomorphism-restriction
285 -fwarn-unused-do-bind
286 -rtsopts
287 -threaded
288 -optc-O3
289 -optc-march=native
290 -O2
291
292
293 source-repository head
294 type: git
295 location: http://michael.orlitzky.com/git/htsn.git
296 branch: master