From a54dbe1d21ba44b2ff108182be809c3096d918d7 Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov <nikita@karetnikov.org>
Date: Fri, 21 Jun 2013 19:31:28 +0000
Subject: [PATCH] Add 'Flag Devel' to 'tordnsel.cabal', and update its layout.

---
 tordnsel.cabal |  159 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 88 insertions(+), 71 deletions(-)

diff --git a/tordnsel.cabal b/tordnsel.cabal
index 243e026..09a273e 100644
--- a/tordnsel.cabal
+++ b/tordnsel.cabal
@@ -1,74 +1,91 @@
-Name:            TorDNSEL
-Version:         0.1.1-dev
-Synopsis:        provides a DNSBL-style interface for detecting Tor exit nodes
-Description:     TorDNSEL implements a design for a DNSBL-style interface for
-  detecting connections exiting the Tor network. This design and its rationale
-  is described at <https://gitweb.torproject.org/tordnsel.git/blob/HEAD:/doc/torel-design.txt>.
-License:         PublicDomain
-License-File:    LICENSE
-Homepage:        http://p56soo2ibjkx23xo.onion/
-Package-URL: https://archive.torproject.org/tor-package-archive/tordnsel/tordnsel-0.1.1.tar.gz
-Author:          tup
-Maintainer:      tup.tuple@googlemail.com, lunar@debian.org, andrew@torproject.org
-Build-Type:      Simple
-Build-Depends:   base>=2.0, network>=2.0, mtl>=1.0, unix>=1.0, stm>=2.0,
-  time>=1.0, HUnit>=1.1, binary>=0.4, bytestring>=0.9, array>=0.1, directory>=1.0,
-  containers>=0.1
-Tested-With:     GHC==6.6, GHC==6.8, GHC==6.10, GHC==6.12
-Data-Files:      config/tordnsel.conf.sample, contrib/cacti-input.pl,
+Name:          TorDNSEL
+Version:       0.1.1-dev
+Cabal-Version: >= 1.2
+Synopsis:      DNSBL-style interface for detecting Tor exit nodes
+Description:   TorDNSEL implements a design for a DNSBL-style interface
+  for detecting connections exiting the Tor network.  This design and
+  its rationale are described at
+  <https://gitweb.torproject.org/tordnsel.git/blob/HEAD:/doc/torel-design.txt>.
+License:       PublicDomain
+License-File:  LICENSE
+Homepage:      http://p56soo2ibjkx23xo.onion/
+Package-URL:   https://archive.torproject.org/tor-package-archive/tordnsel/tordnsel-0.1.1.tar.gz
+Author:        tup
+Maintainer:    tup.tuple@googlemail.com, lunar@debian.org, andrew@torproject.org
+Build-Type:    Simple
+Tested-With:   GHC==6.6, GHC==6.8, GHC==6.10, GHC==6.12
+Data-Files:    config/tordnsel.conf.sample, contrib/cacti-input.pl,
   contrib/tordnsel-init.d-script.sample, doc/tordnsel.8
 
-Executable:      tordnsel
-Main-Is:         tordnsel.hs
-Other-Modules:   TorDNSEL.Config,
-                 TorDNSEL.Config.Internals,
-                 TorDNSEL.Control.Concurrent.Link,
-                 TorDNSEL.Control.Concurrent.Link.Internals,
-                 TorDNSEL.Control.Concurrent.Util,
-                 TorDNSEL.DeepSeq,
-                 TorDNSEL.Directory,
-                 TorDNSEL.Directory.Internals,
-                 TorDNSEL.DistinctQueue,
-                 TorDNSEL.DNS,
-                 TorDNSEL.DNS.Internals,
-                 TorDNSEL.DNS.Server,
-                 TorDNSEL.DNS.Server.Internals,
-                 TorDNSEL.Document,
-                 TorDNSEL.ExitTest.Initiator,
-                 TorDNSEL.ExitTest.Initiator.Internals,
-                 TorDNSEL.ExitTest.Request,
-                 TorDNSEL.ExitTest.Server,
-                 TorDNSEL.ExitTest.Server.Internals,
-                 TorDNSEL.Log,
-                 TorDNSEL.Log.Internals,
-                 TorDNSEL.Main,
-                 TorDNSEL.NetworkState,
-                 TorDNSEL.NetworkState.Internals,
-                 TorDNSEL.NetworkState.Storage,
-                 TorDNSEL.NetworkState.Storage.Internals,
-                 TorDNSEL.NetworkState.Types,
-                 TorDNSEL.Random,
-                 TorDNSEL.Socks,
-                 TorDNSEL.Socks.Internals,
-                 TorDNSEL.Statistics,
-                 TorDNSEL.Statistics.Internals,
-                 TorDNSEL.System.Timeout,
-                 TorDNSEL.TorControl,
-                 TorDNSEL.TorControl.Internals,
-                 TorDNSEL.Util
-HS-Source-Dirs:  src
-Includes:        sys/types.h, unistd.h, sysexits.h, netinet/in.h, openssl/rand.h
-Extra-Libraries: crypto
-GHC-Options:     -O2 -Wall -Werror -DVERSION="0.1.1-dev"
+Flag Devel
+  Description: Enable almost all warnings, and make them fatal
+  Default:     False
 
