--- magic-haskell-1.0.8.orig/README +++ magic-haskell-1.0.8/README @@ -0,0 +1,53 @@ +------------------------- +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 . + +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. + --- magic-haskell-1.0.8.orig/Makefile +++ magic-haskell-1.0.8/Makefile @@ -0,0 +1,76 @@ +# Copyright (C) 2004 - 2005 John Goerzen +# +# 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 + --- magic-haskell-1.0.8.orig/INSTALL +++ magic-haskell-1.0.8/INSTALL @@ -0,0 +1,18 @@ +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 + --- magic-haskell-1.0.8.orig/testsrc/Tests.hs +++ magic-haskell-1.0.8/testsrc/Tests.hs @@ -0,0 +1,18 @@ +{- arch-tag: Tests main file +Copyright (C) 2005 John Goerzen + +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 + ] + + + --- magic-haskell-1.0.8.orig/testsrc/runtests.hs +++ magic-haskell-1.0.8/testsrc/runtests.hs @@ -0,0 +1,11 @@ +{- arch-tag: Test runner +Copyright (C) 2005 John Goerzen +-} + +module Main where + +import Test.HUnit +import Tests + +main = runTestTT tests + --- magic-haskell-1.0.8.orig/testsrc/Inittest.hs +++ magic-haskell-1.0.8/testsrc/Inittest.hs @@ -0,0 +1,15 @@ +{- +Copyright (C) 2005 John Goerzen + +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 --- magic-haskell-1.0.8.orig/utils/genconsts.hs +++ magic-haskell-1.0.8/utils/genconsts.hs @@ -0,0 +1,66 @@ +{- -*- Mode: haskell; -*- +Haskell Magic Interface +Copyright (C) 2005 John Goerzen + +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@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"] --- magic-haskell-1.0.8.orig/debian/control +++ magic-haskell-1.0.8/debian/control @@ -0,0 +1,82 @@ +Source: magic-haskell +Priority: optional +Maintainer: Debian Haskell Group +Uploaders: John Goerzen +Build-Depends: debhelper (>= 6.0.0), + cdbs, + haskell-devscripts (>= 0.7), + ghc, + ghc-prof, + libmagic-dev +Build-Depends-Indep: ghc-doc +Standards-Version: 3.9.3 +Section: haskell +Homepage: http://hackage.haskell.org/package/magic +Vcs-Git: git://git.debian.org/git/pkg-haskell/magic-haskell.git +Vcs-Browser: http://git.debian.org/?p=pkg-haskell/magic-haskell.git;a=summary + +Package: libghc-magic-dev +Section: haskell +Architecture: any +Depends: ${misc:Depends}, ${haskell:Depends}, ${shlibs:Depends}, libmagic-dev +Recommends: ${haskell:Recommends} +Suggests: ${haskell:Suggests} +Provides: ${haskell:Provides} +Description: File type determination library for Haskell + This package provides a library for the Haskell programming language. + See http://www.haskell.org/ for more information on Haskell. + . + This package provides a Haskell interface to the C libmagic library. + With it, you can determine the type of a file by examining its contents + rather than its name. The Haskell interface provides a full-featured + binding. + +Package: libghc-magic-prof +Section: haskell +Architecture: any +Depends: ${misc:Depends}, ${haskell:Depends}, ${shlibs:Depends} +Recommends: ${haskell:Recommends} +Suggests: ${haskell:Suggests} +Provides: ${haskell:Provides} +Description: File type determination library for Haskell; profiling libraries + This package provides a library for the Haskell programming language, + compiled for profiling. + See http://www.haskell.org/ for more information on Haskell. + . + This package provides a Haskell interface to the C libmagic library. + With it, you can determine the type of a file by examining its contents + rather than its name. The Haskell interface provides a full-featured + binding. + +#Package: libhugs-magic +#Section: haskell +#Architecture: any +#Depends: ${misc:Depends}, ${haskell:Depends}, ${shlibs:Depends} +#Suggests: ${haskell:Suggests} +#Description: File type determination library for Haskell +# This package provides a Haskell interface to the C libmagic library. +# With it, you can determine the type of a file by examining its contents +# rather than its name. The Haskell interface provides a full-featured +# binding. +# . +# This package is built for Hugs. A GHC package is also available +# in libghc-magic-dev. + +Package: libghc-magic-doc +Section: doc +Architecture: all +Depends: ${misc:Depends}, ${haskell:Depends} +Recommends: ${haskell:Recommends} +Suggests: ${haskell:Suggests} +Provides: magic-haskell-doc +Replaces: magic-haskell-doc (<< 1.0.8-4) +Conflicts: magic-haskell-doc (<< 1.0.8-4) +Description: File type determination library for Haskell; documentation + This package provides the documentation for a library for the Haskell + programming language. + See http://www.haskell.org/ for more information on Haskell. + . + This package provides a Haskell interface to the C libmagic library. + With it, you can determine the type of a file by examining its contents + rather than its name. The Haskell interface provides a full-featured + binding. --- magic-haskell-1.0.8.orig/debian/changelog +++ magic-haskell-1.0.8/debian/changelog @@ -0,0 +1,148 @@ +magic-haskell (1.0.8-8) unstable; urgency=low + + [ Joachim Breitner ] + * Let libghc-magic-dev depend on libmagic-dev. + + [ Clint Adams ] + * Bump to Standards-Version 3.9.3. + + -- Clint Adams Thu, 23 Feb 2012 10:41:06 -0500 + +magic-haskell (1.0.8-7) unstable; urgency=low + + * [af9511b] debian/control: ghc6 → ghc for the GHC 7 transition + * [0b97d82] d/control: Standards-Version → 3.9.2, no changes required + + -- Iain Lane Mon, 23 May 2011 14:57:53 +0100 + +magic-haskell (1.0.8-6) unstable; urgency=low + + * Reincorporate 1.0.8-4. + * debian/control: Make libghc6-magic-doc conflict with magic-haskell- + doc (<< 1.0.8-4). + * control: Bump Standards-Version to 3.9.0, no changes required. + + -- Marco Túlio Gontijo e Silva Sat, 07 Aug 2010 17:45:39 -0300 + +magic-haskell (1.0.8-5) unstable; urgency=low + + * debian/control: Make libghc6-magic-doc conflict with magic-haskell- + doc (<< 1.0.8-4). + * control: Bump Standards-Version to 3.9.0, no changes required. + + -- Marco Túlio Gontijo e Silva Fri, 06 Aug 2010 15:02:39 -0300 + +magic-haskell (1.0.8-4) unstable; urgency=low + + * debian/control: libghc6-magic-doc: Add ${haskell:Recommends} and + Suggests variables. + * debian/control: libghc6-magic-doc: Replaces, Provides and Conflicts + with magic-haskell-doc. + + -- Marco Túlio Gontijo e Silva Sun, 14 Mar 2010 17:30:59 -0300 + +magic-haskell (1.0.8-3) unstable; urgency=low + + [ Iain Lane ] + * debian/control: + + Disable hugs library as the DHG no longer supports Hugs, and it does not + work with the new Cabal. (Closes: #571360) + + Use haskell substvars and depend on haskell-devscripts >= 0.7 for + provides support + + Clean up build-deps + + Standards-Version bump to 3.8.4, no changes required + + [ Marco Túlio Gontijo e Silva ] + * debian/control: Include Haskell preface in Description:. + * debian/control: Remove mention to libhugs-magic. + * debian/control: Include -prof package. + * Rename -doc package. + * debian/control: Include Build-Depends-Indep: in ghc6-doc. + + -- Marco Túlio Gontijo e Silva Thu, 11 Mar 2010 17:57:34 -0300 + +magic-haskell (1.0.8-2) unstable; urgency=low + + * debian/rules + - Convert to hlibrary.mk (dh_haskell was removed to haskell-devscripts). + * debian/control + - Depend on haskell-devscripts >= 0.6.18. + - Move Build-Depends-Indeps to Build-Depends. + - Add hscolour to build deps. + - Standards-Version 3.8.3 + - Section haskell. + * debian/compat + - Version 5 + + -- Erik de Castro Lopo Tue, 1 Dec 2009 05:32:57 +1100 + +magic-haskell (1.0.8-1) unstable; urgency=low + + * Switched to regular non-native package. + * Removed old configure parameter. Closes: #522475. + * Switching to team maintenance. + + -- John Goerzen Wed, 19 Aug 2009 15:56:56 -0500 + +magic-haskell (1.0.7.1) unstable; urgency=high + + * Updating for new GHC. + + -- John Goerzen Mon, 19 Jan 2009 10:21:18 -0600 + +magic-haskell (1.0.7) unstable; urgency=low + + * Update for GHC 6.8. + + -- John Goerzen Wed, 16 Jan 2008 10:23:33 -0600 + +magic-haskell (1.0.6) unstable; urgency=low + + * Update for new ghc 6.6.1. Closes: #427322. + + -- John Goerzen Wed, 06 Jun 2007 04:07:41 -0500 + +magic-haskell (1.0.5) unstable; urgency=low + + * Update for GHC 6.6. + + -- John Goerzen Fri, 20 Oct 2006 09:58:03 -0500 + +magic-haskell (1.0.4) unstable; urgency=medium + + * ACK NMU -- Thanks, Luk. Closes: #379265. + * Escape @ signs in email addresses in Haddock comments. Closes: #361573. + + -- John Goerzen Mon, 4 Sep 2006 09:28:13 -0500 + +magic-haskell (1.0.3-0.1) unstable; urgency=medium + + * Non-maintainer upload. + * Update build dependency on ghc6 (Closes: #379265). + + -- Luk Claes Wed, 2 Aug 2006 23:22:43 +0200 + +magic-haskell (1.0.3) unstable; urgency=low + + * Rebuilt against ghc6 6.4.1. + + -- John Goerzen Mon, 17 Oct 2005 00:02:45 -0500 + +magic-haskell (1.0.2) unstable; urgency=low + + * Tightened up build-deps on haskell-devscripts due to a bug in that + package. Closes: #326795. + + -- John Goerzen Tue, 6 Sep 2005 10:21:09 -0500 + +magic-haskell (1.0.1) unstable; urgency=low + + * Added README to doc package. + + -- John Goerzen Tue, 16 Aug 2005 05:53:18 -0500 + +magic-haskell (1.0.0) unstable; urgency=low + + * Initial release. + + -- John Goerzen Tue, 16 Aug 2005 05:45:37 -0500 --- magic-haskell-1.0.8.orig/debian/compat +++ magic-haskell-1.0.8/debian/compat @@ -0,0 +1 @@ +6 --- magic-haskell-1.0.8.orig/debian/copyright +++ magic-haskell-1.0.8/debian/copyright @@ -0,0 +1,31 @@ +Haskell Magic Interface +Copyright (C) 2005 John Goerzen + +All code is under the following license unless otherwise noted: + +Copyright (c) 2005 John Goerzen. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of John Goerzen nor the names of contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. --- magic-haskell-1.0.8.orig/debian/libghc6-magic-doc.docs +++ magic-haskell-1.0.8/debian/libghc6-magic-doc.docs @@ -0,0 +1,2 @@ +dist/doc/html/* +README --- magic-haskell-1.0.8.orig/debian/rules +++ magic-haskell-1.0.8/debian/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f + +# Standard way of building Haskell libraries . +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/hlibrary.mk +