Hi kaol Am Dienstag, den 16.02.2010, 19:35 +0100 schrieb Joachim Breitner: > > > We could consider using dh_haskell_provides also for ghc6 and ghc6-prof, > > > so that they list the ABI is they provide. Any other ideas? as promised on IRC, a patch for this. I had to fix some issues in dh_haskell_provides, but these fixes are in the archive. The files dh_haskell_provides and Dh_Haskell.sh are identical to those on http://darcs.debian.org/pkg-haskell/haskell-devscripts/ The effect of the patch is: $ debdiff ghc6_6.12.1-8_amd64.changes ghc6_6.12.1-8.nomeata1_amd64.changes File lists identical (after any substitutions) Control files of package ghc6: lines which differ (wdiff format) ---------------------------------------------------------------- Provides: ghc, haddock, haskell-compiler, libghc6-array-dev, {+libghc6-array-dev-0.3.0.0-ed0c6,+} libghc6-base-dev, {+libghc6-base-dev-3.0.3.2-0092f, libghc6-base-dev-4.2.0.0-f87cc,+} libghc6-bin-package-db-dev, {+libghc6-bin-package-db-dev-0.0.0.0-4cfd2, +} libghc6-bytestring-dev, {+libghc6-bytestring-dev-0.9.1.5-125af,+} libghc6-cabal-dev, {+libghc6-cabal-dev-1.8.0.2-f8c43,+} libghc6-containers-dev, {+libghc6-containers-dev-0.3.0.0-4a332,+} libghc6-directory-dev, {+libghc6-directory-dev-1.0.1.0-8a34c,+} libghc6-dph-base-dev, {+libghc6-dph-base-dev-0.4.0-385a3,+} libghc6-dph-par-dev, {+libghc6-dph-par-dev-0.4.0-b4f33,+} libghc6-dph-prim-interface-dev, {+libghc6-dph-prim-interface-dev-0.4.0-9c8ab,+} libghc6-dph-prim-par-dev, {+libghc6-dph-prim-par-dev-0.4.0-4eccc,+} libghc6-dph-prim-seq-dev, {+libghc6-dph-prim-seq-dev-0.4.0-a2769,+} libghc6-dph-seq-dev, {+libghc6-dph-seq-dev-0.4.0-52cfd,+} libghc6-extensible-exceptions-dev, {+libghc6-extensible-exceptions-dev-0.1.1.1-95db3,+} libghc6-filepath-dev, {+libghc6-filepath-dev-1.1.0.3-3f3be,+} libghc6-ghc-binary-dev, {+libghc6-ghc-binary-dev-0.5.0.2-bb54d, libghc6-ghc-dev-6.12.1-a62f9,+} libghc6-ghc-prim-dev, {+libghc6-ghc-prim-dev-0.2.0.0-9d35c,+} libghc6-haskell98-dev, {+libghc6-haskell98-dev-1.0.1.1-0fdaf,+} libghc6-hpc-dev, {+libghc6-hpc-dev-0.5.0.4-7df34,+} libghc6-integer-gmp-dev, {+libghc6-integer-gmp-dev-0.2.0.0-9a51f,+} libghc6-old-locale-dev, {+libghc6-old-locale-dev-1.0.0.2-ef43d,+} libghc6-old-time-dev, {+libghc6-old-time-dev-1.0.0.3-9efce,+} libghc6-pretty-dev, {+libghc6-pretty-dev-1.0.1.1-34534,+} libghc6-process-dev, {+libghc6-process-dev-1.0.1.2-d10eb,+} libghc6-random-dev, {+libghc6-random-dev-1.0.0.2-cf650,+} libghc6-rts-dev, libghc6-syb-dev, {+libghc6-syb-dev-0.1.0.2-3787e,+} libghc6-template-haskell-dev, {+libghc6-template-haskell-dev-2.4.0.0-bbc7c,+} libghc6-time-dev, [-libghc6-unix-dev-] {+libghc6-time-dev-1.1.4-1ced4, libghc6-unix-dev, libghc6-unix-dev-2.4.0.0-16adb, libghc6-utf8-string-dev-0.3.4-75a94+} Version: [-6.12.1-8-] {+6.12.1-8.nomeata1+} Control files of package ghc6-doc: lines which differ (wdiff format) -------------------------------------------------------------------- Depends: ghc6 (>= [-6.12.1-8)-] {+6.12.1-8.nomeata1)+} Version: [-6.12.1-8-] {+6.12.1-8.nomeata1+} Control files of package ghc6-prof: lines which differ (wdiff format) --------------------------------------------------------------------- Depends: ghc6 (= [-6.12.1-8)-] {+6.12.1-8.nomeata1)+} Provides: ghc-prof, libghc6-array-prof, {+libghc6-array-prof-0.3.0.0-ed0c6,+} libghc6-base-prof, {+libghc6-base-prof-3.0.3.2-0092f, libghc6-base-prof-4.2.0.0-f87cc,+} libghc6-bin-package-db-prof, {+libghc6-bin-package-db-prof-0.0.0.0-4cfd2,+} libghc6-bytestring-prof, {+libghc6-bytestring-prof-0.9.1.5-125af,+} libghc6-cabal-prof, {+libghc6-cabal-prof-1.8.0.2-f8c43,+} libghc6-containers-prof, {+libghc6-containers-prof-0.3.0.0-4a332,+} libghc6-directory-prof, {+libghc6-directory-prof-1.0.1.0-8a34c,+} libghc6-dph-base-prof, {+libghc6-dph-base-prof-0.4.0-385a3,+} libghc6-dph-par-prof, {+libghc6-dph-par-prof-0.4.0-b4f33,+} libghc6-dph-prim-interface-prof, {+libghc6-dph-prim-interface-prof-0.4.0-9c8ab,+} libghc6-dph-prim-par-prof, {+libghc6-dph-prim-par-prof-0.4.0-4eccc,+} libghc6-dph-prim-seq-prof, {+libghc6-dph-prim-seq-prof-0.4.0-a2769,+} libghc6-dph-seq-prof, {+libghc6-dph-seq-prof-0.4.0-52cfd,+} libghc6-extensible-exceptions-prof, {+libghc6-extensible-exceptions-prof-0.1.1.1-95db3,+} libghc6-filepath-prof, {+libghc6-filepath-prof-1.1.0.3-3f3be,+} libghc6-ghc-binary-prof, {+libghc6-ghc-binary-prof-0.5.0.2-bb54d,+} libghc6-ghc-prim-prof, {+libghc6-ghc-prim-prof-0.2.0.0-9d35c, libghc6-ghc-prof-6.12.1-a62f9,+} libghc6-haskell98-prof, {+libghc6-haskell98-prof-1.0.1.1-0fdaf,+} libghc6-hpc-prof, {+libghc6-hpc-prof-0.5.0.4-7df34,+} libghc6-integer-gmp-prof, {+libghc6-integer-gmp-prof-0.2.0.0-9a51f,+} libghc6-old-locale-prof, {+libghc6-old-locale-prof-1.0.0.2-ef43d,+} libghc6-old-time-prof, {+libghc6-old-time-prof-1.0.0.3-9efce,+} libghc6-pretty-prof, {+libghc6-pretty-prof-1.0.1.1-34534,+} libghc6-process-prof, {+libghc6-process-prof-1.0.1.2-d10eb,+} libghc6-random-prof, {+libghc6-random-prof-1.0.0.2-cf650,+} libghc6-rts-prof, libghc6-syb-prof, {+libghc6-syb-prof-0.1.0.2-3787e,+} libghc6-template-haskell-prof, {+libghc6-template-haskell-prof-2.4.0.0-bbc7c,+} libghc6-time-prof, [-libghc6-unix-prof-] {+libghc6-time-prof-1.1.4-1ced4, libghc6-unix-prof, libghc6-unix-prof-2.4.0.0-16adb, libghc6-utf8-string-prof-0.3.4-75a94+} Version: [-6.12.1-8-] {+6.12.1-8.nomeata1+} Which looks sensible. I forgot to make my change to ghc6’s postinst in debian/ghc6.postinst.in (and not debian/ghc6.postinst), so it is not in the diff. Please consider writing triggered) $bindir/ghc-pkg recache $bindir/ghc-pkg check ;; there. Thanks, Joachim -- Joachim "nomeata" Breitner Debian Developer nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata
diff -Nru ghc6-6.12.1/debian/changelog ghc6-6.12.1/debian/changelog --- ghc6-6.12.1/debian/changelog 2010-02-10 12:19:32.000000000 +0100 +++ ghc6-6.12.1/debian/changelog 2010-02-17 14:00:06.000000000 +0100 @@ -1,3 +1,12 @@ +ghc6 (6.12.1-8.nomeata1) UNRELEASED; urgency=low + + * Non-maintainer upload. + * Use dh_haskell_depends from haskell-devscripts to create provides + including the packages ABI. + + -- Joachim Breitner <nomeata@debian.org> Wed, 17 Feb 2010 13:56:42 +0100 + ghc6 (6.12.1-8) unstable; urgency=low * Use tabs instead of 8 spaces in debian/rules for ia64 specific flags. diff -Nru ghc6-6.12.1/debian/control ghc6-6.12.1/debian/control --- ghc6-6.12.1/debian/control 2010-02-09 22:44:12.000000000 +0100 +++ ghc6-6.12.1/debian/control 2010-02-17 14:12:32.000000000 +0100 @@ -9,7 +9,7 @@ Package: ghc6 Architecture: any Depends: perl | perl5, gcc (>= 4:4.2), libgmp3-dev, libffi-dev, libbsd-dev, libc6-dev, ${shlibs:Depends}, ${misc:Depends} -Provides: haskell-compiler, ghc, haddock, ${provided-devs} +Provides: haskell-compiler, ghc, haddock, ${provided-devs}, ${haskell:Provides} Conflicts: ghc4 (<= 4.08.1-4), haddock Replaces: haddock Breaks: cabal-install (<< 0.8.0), haskell-devscripts (<< 0.6.19) @@ -26,7 +26,7 @@ Package: ghc6-prof Architecture: any -Provides: ghc-prof, ${provided-profs} +Provides: ghc-prof, ${provided-profs}, ${haskell:Provides} Depends: ghc6 (= ${binary:Version}), ${misc:Depends} Description: Profiling libraries for the Glasgow Haskell Compilation system Version 6 of the Glorious Glasgow Haskell Compilation system (GHC). GHC is diff -Nru ghc6-6.12.1/debian/dh_haskell_provides ghc6-6.12.1/debian/dh_haskell_provides --- ghc6-6.12.1/debian/dh_haskell_provides 1970-01-01 01:00:00.000000000 +0100 +++ ghc6-6.12.1/debian/dh_haskell_provides 2010-02-17 14:13:11.000000000 +0100 @@ -0,0 +1,99 @@ +#! /bin/sh +# +# Calculated provides substvars for haskell library packages. +# +# Copyright (C) 2006-2007 Arjan Oosting <arjan@debian.org> +# Copyright (C) 2009 Joachim Breitner <nomeata@debian.org> +# +# 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 + +if test -e debian/Dh_Haskell.sh +then + . debian/Dh_Haskell.sh +else + . /usr/share/haskell-devscripts/Dh_Haskell.sh +fi + +for pkg in `dh_listpackages $args`; do + sfile=debian/$pkg.substvars + touch $sfile + + case "$pkg" in + libghc6-*-dev|libghc6-*-prof|ghc6|ghc6-prof) + if [ -z "$files" ] ; then + cfiles=`find_config_for_ghc6 $pkg` + else + cfiles="$files" + fi + if [ -z "$cfiles" ] ; then + echo "No installed package description files can not be found" >&2 + exit 1 + fi + case "$pkg" in + libghc6-*-dev|ghc6) + grep -v \ + -e ^haskell:Provides \ + $sfile > $sfile.tmp || true + echo "haskell:Provides=`provides_for_ghc6 $cfiles`" >> $sfile.tmp + ;; + libghc6-*-prof|ghc6-prof) + grep -v \ + -e ^haskell:Provides \ + $sfile > $sfile.tmp || true + echo "haskell:Provides=`provides_for_ghc6_prof $cfiles`" >> $sfile.tmp + ;; + esac + mv $sfile.tmp $sfile + ;; + *) + ;; + esac +done diff -Nru ghc6-6.12.1/debian/Dh_Haskell.sh ghc6-6.12.1/debian/Dh_Haskell.sh --- ghc6-6.12.1/debian/Dh_Haskell.sh 1970-01-01 01:00:00.000000000 +0100 +++ ghc6-6.12.1/debian/Dh_Haskell.sh 2010-02-17 14:13:11.000000000 +0100 @@ -0,0 +1,239 @@ +strip_hash(){ + echo "$1" | sed 's/-................................$//' +} + +sort_uniq(){ + { + for i in "$@" ; do + echo $i + done + } | sort -u | tr "\n" " " +} + +dependency(){ + local package + local version + local next_upstream_version + package=$1 + version=`dpkg-query --showformat='${Version}' -W $package` + next_upstream_version=`echo $version | sed -e 's/-[^-]*$//' -e 's/$/+/'` + echo "$package (>= $version), $package (<< $next_upstream_version)" +} + +providing_package_for_ghc6(){ + local package + local dep + local dir + local dirs + local lib + dep=`strip_hash $1` + dirs=`ghc-pkg6 field $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2` + lib=`ghc-pkg6 field $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' ` + for dir in $dirs ; do + if [ -e "${dir}/lib${lib}.a" ] ; then + package=`dpkg-query -S ${dir}/lib${lib}.a | cut -d':' -f 1` || exit $? + continue + fi + done + echo $package +} + +providing_package_for_ghc6_prof(){ + local package + local dep + local dir + local dirs + local lib + dep=`strip_hash $1` + dirs=`ghc-pkg6 field $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2` + lib=`ghc-pkg6 field $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' ` + for dir in $dirs ; do + if [ -e "${dir}/lib${lib}_p.a" ] ; then + package=`dpkg-query -S ${dir}/lib${lib}_p.a | cut -d':' -f 1` || exit $? + continue + fi + done + echo $package +} + +cabal_package_ids(){ + local config + local package_ids + until [ -z "$1" ] + do + config=$1 + package_ids="$package_ids `grep-dctrl -n -i -s Id "" $config`" + shift + done + echo $package_ids +} + +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 +} + +hashed_dependency(){ + local type + local pkgid + local virpkg + type=$1 + pkgid=$2 + virtual_pkg=`package_id_to_virtual_package $type $pkgid` + # As a transition measure, check if dpkg knows about this virtual package + if dpkg-query -W $virtual_pkg >/dev/null 2>/dev/null; + then + echo $virtual_pkg + fi +} + +depends_for_ghc6(){ + local dep + local packages + local pkgid + for pkgid in `cabal_depends $@` ; do + dep=`hashed_dependency dev $pkgid` + if [ -z "$dep" ] + then + pkg=`providing_package_for_ghc6 $pkgid` + if [ -n "$pkg" ] + then + dep=`dependency $pkg` + packages="$packages, $dep" + fi + else + packages="$packages, $dep" + fi + done + + echo $packages | sed -e 's/^,[ ]*//' +} + +depends_for_ghc6_prof(){ + local dep + local packages + local pkgid + for pkgid in `cabal_depends $@` ; do + dep=`hashed_dependency prof $pkgid` + if [ -z "$dep" ] + then + pkg=`providing_package_for_ghc6_prof $pkgid` + dep=`dependency $pkg` + fi + packages="$packages, $dep" + done + + echo $packages | sed -e 's/^,[ ]*//' +} + +provides_for_ghc6(){ + local dep + local packages + for package_id in `cabal_package_ids $@` ; do + packages="$packages, `package_id_to_virtual_package dev $package_id`" + done + echo $packages | sed -e 's/^,[ ]*//' +} + +provides_for_ghc6_prof(){ + local dep + local packages + for package_id in `cabal_package_ids $@` ; do + packages="$packages, `package_id_to_virtual_package prof $package_id`" + done + echo $packages | sed -e 's/^,[ ]*//' +} + +package_id_to_virtual_package(){ + local type + type="$1" + echo $2 | tr A-Z a-z | \ + grep '[a-z0-9]\+-[0-9\.]\+-................................' | \ + perl -pe 's/([a-z0-9-]+)-([0-9\.]+)-(.....).........................../libghc6-\1-'$type'-\2-\3/' +} + +depends_for_hugs(){ + local version + local upstream_version + version=`dpkg-query --showformat='${Version}' -W hugs` + upstream_version=`echo $version | sed -e 's/-[^-]*$//'` + echo "hugs (>= $upstream_version)" +} + +find_config_for_ghc6(){ + local f + local pkg + pkg=$1 + case "$pkg" in + ghc6-prof) + pkg=ghc6 + ;; + libghc6-*-prof) + pkg=`echo $pkg | sed -e 's/-prof$/-dev/'` + ;; + *) + ;; + esac + for f in debian/$pkg/var/lib/ghc-*/package.conf.d/*.conf ; do + if [ -f "$f" ] ; then + echo $f + echo " " + 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 + diff -Nru ghc6-6.12.1/debian/rules ghc6-6.12.1/debian/rules --- ghc6-6.12.1/debian/rules 2010-02-10 12:18:06.000000000 +0100 +++ ghc6-6.12.1/debian/rules 2010-02-17 14:05:16.000000000 +0100 @@ -265,6 +265,7 @@ dh_compress -X.haddock -a dh_fixperms -a dh_installdeb -a + debian/dh_haskell_provides -a dh_shlibdeps -XlibHS dh_gencontrol -a dh_md5sums -a
Attachment:
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil