]> gitweb.michael.orlitzky.com - hath.git/blob - hath.cabal
Bump to v0.4.2 in the cabal file for the base dependency change.
[hath.git] / hath.cabal
1 name: hath
2 version: 0.4.2
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 homepage: http://michael.orlitzky.com/code/hath.xhtml
7 category: Utils
8 license: AGPL-3
9 license-file: doc/LICENSE
10 build-type: Simple
11 extra-source-files:
12 doc/man1/hath.1
13 test/shell/*.test
14 synopsis:
15 Hath manipulates network blocks in CIDR notation.
16 description:
17 Hath is a Haskell program for working with network blocks in CIDR
18 notation. When dealing with blocks of network addresses, there are a
19 few things that one usually wants to do with them:
20 .
21 * Create a regular expression matching the CIDR block(s). This is
22 because grep will throw up if you feed it CIDR.
23 .
24 * Combine small blocks into larger ones. For example, if you have two
25 consecutive \/24s, they might combine into a larger \/23.
26 .
27 * View the result of block combination in a useful way.
28 .
29 * List them.
30 .
31 Hath has several modes to perform these functions:
32 .
33 [@Regexed@]
34 This computes a (Perl-compatible) regular expression matching
35 the input CIDR blocks. It's the default mode of operation.
36 .
37 [@Reduced@]
38 This combines small blocks into larger ones where possible, and
39 eliminates redundant blocks. The output should be equivalent to
40 the input, though.
41 .
42 [@Duped@]
43 Shows only the blocks that would be removed by reduce; that is, it
44 shows the ones that would get combined into larger blocks or are
45 simply redundant.
46 .
47 [@Diffed@]
48 Shows what would change if you used reduce. Uses diff-like
49 notation.
50 .
51 [@Listed@]
52 List the IP addresses contained within the given CIDRs.
53 .
54 /Examples/:
55 .
56 Compute a (Perl-compatible) regular expression matching
57 the input CIDR blocks. It's the default mode of operation.
58 .
59 @
60 $ echo \"10.0.0.0\/29 10.0.0.8\/29\" | hath
61 ((10)\.(0)\.(0)\.(15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0))
62 @
63 .
64 Combine two \/24s into a \/23:
65 .
66 @
67 $ echo \"10.0.0.0\/24 10.0.1.0\/24\" | hath reduced
68 10.0.0.0/23
69 @
70 .
71 List the addresses in 192.168.0.240\/29:
72 .
73 @
74 $ echo 192.168.0.240\/29 | hath listed
75 192.168.0.240
76 192.168.0.241
77 192.168.0.242
78 192.168.0.243
79 192.168.0.244
80 192.168.0.245
81 192.168.0.246
82 192.168.0.247
83 @
84 .
85 The command-line syntax and complete set of options are documented in
86 the man page.
87
88
89 executable hath
90
91 main-is:
92 Main.hs
93
94 hs-source-dirs:
95 src/
96
97 other-modules:
98 Bit
99 Cidr
100 CommandLine
101 ExitCodes
102 IPv4Address
103 Maskable
104 Maskbits
105 Octet
106
107 build-depends:
108 base >= 4.9 && < 5,
109 cmdargs >= 0.10,
110 split >= 0.2,
111 tasty >= 0.8,
112 tasty-hunit >= 0.8,
113 tasty-quickcheck >= 0.8.1
114
115 ghc-options:
116 -Weverything
117 -Wno-implicit-prelude
118 -Wno-safe
119 -Wno-unsafe
120 -Wno-all-missed-specialisations
121 -rtsopts
122 -threaded
123 -optc-O3
124 -optc-march=native
125 -O2
126
127
128 test-suite testsuite
129 type: exitcode-stdio-1.0
130 hs-source-dirs: src test
131 main-is: TestSuite.hs
132
133 build-depends:
134 base == 4.*,
135 cmdargs >= 0.10,
136 split >= 0.2,
137 tasty >= 0.8,
138 tasty-hunit >= 0.8,
139 tasty-quickcheck >= 0.8.1
140
141
142 -- It's not entirely clear to me why I have to reproduce all of this.
143 ghc-options:
144 -Weverything
145 -Wno-implicit-prelude
146 -Wno-safe
147 -Wno-unsafe
148 -Wno-all-missed-specialisations
149 -rtsopts
150 -threaded
151 -optc-O3
152 -optc-march=native
153 -O2
154
155
156 -- These won't work without shelltestrunner installed in your
157 -- $PATH. Maybe there is some way to tell Cabal that.
158 test-suite shelltests
159 type: exitcode-stdio-1.0
160 hs-source-dirs: test
161 main-is: ShellTests.hs
162
163 build-depends:
164 base == 4.*,
165 cmdargs >= 0.10,
166 process >= 1.1,
167 split >= 0.2,
168 tasty >= 0.8,
169 tasty-hunit >= 0.8,
170 tasty-quickcheck >= 0.8.1
171
172 -- It's not entirely clear to me why I have to reproduce all of this.
173 ghc-options:
174 -Wall
175 -fwarn-hi-shadowing
176 -fwarn-missing-signatures
177 -fwarn-name-shadowing
178 -fwarn-orphans
179 -fwarn-type-defaults
180 -fwarn-tabs
181 -fwarn-incomplete-record-updates
182 -fwarn-monomorphism-restriction
183 -fwarn-unused-do-bind
184 -rtsopts
185 -threaded
186 -optc-O3
187 -optc-march=native
188 -O2
189
190 source-repository head
191 type: git
192 location: http://gitweb.michael.orlitzky.com/hath.git
193 branch: master