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