--- haskelldb-0.9.cvs.601.orig/src/Database/HaskellDB/Database.hs +++ haskelldb-0.9.cvs.601/src/Database/HaskellDB/Database.hs @@ -113,7 +113,7 @@ => GetRec (RecCons f (Expr a) er) (RecCons f a vr) where getRec _ _ [] _ = fail $ "Wanted non-empty record, but scheme is empty" - getRec vfs (_::Rel (RecCons ef (Expr ea) er)) (f:fs) stmt = + getRec vfs (_::Rel (RecCons f (Expr a) er)) (f:fs) stmt = do x <- getValue vfs stmt f r <- getRec vfs (undefined :: Rel er) fs stmt --- haskelldb-0.9.cvs.601.orig/src/Database/HaskellDB/DriverAPI.hs +++ haskelldb-0.9.cvs.601/src/Database/HaskellDB/DriverAPI.hs @@ -21,8 +21,8 @@ data DriverInterface = DriverInterface { - connect :: forall a. [String] -- ^ Driver specific options - -> (Database -> IO a) -- ^ Database to work on + connect :: forall a. [String] + -> (Database -> IO a) -> IO a } --- haskelldb-0.9.cvs.601.orig/src/Database/HaskellDB/FieldType.hs +++ haskelldb-0.9.cvs.601/src/Database/HaskellDB/FieldType.hs @@ -73,7 +73,7 @@ mkCalendarTime = toUTCTime instance Typeable CalendarTime where -- not available in standard libraries - typeOf _ = mkAppTy (mkTyCon "System.Time.CalendarTime") [] + typeOf _ = mkTyConApp (mkTyCon "System.Time.CalendarTime") [] instance Typeable (BoundedString n) where - typeOf _ = mkAppTy (mkTyCon "Database.HaskellDB.BoundedString") [] + typeOf _ = mkTyConApp (mkTyCon "Database.HaskellDB.BoundedString") [] --- haskelldb-0.9.cvs.601.orig/src/Database/HaskellDB/GenericConnect.pphs +++ haskelldb-0.9.cvs.601/src/Database/HaskellDB/GenericConnect.pphs @@ -38,7 +38,25 @@ import qualified Database.HaskellDB.WX as WX #endif -genericConnect :: String -> [String] -> ((Database -> IO a) -> IO a) +-- | The function 'genericConnect' connects to a database and performs +-- a given function on the database and return the result of the funtion. +-- The funtion takes as argument the type of the database, an +-- ordered list of arguments depends on which depends on the type of +-- the database. +-- +-- [@odbc@] dsn, userid and password. +-- +-- [@mysql@] server, database, userid and password. +-- +-- [@sqlite@] filepath and IOMode. +-- +-- [@postgresql@] server, database, userid and password. +-- +genericConnect :: String -- ^ The type of the database, which can be one of @odbc@, @mysql@, + -- @sqlite@ or @postgresql@. + -> [String] -- ^ An ordered list of arguments needed to connect to the database. + -> (Database -> IO a) -- ^ Function\/query to be performed on the database. + -> IO a -- ^ Result of the function\/query. genericConnect a b = genericConnect' (map toLower a) b genericConnect' :: String -> [String] -> ((Database -> IO a) -> IO a) --- haskelldb-0.9.cvs.601.orig/debian/haskelldb-dev.install +++ haskelldb-0.9.cvs.601/debian/haskelldb-dev.install @@ -0,0 +1,5 @@ +usr/include/* +usr/lib/lib*.a +usr/lib/lib*.so +usr/lib/pkgconfig/* +usr/lib/*.la --- haskelldb-0.9.cvs.601.orig/debian/compat +++ haskelldb-0.9.cvs.601/debian/compat @@ -0,0 +1 @@ +5 --- haskelldb-0.9.cvs.601.orig/debian/haskelldb-dev.dirs +++ haskelldb-0.9.cvs.601/debian/haskelldb-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include --- haskelldb-0.9.cvs.601.orig/debian/copyright +++ haskelldb-0.9.cvs.601/debian/copyright @@ -0,0 +1,38 @@ +This package was debianized by John Goerzen on +Fri, 11 Feb 2005. + +It was downloaded from haskelldb.sourceforge.net + +Copyright: + +Copyright (c) 1999 Daan Leijen, daan@cs.uu.nl +Copyright (c) 2003-2004 The HaskellDB development team +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * 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. + + * Neither the names of the copyright holders nor the names of the + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT +OWNER 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. --- haskelldb-0.9.cvs.601.orig/debian/haskelldb-doc.doc-base +++ haskelldb-0.9.cvs.601/debian/haskelldb-doc.doc-base @@ -0,0 +1,9 @@ +Document: haskelldb-api +Title: HaskellDB API documentation +Author: Daan Leijen et. al. +Abstract: The API documentation for the HaskellDB library for expressing database queries and operations in a type safe and declarative way. +Section: Apps/Programming + +Format: HTML +Index: /usr/share/doc/haskelldb-doc/html/index.html +Files: /usr/share/doc/haskelldb-doc/html/*.html --- haskelldb-0.9.cvs.601.orig/debian/haskelldb-doc.docs +++ haskelldb-0.9.cvs.601/debian/haskelldb-doc.docs @@ -0,0 +1,2 @@ +dist/doc/html +test --- haskelldb-0.9.cvs.601.orig/debian/changelog +++ haskelldb-0.9.cvs.601/debian/changelog @@ -0,0 +1,175 @@ +haskelldb (0.9.cvs.601-18) unstable; urgency=low + + * Rebuild for GHC 6.6.1. + * debian/control: + - Add ghc6-doc to the BuildDepends-Indep so haddock can generate + references to other documentation packages. + + -- Arjan Oosting Tue, 19 Jun 2007 18:56:07 +0100 + +haskelldb (0.9.cvs.601-17) unstable; urgency=low + + * debian/compat: Bump debhelper compatibility level to 5. + * debian/control: + - Bump versioned dependency on debhelper. + - Add XS-Vcs-Browser field. + + -- Arjan Oosting Fri, 13 Apr 2007 11:08:20 +0200 + +haskelldb (0.9.cvs.601-16) unstable; urgency=low + + * Document the genericConnect function. (Closes: #407184) + + -- Arjan Oosting Sat, 27 Jan 2007 01:33:33 +0100 + +haskelldb (0.9.cvs.601-15) unstable; urgency=low + + * debian/DBDirect.1: added man page for DBDirect. + * debian/rules: + - Do not ship DBDirect in libghc6-haskelldb-dev. (Closes: #402335) + + -- Arjan Oosting Sat, 9 Dec 2006 19:22:29 +0100 + +haskelldb (0.9.cvs.601-14) unstable; urgency=low + + * debian/control: + - Add haddock to Build-Depends-Indep and autotools-dev cpphs to + Build-Depends. + - Add haskelldb-doc binary package (Closes: 387664). + - Add link to homepage of HaskellDB. + - Add a versioned Build-Depends on dpkg-dev as we use + ${source:Version} and ${binary:Version} + * debian/haskelldb-doc.{dirs,doc-base,docs}: added. + * debian/rules: + - Use up-to-date config.guess and config.sub from autotools-dev. + - Update the rules file to generate haskelldb-doc. + - Use cpphs and sed to generate a src/Database/HaskellDB/DriverAPI.hs + file which can be parsed by haddock. + * debian/mk-haskell-depends: update script to take installed package + configuration files as arguments. + * src/Database/HaskellDB/DriverAPI: remove some haddock annotations + which make haddock fail. + + -- Arjan Oosting Sun, 26 Nov 2006 20:56:52 +0100 + +haskelldb (0.9.cvs.601-13) unstable; urgency=low + + * Fix FTBFS (Closes: #395241) + * Properly adopt the package as I am doing the work on it + anyway. (Closes: #305460) + + -- Arjan Oosting Wed, 25 Oct 2006 23:25:57 +0200 + +haskelldb (0.9.cvs.601-12) unstable; urgency=low + + * QA upload. + * Rebuild against latest GHC (Closes: #393806) + * Fix FTBFS with GHC 6.6 + * debian/mk-haskell-depends: add shell script to generate + ${haskell:Depends} substitution variable. + * debian/rules: use mk-haskell-depends to generate dependencies on other + libghc-*-dev packages. + * src/Database/HaskellDB/Database.hs: fix issue with distinct scoped + type variables not being distinct. + + -- Arjan Oosting Wed, 25 Oct 2006 00:13:55 +0200 + +haskelldb (0.9.cvs.601-11) unstable; urgency=low + + * QA upload. + * debian/control: Fix typo in substitution variable which caused a + strange version number. (Closes: #383533) + + -- Arjan Oosting Thu, 24 Aug 2006 13:49:53 +0200 + +haskelldb (0.9.cvs.601-10) unstable; urgency=low + + * QA upload. + * debian/control: + - Add a Section for the source package. + - Update build dependency on ghc6. (Closes: #381815) + - Add missing Depends on libghc6-hsql-mysql-dev, + libghc6-hsql-odbc-dev, libghc6-hsql-postgresql-dev and + libghc6-hsql-sqlite-dev needed to configure and use + libghc6-haskelldb-dev. + - Make sure libghc6-haskell-dev depends on the version of + libghc-hsql-dev it was build against by using the ${HSQL:Version} + substitution variable. + - Add dctrl-tools to Build-Depends because grep-dctrl is used to + determine the version of libghc6-hsql-dev. + - Bump Standards-Version. No changes needed. + * debian/haskelldb.cabal: + - Add hsql-odbc, hsql-mysql, hsql-sqlite and hsql-postgresql to the + Build-Depends as these modules are needed to build haskelldb and + ghc6 (>= 6.4.2) will not make them available by default anymore. + - Remove Allow prefix from the needed extensions declarations. + * debian/rules: + - Remove commented out dh_make template cruft. + - Touch configure-stamp at the end of the configure-stamp target. + - Do not ignore errors on clean. + - Generate the ${HSQL:Version} substitution variable. + + -- Arjan Oosting Mon, 7 Aug 2006 16:05:44 +0200 + +haskelldb (0.9.cvs.601-9) unstable; urgency=medium + + * QA upload. + * Update dependencies for ghc6 6.4.1. Closes: #337275. + + -- Matej Vela Mon, 13 Mar 2006 10:51:01 +0100 + +haskelldb (0.9.cvs.601-8) unstable; urgency=low + + * QA upload. + * Add build dependencies on libghc6-hsql-mysql-dev, libghc6-hsql-odbc-dev, + libghc6-hsql-postgresql-dev, libghc6-hsql-sqlite-dev. Closes: #329835. + * Remove dh_make examples. + * debian/watch: Add. + * Conforms to Standards version 3.6.2. + + -- Matej Vela Sat, 24 Sep 2005 18:15:12 +0200 + +haskelldb (0.9.cvs.601-7) unstable; urgency=low + + * [NMU] Rebuilt to get newer gmp3. Closes: #329275. + * Updated dep on haskell-hsql to version in sid. + + -- John Goerzen Wed, 21 Sep 2005 05:38:29 -0500 + +haskelldb (0.9.cvs.601-6) unstable; urgency=low + + * [NMU] Built against GHC 6.4 + + -- John Goerzen Thu, 12 May 2005 07:51:57 -0500 + +haskelldb (0.9.cvs.601-5) unstable; urgency=low + + * Orphaning this package. + + -- John Goerzen Tue, 19 Apr 2005 23:15:27 -0500 + +haskelldb (0.9.cvs.601-4) unstable; urgency=low + + * Update cabal file syntax for newer cabal and build-dep on newer + haskell-devscripts. Closes: #301643. + + -- John Goerzen Mon, 28 Mar 2005 09:10:21 -0600 + +haskelldb (0.9.cvs.601-3) unstable; urgency=low + + * Added some missing HSQL modules to Exposed-Modules. + + -- John Goerzen Mon, 14 Feb 2005 16:23:14 -0600 + +haskelldb (0.9.cvs.601-2) unstable; urgency=low + + * Removed incorrect dep on ghc. + + -- John Goerzen Fri, 11 Feb 2005 15:46:45 -0600 + +haskelldb (0.9.cvs.601-1) unstable; urgency=low + + * Initial Release. Closes: #294818. + + -- John Goerzen Fri, 11 Feb 2005 13:32:03 -0600 + --- haskelldb-0.9.cvs.601.orig/debian/watch +++ haskelldb-0.9.cvs.601/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://prdownloads.sourceforge.net/haskelldb/haskelldb-(.*)\.tar\.gz --- haskelldb-0.9.cvs.601.orig/debian/rules +++ haskelldb-0.9.cvs.601/debian/rules @@ -0,0 +1,97 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +configure: configure-stamp +configure-stamp: + dh_testdir + cp -f /usr/share/misc/config.guess . + cp -f /usr/share/misc/config.sub . + cpphs --noline -DWITH_HSQL_ODBC -DWITH_HSQL_MYSQL -DWITH_HSQL_SQLITE \ + -DWITH_HSQL_POSTGRESQL \ + src/Database/HaskellDB/GenericConnect.pphs > \ + src/Database/HaskellDB/GenericConnect.hs + sed -i "s|-- #define.*||" src/Database/HaskellDB/GenericConnect.hs + touch configure-stamp + + +build: build-stamp +build-stamp: configure-stamp + dh_testdir + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + if [ -x setup ] && [ -e .setup-config ]; then ./setup clean ; fi + rm -rf setup Setup.hi Setup.ho Setup.o .*config* dist \ + src/Database/HaskellDB/GenericConnect.hs local-pkg \ + DBDirect + rm -f config.guess config.sub + dh_clean + +install: install-arch install-indep +install-arch: build-stamp + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + dh_haskell -s + mv debian/libghc6-haskelldb-dev/usr/lib/haskell-packages/ghc6/bin/DBDirect debian/haskelldb-bin/usr/bin/ + sed -i -e "s%haddock-interfaces:.*%haddock-interfaces: /usr/share/doc/haskelldb-doc/html/haskelldb.haddock%" \ + -e "s%haddock-html: .*%haddock-html: /usr/share/doc/haskelldb-doc/html%" \ + -e "s%include-dirs: .*%include-dirs:%" \ + debian/libghc6-haskelldb-dev/usr/lib/haskell-packages/ghc6/lib/*/installed-pkg-config + find debian/libghc6-haskelldb-dev/usr/lib/haskell-packages/ -empty -type d -delete + dh_install -s + +install-indep: build-stamp + dh_testdir + dh_testroot + dh_clean -k -i + dh_installdirs -i + ghc6 -package Cabal Setup.lhs -o setup + ./setup configure + ./setup haddock + dh_install -i + +# Must not depend on anything. This is to be called by +# binary-arch/binary-indep +# in another 'make' thread. +binary-common: + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip + dh_compress -X.haddock + dh_fixperms + dh_installdeb + dh_shlibdeps + sh -e debian/mk-haskell-depends + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture independant packages using the common target. +binary-indep: install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common + +binary: binary-indep binary-arch +.PHONY: build clean binary-common binary-indep binary-arch binary install-indep install-arch install configure --- haskelldb-0.9.cvs.601.orig/debian/haskelldb-bin.dirs +++ haskelldb-0.9.cvs.601/debian/haskelldb-bin.dirs @@ -0,0 +1 @@ +usr/bin --- haskelldb-0.9.cvs.601.orig/debian/docs +++ haskelldb-0.9.cvs.601/debian/docs @@ -0,0 +1,4 @@ +BUGS +NEWS +README +TODO --- haskelldb-0.9.cvs.601.orig/debian/haskelldb-bin.manpages +++ haskelldb-0.9.cvs.601/debian/haskelldb-bin.manpages @@ -0,0 +1 @@ +debian/DBDirect.1 --- haskelldb-0.9.cvs.601.orig/debian/control +++ haskelldb-0.9.cvs.601/debian/control @@ -0,0 +1,50 @@ +Source: haskelldb +Section: devel +Priority: optional +Maintainer: Arjan Oosting +Build-Depends: autotools-dev, cpphs, dctrl-tools, debhelper (>= 5), + dpkg-dev (>= 0.13.19), ghc6 (>= 6.4.2), + haskell-devscripts (>= 0.5.6), libghc6-hsql-dev (>= 1.6-4), + libghc6-hsql-mysql-dev, libghc6-hsql-odbc-dev, + libghc6-hsql-postgresql-dev, libghc6-hsql-sqlite-dev +Build-Depends-Indep: haddock, ghc6-doc +Standards-Version: 3.7.2 +XS-Vcs-Svn: https://moonshine.dnsalias.org/svn/arjan-public/haskelldb +XS-Vcs-Browser: https://moonshine.dnsalias.org/wsvn/arjan-public/haskelldb + +Package: libghc6-haskelldb-dev +Section: libdevel +Architecture: any +Suggests: haskelldb-bin (= ${binary:Version}), haskelldb-doc (= ${source:Version}) +Depends: ${haskell:Depends}, ${shlibs:Depends} +Description: Haskell library for expressing database queries + HaskellDB is library for expressing database queries and operations + in a type safe and declarative way. This package contains the library + for use with GHC 6. HaskellDB compiles a relational algebra-like + syntax into SQL, submits the operations to the database for + 4processing, and returns the results as ordinary Haskell values. + . + HaskellDB is written entirely in Haskell. + . + Homepage: http://haskelldb.sourceforge.net/ + +Package: haskelldb-bin +Section: devel +Architecture: any +Depends: ${shlibs:Depends} +Suggests: haskelldb-doc (= ${source:Version}) +Description: Utilities for use with HaskellDB + This package provides the DBDirect program that is used to generate + HaskellDB interfaces automatically based on what is in a database. + . + Homepage: http://haskelldb.sourceforge.net/ + +Package: haskelldb-doc +Architecture: all +Section: doc +Recommends: doc-base +Description: API documentation of haskelldb + The API documentation of HaskellDB, a Haskell library for expressing + database queries and operations in a type safe and declarative way. + . + Homepage: http://haskelldb.sourceforge.net/ --- haskelldb-0.9.cvs.601.orig/debian/mk-haskell-depends +++ haskelldb-0.9.cvs.601/debian/mk-haskell-depends @@ -0,0 +1,250 @@ +#! /bin/sh +# +# Determine package dependencies from installed-pkg-config file +# +# Copyright (C) 2006 Arjan Oosting +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of either: +# +# 1) 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., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# 2) BSD 3-clause license. +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * 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. +# +# * The names of contributors may not be used to endorse or promote +# products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT +# OWNER 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. + +set -e + +sort_uniq(){ + { + for i in "$@" ; do + echo $i + done + } | sort -u | tr "\n" " " +} + +dependency(){ + local deb + local version + local next_upstream_version + deb=$1 + version=`dpkg-query --showformat='${Version}' -W $deb` + next_upstream_version=`echo $version | sed -e 's/-[^-]*$/+/'` + echo "$deb (>= $version), $deb (<< $next_upstream_version)" +} + +dependencies(){ + local deb + local debs + local deps + debs=$@ + for deb in `sort_uniq $debs` ; do + deps="$deps, `dependency $deb`" + done + + echo $deps | sed -e 's/^,[ ]*//' +} + +providing_package_for_ghc6(){ + local deb + local dep + local dir + local dirs + local lib + dep=$1 + dirs=`ghc-pkg6 field $dep library-dirs | cut -d':' -f 2` + lib=`ghc-pkg6 field $dep hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' ` + for dir in $dirs ; do + if [ -e "$dir/lib$lib.a" ] ; then + deb=`dpkg-query -S $dir/lib$lib.a | cut -d':' -f 1` || exit $? + continue + fi + done + echo $deb +} + +providing_package_for_ghc6_prof(){ + local deb + local dep + local dir + local dirs + local lib + dep=$1 + dirs=`ghc-pkg6 field $dep library-dirs | cut -d':' -f 2` + lib=`ghc-pkg6 field $dep hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' ` + for dir in $dirs ; do + if [ -e "$dir/lib$lib_p.a" ] ; then + deb=`dpkg-query -S $dir/lib$lib.a | cut -d':' -f 1` || exit $? + continue + fi + done + echo $deb +} + +cabal_depends(){ + local config + local dep + local depends + local final_depends + until [ -z "$1" ] + do + config=$1 + depends="$depends `grep-dctrl -n -i -s Depends "" $config | tr "," " "`" + shift + done + for dep in `sort_uniq $depends` ; do + # The package is not mentioned in the ignored package list with the same version + # or mentioned without any version in the ignored package list? + if echo " $ignores " | grep -qv " $dep " && + echo " $ignores " | grep -qv " `echo $dep | sed s%-[0-9][.0-9a-zA-Z]*$%%` " ; + then + final_depends="$final_depends $dep" + fi + done + echo $final_depends +} + +depends_for_ghc6(){ + local dep + local debs + for dep in `cabal_depends $@` ; do + debs="$debs `providing_package_for_ghc6 $dep`" + done + + dependencies $debs +} + +depends_for_ghc6_prof(){ + local dep + local debs + for dep in `cabal_depends $@` ; do + debs="$debs `providing_package_for_ghc6_prof $dep`" + done + + dependencies $debs +} + +find_config_for_ghc6(){ + local f + local pkg + pkg=$1 + case "$pkg" in + libghc6-*-prof) + pkg=`echo $pkg | sed -e 's/-prof$/-dev$/'` + ;; + *) + ;; + esac + for f in debian/$pkg/usr/lib/haskell-packages/ghc6/lib/*/installed-pkg-config ; do + if [ -f "$f" ] ; then + echo $f + break + fi + done +} + + +if ! [ `which grep-dctrl` > /dev/null ] ; then + echo "grep-dctrl is missing" >&2 + exit 1 +fi + +args= +ignores= +files= +until [ -z "$1" ] +do + case "$1" in + -X*) + pkg=${1##-X} + ignores="$ignores $pkg" + ;; + + --exclude=*) + pkg=${1##--exclude=} + ignores="$ignores $pkg" + ;; + + -*) + args="$args $1" + ;; + *) + if [ -f $1 ] ; then + files="$files $1" + else + echo "Installed package description file $1 can not be found" >&2 + exit 1 + fi + ;; + esac + shift +done + +for pkg in `dh_listpackages $args`; do + sfile=debian/$pkg.substvars + touch $sfile + + case "$pkg" in + libghc6-*-dev|libghc6-*-prof) + config=`find_config_for_ghc6 $pkg` + if [ -f "$config" ] ; then + files="$files $config" + fi + if [ -z "$files" ] ; then + echo "No installed package description files can not be found" >&2 + exit 1 + fi + grep -v ^haskell:Depends $sfile > $sfile.tmp || true + case "$pkg" in + libghc6-*-dev) + echo "haskell:Depends=`depends_for_ghc6 $files`" >> $sfile.tmp + ;; + libghc6-*-prof) + echo "haskell:Depends=`depends_for_ghc6_prof $files`" >> $sfile.tmp + ;; + esac + mv $sfile.tmp $sfile + ;; + *) + ;; + esac +done --- haskelldb-0.9.cvs.601.orig/debian/DBDirect.1 +++ haskelldb-0.9.cvs.601/debian/DBDirect.1 @@ -0,0 +1,61 @@ +.TH DBDirect "1" "December 2006" "DBDirect" "User Commands" +.SH NAME +DBDirect \- Database interface generator for use with HaskellDB +.SH SYNOPSIS +.B DtdToHaskell +[ +.B -b +] +.I driver +.I options +.I name +. +.SH DESCRIPTION +DBDirect is a tool which connect to a SQL database and generates a set of Haskell modules which describe the SQL database. +The generated Haskell modules can be used by the HaskellDB library to manipulate the database. +.PP +\fBDBDirect\fP expects a full set of arguments when called, which should consist out of specific \fIdriver\fP, a set of driver specific \fIoptions\fP and a \fImodule\fP name used as base for the Haskell modules. +The arguments should be given in the order specified below to make sure DBDirect uses the arguments correctly and does not, for example, uses a \fIpassword\fP as an \fIusername\fP. +.TP +\fB-b\fP +enable BoundedString +.TP +\fIdriver\fP +a database type which should be one of \fBODBC\fP, \fBMySQL\fP, \fBPostgreSQL\fP or \fBSQLite\fP. +.TP +\fIoptions\fP +a set of options for the specific \fIdriver\fP. +.RS +.TP +for \fBOBDC\fP the \fIoptions\fP are \fIdsn\fP, \fIuserid\fP and \fIpassword\fP +.TP +for \fBMySQL\fP the \fIoptions\fP are \fIserver\fP, \fIdatabase\fP, \fIuserid\fP and \fIpassword\fP +.TP +for \fBPostgresSQL\fP the \fIoptions\fP are \fIserver\fP, \fIdatabase\fP, \fIuserid\fP and \fIpassword\fP +.TP +for \fBSQLite\fP the \fIoptions\fP are \fIfilepath\fP and \fIIOMode\fP +.TP +for \fBWXHaskell\fP the \fIoptions\fP are \fIdsn\fP, \fIuserid\fP and \fIpassword\fP +.RE +.TP +\fImodule\fP +base name of the database description modules. If this is \fBTest\fP and there are tables \fBtest_tb1\fP and \fBtest_tb2\fP in the database that you run DBDirect against, the following files will be created in the current directory: +.RS +.TP +\(bu Test.hs (just imports and re-exports all the other modules) +.TP +\(bu Test/Test_tb1.hs +.TP +\(bu Test/Test_tb2.hs +.RE +.SH EXAMPLES +As an example we generate a database description from a test table \fBtest_tb1\fP in the \fBtest_db\fP PostgreSQL database on the local machine. +The username is \fBbob\fP and the password is \fBsecret\fP. +To generate the Haskell modules with base \fImodule\fP name \fBDp037\fP we can run: +.PP +.RS +.B DBDirect PostgreSQL localhost test_db bob secret Dp037 +.RE +.PP +.SH AUTHOR +This manual page was party copied and partly written by Arjan Oosting for the Debian system (but may be used by others). --- haskelldb-0.9.cvs.601.orig/debian/haskelldb-doc.dirs +++ haskelldb-0.9.cvs.601/debian/haskelldb-doc.dirs @@ -0,0 +1 @@ +usr/share/doc/haskelldb-doc --- haskelldb-0.9.cvs.601.orig/haskelldb.cabal +++ haskelldb-0.9.cvs.601/haskelldb.cabal @@ -0,0 +1,39 @@ +Name: haskelldb +Version: 0.9 +License: BSD3 +Maintainer: The HaskellDB development team +Copyright: Copyright (c) 1999 Daan Leijen, daan@cs.uu.nl; Copyright (c) 2003-2004 The HaskellDB development team +HS-Source-Dir: src +Exposed-Modules: Database.HaskellDB, + Database.HaskellDB.DriverAPI, + Database.HaskellDB.HDBRec, + Database.HaskellDB.FieldType, + Database.HaskellDB.PrimQuery, + Database.HaskellDB.Sql, + Database.HaskellDB.Query, + Database.HaskellDB.Optimize, + Database.HaskellDB.Database, + Database.HaskellDB.BoundedString, + Database.HaskellDB.BoundedList, + Database.HaskellDB.DBSpec, + Database.HaskellDB.DBLayout, + Database.HaskellDB.DBSpec.DBInfo, + Database.HaskellDB.DBSpec.DBSpecToDatabase, + Database.HaskellDB.DBSpec.DBSpecToDBDirect, + Database.HaskellDB.DBSpec.DatabaseToDBSpec, + Database.HaskellDB.DBSpec.PPHelpers, + Database.HaskellDB.HSQL.Common, + Database.HaskellDB.GenericConnect, + Database.HaskellDB.HSQL.ODBC, + Database.HaskellDB.HSQL.MySQL, + Database.HaskellDB.HSQL.SQLite, + Database.HaskellDB.HSQL.PostgreSQL +Build-Depends: base, hsql >= 1.4 , hsql-odbc, hsql-mysql, hsql-sqlite, hsql-postgresql +Extensions: OverlappingInstances, UndecidableInstances +ghc-options: -fglasgow-exts -O2 + +Executable: DBDirect +Main-Is: DBDirect.hs +Extensions: OverlappingInstances, UndecidableInstances +HS-Source-Dir: src +ghc-options: -fglasgow-exts -O2 --- haskelldb-0.9.cvs.601.orig/Setup.lhs +++ haskelldb-0.9.cvs.601/Setup.lhs @@ -0,0 +1,6 @@ +#!/usr/bin/env runhugs + +> import Distribution.Simple + +> main = defaultMain +