]> gitweb.michael.orlitzky.com - hath.git/blob - hath.cabal
Add category: Utils to cabal file.
[hath.git] / hath.cabal
1 name: hath
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 synopsis:
11 Hath manipulates network blocks in CIDR notation.
12 description:
13 Hath is a Haskell program for working with network blocks in CIDR
14 notation. When dealing with blocks of network addresses, there are a
15 few things that one usually wants to do with them:
16 .
17 * Create a regular expression matching the CIDR block(s). This is
18 because grep will throw up if you feed it CIDR.
19 .
20 * Combine small blocks into larger ones. For example, if you have two
21 consecutive \/24s, they might combine into a larger \/23.
22 .
23 * View the result of block combination in a useful way.
24 .
25 Hath has four modes to perform these functions:
26 .
27 [@Regexed@]
28 This computes a (Perl-compatible) regular expression matching
29 the input CIDR blocks. It's the default mode of operation.
30 .
31 [@Reduced@]
32 This combines small blocks into larger ones where possible, and
33 eliminates redundant blocks. The output should be equivalent to
34 the input, though.
35 .
36 [@Duped@]
37 Shows only the blocks that would be removed by reduce; that is, it
38 shows the ones that would get combined into larger blocks or are
39 simply redundant.
40 .
41 [@Diffed@]
42 Shows what would change if you used reduce. Uses diff-like
43 notation.
44 .
45 /Examples/:
46 .
47 Combine two \/24s into a \/23:
48 .
49 @
50 $ hath reduced <<< \"10.0.0.0\/24 10.0.1.0\/24\"
51 10.0.0.0/23
52 @
53 .
54 Create a perl-compatible regex to be fed to grep:
55 .
56 @
57 $ grep -P `hath regexed -i cidrs.txt` mail.log
58 @
59
60 executable hath
61 build-depends:
62 base == 4.*,
63 HUnit == 1.2.*,
64 QuickCheck == 2.6.*,
65 MissingH == 1.2.*,
66 split == 0.2.*,
67 test-framework == 0.8.*,
68 test-framework-hunit == 0.3.*,
69 test-framework-quickcheck2 == 0.3.*
70
71 main-is:
72 Main.hs
73
74 hs-source-dirs:
75 src/
76
77 ghc-options:
78 -Wall
79 -fwarn-hi-shadowing
80 -fwarn-missing-signatures
81 -fwarn-name-shadowing
82 -fwarn-orphans
83 -fwarn-type-defaults
84 -fwarn-tabs
85 -fwarn-incomplete-record-updates
86 -fwarn-monomorphism-restriction
87 -fwarn-unused-do-bind
88 -rtsopts
89 -threaded
90 -optc-O3
91 -optc-march=native
92 -O2
93
94 ghc-prof-options:
95 -prof
96 -auto-all
97 -caf-all
98
99
100 test-suite testsuite
101 type: exitcode-stdio-1.0
102 hs-source-dirs: src test
103 main-is: TestSuite.hs
104 build-depends:
105 base == 4.*,
106 HUnit == 1.2.*,
107 QuickCheck == 2.6.*,
108 MissingH == 1.2.*,
109 split == 0.2.*,
110 test-framework == 0.8.*,
111 test-framework-hunit == 0.3.*,
112 test-framework-quickcheck2 == 0.3.*
113
114 -- It's not entirely clear to me why I have to reproduce all of this.
115 ghc-options:
116 -Wall
117 -fwarn-hi-shadowing
118 -fwarn-missing-signatures
119 -fwarn-name-shadowing
120 -fwarn-orphans
121 -fwarn-type-defaults
122 -fwarn-tabs
123 -fwarn-incomplete-record-updates
124 -fwarn-monomorphism-restriction
125 -fwarn-unused-do-bind
126 -rtsopts
127 -threaded
128 -optc-O3
129 -optc-march=native
130 -O2
131
132 source-repository head
133 type: git
134 location: http://michael.orlitzky.com/git/hath.git
135 branch: master