]> gitweb.michael.orlitzky.com - dead/htsn.git/blob - htsn.cabal
Bump the cabal version.
[dead/htsn.git] / htsn.cabal
1 name: htsn
2 version: 0.0.6
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 like 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 four levels:
101 DEBUG, 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. The debug output is
104 extremely verbose and will not be written to syslog even if you try.
105 .
106 Default: INFO
107 .
108 @
109 \--output-directory, -o
110 @
111 .
112 To which directory should we write the XML files?
113 .
114 Default: .
115 .
116 @
117 \--password
118 @
119 .
120 The password associated with your TSN username. A password is
121 required, so you must supply one either on the command line or in a
122 configuration file.
123 .
124 Default: none
125 .
126 @
127 \--pidfile
128 @
129 .
130 (Daemon mode only) Create a PID file in the given location. This is
131 used by the init system on Unix to keep track of the running daemon.
132 .
133 If necessary, its parent directory will be created with owner/group
134 set to the appropriate user/group, but at most one directory will
135 be created (that is, we won't create an entire directory tree).
136 .
137 Default: \/run\/htsn\/htsn.pid
138 .
139 @
140 \--run-as-group
141 @
142 .
143 (Daemon mode only) Run as the given system group. The PID file is
144 written before privileges are dropped, so the only privileges needed
145 by /htsn/ are those necessary to write the XML files and (optionally)
146 the log file.
147 .
148 Default: the current group
149 .
150 @
151 \--run-as-user
152 @
153 .
154 (Daemon mode only) Run as the given system user. The PID file is
155 written before privileges are dropped, so the only privileges needed
156 by /htsn/ are those necessary to write the XML files and (optionally)
157 the log file.
158 .
159 Default: the current user
160 .
161 @
162 \--syslog, -s
163 @
164 .
165 Enable logging to syslog. On Windows this will attempt to communicate
166 (over UDP) with a syslog daemon on localhost, which will most likely
167 not work.
168 .
169 Default: disabled
170 .
171 @
172 \--username, -u
173 @
174 .
175 Your TSN username. A username is required, so you must supply one
176 either on the command line or in a configuration file.
177 .
178 Default: none
179 .
180 /Feed Hosts/:
181 .
182 It is possible to pass a list of feed hostnames on the command-line
183 (see [HOSTNAMES] in the synopsis). By default /htsn/ will attempt
184 to connect to every known TSN XML feed host in a round-robin fashion,
185 so there is rarely a need to do this.
186 .
187 /Configuration File/:
188 .
189 Any of the command-line options mentioned above can be specified in a
190 configuration file instead. We first look for \"htsnrc\" in the
191 system configuration directory. We then look for a file named
192 \".htsnrc\" in the user's home directory. The latter will override
193 the former.
194 .
195 The user's home directory is simply $HOME on Unix; on Windows it's
196 wherever %APPDATA% points. The system configuration directory
197 is determined by Cabal; the /sysconfdir/ parameter during
198 the \"configure\" step is used.
199 .
200 The file's syntax is given by examples in the htsnrc.example file
201 (included with /htsn/).
202 .
203 Options specified on the command-line override those in either
204 configuration file.
205
206
207 executable htsn
208 build-depends:
209 base == 4.*,
210 cmdargs >= 0.10.6,
211 configurator == 0.2.*,
212 directory == 1.2.*,
213 filepath == 1.3.*,
214 hdaemonize == 0.4.*,
215 hslogger == 1.2.*,
216 htsn-common == 0.0.1,
217 hxt == 9.3.*,
218 MissingH == 1.2.*,
219 network == 2.4.*,
220 tasty == 0.7.*,
221 tasty-hunit == 0.4.*,
222 unix == 2.6.*
223
224 main-is:
225 Main.hs
226
227 hs-source-dirs:
228 src/
229
230 other-modules:
231 CommandLine
232 Configuration
233 ExitCodes
234 FeedHosts
235 OptionalConfiguration
236 Unix
237 Xml
238
239 ghc-options:
240 -Wall
241 -fwarn-hi-shadowing
242 -fwarn-missing-signatures
243 -fwarn-name-shadowing
244 -fwarn-orphans
245 -fwarn-type-defaults
246 -fwarn-tabs
247 -fwarn-incomplete-record-updates
248 -fwarn-monomorphism-restriction
249 -fwarn-unused-do-bind
250 -O2
251
252 ghc-prof-options:
253 -prof
254 -fprof-auto
255 -fprof-cafs
256
257
258
259 test-suite testsuite
260 type: exitcode-stdio-1.0
261 hs-source-dirs: src test
262 main-is: TestSuite.hs
263 build-depends:
264 base == 4.*,
265 cmdargs >= 0.10.6,
266 configurator == 0.2.*,
267 directory == 1.2.*,
268 filepath == 1.3.*,
269 hdaemonize == 0.4.*,
270 hslogger == 1.2.*,
271 htsn-common == 0.0.1,
272 hxt == 9.3.*,
273 MissingH == 1.2.*,
274 network == 2.4.*,
275 tasty == 0.7.*,
276 tasty-hunit == 0.4.*,
277 unix == 2.6.*
278
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 source-repository head
295 type: git
296 location: http://michael.orlitzky.com/git/htsn.git
297 branch: master