-Executable:      runtests
-Buildable:       False
-Main-Is:         runtests.hs
-Other-Modules:   TorDNSEL.Config.Tests,
-                 TorDNSEL.Directory.Tests,
-                 TorDNSEL.DNS.Tests,
-                 TorDNSEL.DNS.Server.Tests
-HS-Source-Dirs:  src
-Includes:        netinet/in.h, openssl/rand.h
-Extra-Libraries: crypto
-GHC-Options:     -fasm -Wall -Werror -fno-warn-missing-signatures
+Executable         tordnsel
+  Build-Depends:   base>=2.0, network>=2.0, mtl>=1.0, unix>=1.0, stm>=2.0,
+    time>=1.0, binary>=0.4, bytestring>=0.9, array>=0.1,
+    directory>=1.0, containers>=0.1
+  Main-Is:         tordnsel.hs
+  Other-Modules:   TorDNSEL.Config,
+                   TorDNSEL.Config.Internals,
+                   TorDNSEL.Control.Concurrent.Link,
+                   TorDNSEL.Control.Concurrent.Link.Internals,
+                   TorDNSEL.Control.Concurrent.Util,
+                   TorDNSEL.DeepSeq,
+                   TorDNSEL.Directory,
+                   TorDNSEL.Directory.Internals,
+                   TorDNSEL.DistinctQueue,
+                   TorDNSEL.DNS,
+                   TorDNSEL.DNS.Internals,
+                   TorDNSEL.DNS.Server,
+                   TorDNSEL.DNS.Server.Internals,
+                   TorDNSEL.Document,
+                   TorDNSEL.ExitTest.Initiator,
+                   TorDNSEL.ExitTest.Initiator.Internals,
+                   TorDNSEL.ExitTest.Request,
+                   TorDNSEL.ExitTest.Server,
+                   TorDNSEL.ExitTest.Server.Internals,
+                   TorDNSEL.Log,
+                   TorDNSEL.Log.Internals,
+                   TorDNSEL.Main,
+                   TorDNSEL.NetworkState,
+                   TorDNSEL.NetworkState.Internals,
+                   TorDNSEL.NetworkState.Storage,
+                   TorDNSEL.NetworkState.Storage.Internals,
+                   TorDNSEL.NetworkState.Types,
+                   TorDNSEL.Random,
+                   TorDNSEL.Socks,
+                   TorDNSEL.Socks.Internals,
+                   TorDNSEL.Statistics,
+                   TorDNSEL.Statistics.Internals,
+                   TorDNSEL.System.Timeout,
+                   TorDNSEL.TorControl,
+                   TorDNSEL.TorControl.Internals,
+                   TorDNSEL.Util
+  HS-Source-Dirs:  src
+  Includes:        sys/types.h, unistd.h, sysexits.h, netinet/in.h,
+    openssl/rand.h
+  Extra-Libraries: crypto
+  cpp-options:     -DVERSION="0.1.1-dev"
+
+  if flag(devel)
+    GHC-Options: -O2 -Wall -Werror
+  else
+    GHC-Options: -O2
+
+Executable         runtests
+  Build-Depends:   HUnit>=1.1
+  Buildable:       False
+  Main-Is:         runtests.hs
+  Other-Modules:   TorDNSEL.Config.Tests,
+                   TorDNSEL.Directory.Tests,
+                   TorDNSEL.DNS.Tests,
+                   TorDNSEL.DNS.Server.Tests
+  HS-Source-Dirs:  src
+  Includes:        netinet/in.h, openssl/rand.h
+  Extra-Libraries: crypto
+
+  if flag(devel)
+    GHC-Options: -fasm -Wall -Werror
+  else
+    GHC-Options: -fasm -fno-warn-missing-signatures
-- 
1.7.5.4

