From 1ee27b573992d67f4368f22c24b318309d1ed0f8 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sat, 28 Jan 2017 17:57:14 -0500 Subject: [PATCH] Cabalize --- .gitignore | 2 ++ COPYING | 2 +- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ README | 1 + Setup.hs | 3 +++ cheogram.cabal | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README create mode 100644 Setup.hs create mode 100644 cheogram.cabal diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a11f625 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist/ +report.html diff --git a/COPYING b/COPYING index 79cb837..77aa742 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright © 2015, Stephen Paul Weber +Copyright © 2015-2017, Stephen Paul Weber Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e719fe3 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +GHCFLAGS=-Wall -fno-warn-name-shadowing -XHaskell2010 -O2 +HLINTFLAGS=-XHaskell98 -XCPP -i 'Use camelCase' -i 'Use String' -i 'Use head' -i 'Use string literal' -i 'Use list comprehension' --utf8 +VERSION=0.6 + +.PHONY: all shell clean doc install + +all: report.html doc dist/build/libHScheogram-$(VERSION).a dist/cheogram-$(VERSION).tar.gz + +install: dist/build/libHScheogram-$(VERSION).a + cabal install + +shell: + ghci $(GHCFLAGS) + +report.html: Main.hs + -hlint $(HLINTFLAGS) --report $^ + +doc: dist/doc/html/cheogram/index.html README + +README: cheogram.cabal + tail -n+$$(( `grep -n ^description: $^ | head -n1 | cut -d: -f1` + 1 )) $^ > .$@ + head -n+$$(( `grep -n ^$$ .$@ | head -n1 | cut -d: -f1` - 1 )) .$@ > $@ + -printf ',s/ //g\n,s/^.$$//g\n,s/\\\\\\//\\//g\nw\nq\n' | ed $@ + $(RM) .$@ + +dist/doc/html/cheogram/index.html: dist/setup-config Main.hs + cabal haddock --hyperlink-source + +dist/setup-config: cheogram.cabal + cabal configure + +clean: + find -name '*.o' -o -name '*.hi' | xargs $(RM) + $(RM) -r dist + +dist/build/libHScheogram-$(VERSION).a: dist/setup-config Main.hs + cabal build --ghc-options="$(GHCFLAGS)" + +dist/cheogram-$(VERSION).tar.gz: README dist/setup-config Main.hs + cabal check + cabal sdist diff --git a/README b/README new file mode 100644 index 0000000..643fd66 --- /dev/null +++ b/README @@ -0,0 +1 @@ +Bridge between XMPP MUC and SMS. diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..e8ef27d --- /dev/null +++ b/Setup.hs @@ -0,0 +1,3 @@ +import Distribution.Simple + +main = defaultMain diff --git a/cheogram.cabal b/cheogram.cabal new file mode 100644 index 0000000..13c0b8c --- /dev/null +++ b/cheogram.cabal @@ -0,0 +1,46 @@ +name: cheogram +version: 0.0.1 +cabal-version: >= 1.16 +license: OtherLicense +license-file: COPYING +category: Network +copyright: © 2015-2017 Stephen Paul Weber +author: Stephen Paul Weber +maintainer: Stephen Paul Weber +stability: experimental +tested-with: GHC == 7.6.3 +synopsis: Groupchat for everyone! +homepage: https://github.com/singpolyma/sgx-vitelity +bug-reports: https://github.com/singpolyma/vgx-vitelity/issues +build-type: Simple +description: + Bridge between XMPP MUC and SMS. + +extra-source-files: + README + +executable cheogram + main-is: Main.hs + default-language: Haskell2010 + + build-depends: + base == 4.*, + basic-prelude, + case-insensitive, + containers, + errors < 2.0.0, + monads-tf, + network, + network-protocol-xmpp == 0.4.8, + random, + random-shuffle, + stm, + text, + time, + tokyocabinet-haskell, + uuid, + xml-types + +source-repository head + type: git + location: git://github.com/singpolyma/sgx-vitelity.git -- 2.45.2