[Pkg-haskell-commits] [SCM] Haskell binding to libmagic branch, upstream, updated. DEBIAN_magic-haskell_1.0.7.1-5-g4856807

Joachim Breitner nomeata at debian.org
Wed Dec 2 22:26:02 UTC 2009


The following commit has been merged in the upstream branch:
commit 4856807608fe18cb7ccac12614dc2de9b2d11e35
Author: Joachim Breitner <nomeata at debian.org>
Date:   Wed Dec 2 23:21:23 2009 +0100

    Imported Upstream version 1.0.8

diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 842b6c0..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,18 +0,0 @@
-INSTALLATION INSTRUCTIONS
--------------------------
-
-Before you start, you will need to have libmagic installed.  I have tested
-this package with version 4.12; earlier versions may or may not work.
-
-libmagic is part of the "file" package and can be found at
-ftp://ftp.astron.com/pub/file/.
-
-Now, run "make setup" (you may need to edit the Makefile if you don't
-use GHC or if your GHC is at an unusual location).
-
-Then:
-
- ./setup configure
- ./setup build
- ./setup install
- 
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 180732a..0000000
--- a/Makefile
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright (C) 2004 - 2005 John Goerzen <jgoerzen at complete.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-PROJECT := magic
-
-.PHONY: all
-all: setup
-	./setup configure
-	./setup build
-
-PYTHON ?= python
-setup: Setup.lhs $(PROJECT).cabal
-	ghc -package Cabal Setup.lhs -o setup
-
-
-doc: setup
-	./setup haddock
-
-clean:
-	-./setup clean
-	-rm -rf html `find . -name "*.o"` `find . -name "*.hi"` \
-		`find . -name "*~"` *.a setup dist testsrc/runtests \
-		local-pkg
-	-cd doc && $(MAKE) clean
-
-.PHONY: local-pkg
-local-pkg: all
-	echo "[" > local-pkg
-	cat .installed-pkg-config >> local-pkg
-	echo "]" >> local-pkg
-
-testsrc/runtests: all $(shell find . -name "*.hs") \
-			$(shell find . -name "*.hsc")
-	ghc6 -O2 -o testsrc/runtests -Ldist/build -odir dist/build \
-	   -hidir dist/build -package mtl -idist/build -itestsrc \
-	   -L/usr/lib -L/usr/lib/python2.3/site-packages \
-	   -I/usr/include/python2.3 \
-		-package HUnit --make testsrc/runtests.hs \
-		dist/build/glue/glue.o dist/build/glue/excglue.o -lpython2.3
-
-# dist/build/libHSMissingPy-*
-test-ghc6: testsrc/runtests
-	testsrc/runtests 
-
-test-hugs:
-	runhugs -98 +o -P$(PWD)/libsrc:$(PWD)/testsrc: testsrc/runtests.hs
-
-interact-hugs:
-	hugs -98 +o -Pdist/build:
-
-interact-ghci: all
-	ghci -fallow-overlapping-instances -fallow-undecidable-instances -fglasgow-exts -ilibsrc
-
-interact: interact-hugs
-
-test: test-ghc6
-
-genexceptions:
-	runhugs genexceptions.hs
-
-data:
-	runhugs utils/genconsts.hs > Magic/Data.hsc
-
diff --git a/README b/README
deleted file mode 100644
index a0d6361..0000000
--- a/README
+++ /dev/null
@@ -1,53 +0,0 @@
--------------------------
-What is magic-haskell?
--------------------------
-
-It is a binding to the C libmagic library.  It allows you to determine
-the type of a file not by looking at its name or extension, but rather
-by examining the contents itself.
-
-libmagic can provide either a textual description or a MIME content
-type (and, occasionally, also a character set.)
-
-The Haskell binding can also provide reports over Haskell strings.
-
--------------------------
-Quick Start
--------------------------
-
-See the file INSTALL.
-
--------------------------
-Usage in programs
--------------------------
-
-You can simply use -package magic in ghc to enable
-this library.  
-
-The API docs can be built with "make doc", or you can find them at:
-
-http://quux.org/devel/magic-haskell
-
--------------------------
-Author & Homepage
--------------------------
-
-magic-haskell was written by John Goerzen <jgoerzen at complete.org>.
-
-The latest version may be obtained at:
-
-   gopher://quux.org/1/devel/magic-haskell
-
-or:
-
-   http://quux.org/devel/magic-haskell
-
-Documentation is also available on that page.
-
-You can also obtain the darcs tree with:
-
-   darcs get --partial http://darcs.complete.org/magic-haskell
-
-This program is copyrighted.
-See the COPYRIGHT and COPYING files for more details.
-
diff --git a/testsrc/Inittest.hs b/testsrc/Inittest.hs
deleted file mode 100644
index 8eaaeb1..0000000
--- a/testsrc/Inittest.hs
+++ /dev/null
@@ -1,15 +0,0 @@
-{-
-Copyright (C) 2005 John Goerzen <jgoerzen at complete.org>
-
-This code is under a 3-clause BSD license; see COPYING for details.
--}
-
-module Inittest(tests) where
-import Test.HUnit
-import Magic
-
-test_base =
-    let f 
-
-
-tests = [
\ No newline at end of file
diff --git a/testsrc/Tests.hs b/testsrc/Tests.hs
deleted file mode 100644
index 445d043..0000000
--- a/testsrc/Tests.hs
+++ /dev/null
@@ -1,18 +0,0 @@
-{- arch-tag: Tests main file
-Copyright (C) 2005 John Goerzen <jgoerzen at complete.org>
-
-This code is under a 3-clause BSD license; see COPYING for details.
--}
-
-module Tests(tests) where
-import Test.HUnit
-import qualified Inittest
-
-test1 = TestCase ("x" @=? "x")
-
-tests = TestList [TestLabel "test1" test1,
-                  TestLabel "init" Inittest.tests
-                 ]
-
-
-
diff --git a/testsrc/runtests.hs b/testsrc/runtests.hs
deleted file mode 100644
index 4d8151e..0000000
--- a/testsrc/runtests.hs
+++ /dev/null
@@ -1,11 +0,0 @@
-{- arch-tag: Test runner
-Copyright (C) 2005 John Goerzen <jgoerzen at complete.org>
--}
-
-module Main where 
-
-import Test.HUnit
-import Tests
-
-main = runTestTT tests
-
diff --git a/utils/genconsts.hs b/utils/genconsts.hs
deleted file mode 100644
index b1ebbcd..0000000
--- a/utils/genconsts.hs
+++ /dev/null
@@ -1,66 +0,0 @@
-{- -*- Mode: haskell; -*-
-Haskell Magic Interface
-Copyright (C) 2005 John Goerzen <jgoerzen at complete.org>
-
-This code is under a 3-clause BSD license; see COPYING for details.
--}
-
-import Data.Char
-import Data.List
-
-const2HS (x:xs) =
-    x : c2hs xs
-    where c2hs [] = []
-          c2hs ('_':x:xs) = x : c2hs xs
-          c2hs (x:xs) = toLower x : c2hs xs
-
-getC const = "#{const " ++ const ++ "}"
-
-errorClause name consts =
-    "data " ++ name ++ " =\n   " ++
-    concat (intersperse "\n | " (map toDecl consts)) ++
-    "\n | Unknown" ++ name ++ " Int\n" ++
-    "\n deriving (Show)" ++
-    "\n\ninstance Enum " ++ name ++ " where\n" ++
-    concat (intersperse "\n" (map toenums consts)) ++
-    "\n toEnum x = Unknown" ++ name ++ " x\n" ++
-    "\n" ++ concat (intersperse "\n" (map fromenums consts)) ++
-    "\n fromEnum (Unknown" ++ name ++ " x) = x\n" ++
-    "\ninstance Ord " ++ name ++ " where\n" ++
-    " compare x y = compare (fromEnum x) (fromEnum y)\n\n" ++
-    "instance Eq " ++ name ++ " where\n" ++
-    " x == y = (fromEnum x) == (fromEnum y)\n\n"
-    where
-    toDecl = const2HS
-    toenums i = 
-        " toEnum (" ++ getC i ++ ") = " ++ (const2HS i)
-    fromenums i = 
-        " fromEnum " ++ (const2HS i) ++ " = (" ++ getC i ++ ")"
-
-modHeader = 
- "-- AUTO-GENERATED FILE, DO NOT EDIT.  GENERATED BY utils/genconsts.hs\n" ++
- "{- |\n" ++
- "   Module     : Magic.Data\n" ++
- "   Copyright  : Copyright (C) 2005 John Goerzen\n" ++
- "   License    : BSD\n" ++
- "\n" ++
- "   Maintainer : John Goerzen,\n" ++
- "   Maintainer : jgoerzen at complete.org\n" ++
- "   Stability  : provisional\n" ++
- "   Portability: portable\n" ++
- "\n" ++
- "Haskell types for libmagic constants\n" ++
- "\n" ++
- "Written by John Goerzen, jgoerzen\\@complete.org\n" ++
- "-}\n\n" ++
- "module Magic.Data (module Magic.Data) where\n" ++
- "\n#include \"magic.h\"\n\n"
-
-main = 
-    do putStrLn modHeader
-       putStrLn (errorClause "MagicFlag" magicFlags)
-
-magicFlags = ["MAGIC_NONE", "MAGIC_DEBUG", "MAGIC_SYMLINK",
-              "MAGIC_COMPRESS", "MAGIC_DEVICES", "MAGIC_MIME",
-              "MAGIC_CONTINUE", "MAGIC_CHECK",
-              "MAGIC_PRESERVE_ATIME", "MAGIC_RAW", "MAGIC_ERROR"]

-- 
Haskell binding to libmagic



More information about the Pkg-haskell-commits mailing list