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