[med-svn] r1796 - trunk/packages/libgenome/trunk/debian
tille at alioth.debian.org
tille at alioth.debian.org
Fri Apr 18 18:42:24 UTC 2008
Author: tille
Date: 2008-04-18 18:42:23 +0000 (Fri, 18 Apr 2008)
New Revision: 1796
Added:
trunk/packages/libgenome/trunk/debian/d-devlibdeps
trunk/packages/libgenome/trunk/debian/d-shlibmove
Modified:
trunk/packages/libgenome/trunk/debian/rules
Log:
Rude hack to stupidly work around a problem in d-shlibs that hardcoded libc++6 version in the -dev package which might not really harm but is just ugly (see #374049). This package should probably uploaded once d-shlibs is fixed properly and build depend against the fixed version.
Added: trunk/packages/libgenome/trunk/debian/d-devlibdeps
===================================================================
--- trunk/packages/libgenome/trunk/debian/d-devlibdeps (rev 0)
+++ trunk/packages/libgenome/trunk/debian/d-devlibdeps 2008-04-18 18:42:23 UTC (rev 1796)
@@ -0,0 +1,199 @@
+#!/bin/bash
+# d-devlibdeps -- get list of build-time dependencies
+# Copyright (C) 2002-2005 Junichi Uekawa
+#
+# 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
+
+# 2002 May 3. Created.
+# automatic depends line generator.
+
+set -e
+set -o pipefail
+
+function getname () {
+ local SONAMELIBNAME
+ local SONAMEVERSION
+ local SONAME
+ SONAME="$1"
+ SONAMELIBNAME=$(echo $SONAME | sed 's/\.so\..*$//')
+ SONAMEVERSION=$(echo $SONAME | sed 's/^.*\.so\.//')
+ case "$SONAMELIBNAME" in
+ *[0-9])
+ RETURN="$SONAMELIBNAME-$SONAMEVERSION"
+ ;;
+ *)
+ RETURN="$SONAMELIBNAME$SONAMEVERSION"
+ ;;
+ esac
+}
+
+function overridedevlibdeps () {
+ # overrides necessary until the scheme is adopted.
+ sed \
+ -e 's/libX11-6-dev/libx11-dev | xlibs-dev (<< 4.3.0)/' \
+ -e 's/libXext6-dev/libxext-dev | xlibs-dev (<< 4.3.0)/' \
+ -e 's/libXi6-dev/libxi-dev | xlibs-dev (<< 4.3.0)/' \
+ -e 's/libXpm4-dev/libxpm-dev | xlibs-dev (<< 4.3.0)/' \
+ -e 's/libICE6-dev/libice-dev | xlibs-dev (<< 4.3.0)/' \
+ -e 's/libSM6-dev/libsm-dev | xlibs-dev (<< 4.3.0)/' \
+ -e 's/libGL1-dev/xlibmesa-gl-dev | xlibs-dev (<< 4.3.0)/' \
+ -e 's/libGLU1-dev/xlibmesa-glu-dev | xlibs-dev (<< 4.3.0)/' \
+ -e 's/libcrypt1-dev//' \
+ -e 's/libcrypt1\.1-dev//' \
+ -e 's/libdl2-dev//' \
+ -e 's/libdl2.1-dev//' \
+ -e 's/libm6-dev//' \
+ -e 's/libm6.1-dev//' \
+ -e 's/libm1-dev//' \
+ -e 's/libnsl1-dev//' \
+ -e 's/libnsl1\.1-dev//' \
+ -e 's/libpthread0-dev//' \
+ -e 's/libpthread0\.3-dev//' \
+ -e 's/libpthread.*-dev/libpthread-dev/' \
+ -e 's/libresolv2-dev//' \
+ -e 's/libglib-1.2-0-dev/libglib1.2-dev/' \
+ -e 's/libgthread-1.2-0-dev/libglib1.2-dev/' \
+ -e 's/libgmodule-1.2-0-dev/libglib1.2-dev/' \
+ -e 's/libgtk-1.2-0-dev/libgtk1.2-dev/' \
+ -e 's/libpam0-dev/libpam0g-dev/' \
+ -e 's/libgdk-1.2-0-dev/libgtk1.2-dev/' \
+ -e 's/libz1-dev/zlib1g-dev/' \
+ -e 's/libgcc_s.*-dev//' \
+ -e 's/libcrypto.*-dev/libssl-dev/' \
+ -e 's/libssl.*-dev/libssl-dev/' \
+ -e 's/libcomerr2//' \
+ -e 's/libcom_err2-dev/comerr-dev/' \
+ -e 's/libgssapi_krb5-2-dev/libkrb5-dev/' \
+ -e 's/libk5crypto3-dev/libkrb5-dev/' \
+ -e 's/libkrb5-3-dev/libkrb5-dev/' \
+ -e 's/libparted-1.6-0-dev/libparted1.6-dev/' \
+ -e 's/libSDL-1.2-0-dev/libsdl1.2-dev/' \
+ -e 's/libvorbis0-dev/libvorbis-dev/' \
+ -e 's/libcrack2-dev/cracklib2-dev/' \
+ -e 's/libkrb1-dev/kerberos4kth-dev/' \
+ -e 's/libtheora0-dev/libtheora-dev/' \
+ -e 's/libvorbisenc2-dev/libvorbis-dev/' \
+ -e 's/libogg0-dev/libogg-dev/' \
+ -e 's/librt1-dev//' \
+ -e 's/libspeex1-dev/libspeex-dev/' \
+ -e 's/libX\(.*\)[0-9]-dev/libx\1-dev/' \
+ -e 's/libgdk-x11-2.0-0-dev/libgtk2.0-dev/' \
+ -e 's/libgdk-x11-2.0-0-dev/libgtk2.0-dev/' \
+ -e 's/libgtk-x11-2.0-0-dev/libgtk2.0-dev/' \
+ -e 's/libgdk_pixbuf-2.0-0-dev/libgtk2.0-dev/' \
+ -e 's/libgd2-dev/libgd-dev/' \
+ -e 's/libgmodule-2.0-0-dev/libglib2.0-dev/' \
+ -e 's/libgobject-2.0-0-dev/libglib2.0-dev/' \
+ -e 's/libglib-2.0-0-dev/libglib2.0-dev/' \
+ -e 's/libpango-1.0-0-dev/libpango1.0-dev/' \
+ -e 's/libpangocairo-1.0-0-dev/libpango1.0-dev/' \
+ -e 's/libatk-1.0-0-dev/libatk1.0-dev/' \
+ -e 's/libxml2-2-dev/libxml2-dev/' \
+ -e 's/libgthread-2.0-0-dev/libglib2.0-dev/' \
+ -e 's/libstdc++6-dev/libstdc++6-4.2-dev/' \
+ "${OVERRIDE[@]/#/-e}" \
+
+
+}
+
+
+function validate_package () {
+# validate if package foo exists, this relies on apt.
+ if [ -z "$1" ]; then
+ # ignore empty.
+ return;
+ fi
+ if grep "^Package: $1\$" debian/control > /dev/null 2> /dev/null ; then
+ # ignore package that is going to be created.
+ echo " --> $1 package from same source package." >&2
+ return
+ fi
+ case $(echo $(apt-cache show $1 2> /dev/null| wc -l ) ) in
+ 0)
+ case $(echo $(apt-cache showpkg $1 2> /dev/null | awk ' /^Reverse Provides: $/,/^$/ {if ($0 !~ /:/) {print $0}}' | wc -l) ) in
+ 0)
+ echo "devlibs error: There is no package matching [$1] and noone provides it, please report bug to d-shlibs maintainer" >&2
+ return 1;;
+ *) echo " --> $1 is provided by a package." >&2 ;;
+ esac;;
+ *) echo " --> $1 package exists." >&2 ;;
+ esac
+ return 0;
+}
+
+while true; do
+ case $1 in
+ --override=*)
+ OVERRIDE[${#OVERRIDE[@]}]="${1/--override=/}"
+ shift;
+ ;;
+ --override)
+ OVERRIDE[${#OVERRIDE[@]}]="$2"
+ shift; shift;
+ ;;
+ --*)
+ #error
+ ;;
+ --|*)
+ break;
+ ;;
+ esac
+done
+
+if [ -z "$2" ]; then
+ echo "$0: Please read manpage for help, not enough options given"
+ exit 1
+fi
+
+OUTPUTFILE="$1"
+shift;
+
+DEPENDS=""
+for A in $*; do
+ # let shell do the delimiting of objdump output./
+ DEPENDS="$DEPENDS $(set -o pipefail; objdump -p ${A} |sed -n 's/^.*NEEDED *//p')"
+done
+
+outputtmp=$(tempfile)
+(
+ set -e
+ if [ -f "$OUTPUTFILE" ] ; then
+ if grep -v "^devlibs:Depends=" "$OUTPUTFILE"; then
+ :
+ fi
+ fi
+ printf "devlibs:Depends="
+ for A in $DEPENDS; do #DEPENDS is a space-delimited thing.
+ getname "$A"
+ echo $RETURN-dev | overridedevlibdeps
+ done | \
+ sort | \
+ uniq | \
+ while read B; do
+ # abuse that only first part of multi-entry overrides is considered
+ if validate_package $B ; then
+ printf "%s " $B ;
+ else
+ echo "ERROR_DEVLIB "
+ fi
+ done | sed -e 's/\([a-z0-9)]\) \+\([a-z]\)/\1, \2/g' -e 's/ \+/ /g' -e 's/^ //' -e 's/ $//'
+ printf "\n"
+) > "${outputtmp}"
+
+if grep "ERROR_DEVLIB" "$outputtmp" > /dev/null; then
+ exit 1
+fi
+
+mv "${outputtmp}" $OUTPUTFILE
Property changes on: trunk/packages/libgenome/trunk/debian/d-devlibdeps
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/packages/libgenome/trunk/debian/d-shlibmove
===================================================================
--- trunk/packages/libgenome/trunk/debian/d-shlibmove (rev 0)
+++ trunk/packages/libgenome/trunk/debian/d-shlibmove 2008-04-18 18:42:23 UTC (rev 1796)
@@ -0,0 +1,228 @@
+#!/bin/bash
+# d-shlibmove -- move shared library files around for Debian packaging
+# Copyright (C) 2002, 2005 Junichi Uekawa
+#
+# 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
+
+# 2002 Apr 23. Created.
+# automatic packaging of libtool-created library packages.
+
+# from d-shlibs package
+
+set -e
+set -o pipefail
+
+function getname () {
+ local SONAMELIBNAME
+ local SONAMEVERSION
+ local SONAME
+ SONAME="$1"
+ SONAMELIBNAME=$(echo $SONAME | sed 's/\.so\..*$//')
+ SONAMEVERSION=$(echo $SONAME | sed 's/^.*\.so\.//')
+ case "$SONAMELIBNAME" in
+ *[0-9])
+ RETURN="$SONAMELIBNAME-$SONAMEVERSION"
+ ;;
+ *)
+ RETURN="$SONAMELIBNAME$SONAMEVERSION"
+ ;;
+ esac
+}
+
+function readlibnameinfo () {
+ LIBNAME="$1"
+
+ if [ -z "$1" ] || ! echo "$1" | grep ".so$" > /dev/null ; then
+ echo "$0: [$1] is not a valid shared library file name " >&2
+ exit 1;
+ fi
+
+ if [ ! -h "$1" ]; then
+ echo "$0: expected [$1] to be a symlink, but it is not" >&2
+ exit 1;
+ fi
+
+ SONAME=$(set -o pipefail; objdump -p ${LIBNAME} |sed -n 's/^.*SONAME *//p' )
+ getname "$SONAME"
+ SONAMEPKGNAME=$(echo "$RETURN" | tr '[A-Z]' '[a-z]')
+ PK=$(basename "$1" | sed 's/\.so$//')
+ PK_LOWER=$(echo ${PK} | tr '[A-Z]' '[a-z]')
+ REALSO=$(readlink -f "${LIBNAME}")
+}
+
+function check_line () {
+ # check line
+ local PKGNAME="$1"
+ local ENTRYLINE="$2"
+
+ if ! awk '/^Package:.*'"$PKGNAME"'/,/^$/{print}' "$CONTROL" | \
+ grep "$ENTRYLINE" > /dev/null; then
+ echo "E: line [$ENTRYLINE] not found in $CONTROL section for $PKGNAME"
+ # set this error signifier to true
+ CHECK_ERROR=true
+ fi
+}
+
+
+echo "Library package automatic movement utility"
+
+CONTROL=debian/control
+
+execscript=$(tempfile)
+INSTALLFILE_SHLPKG=$(tempfile)
+INSTALLFILE_DEVPKG=$(tempfile)
+cat > ${execscript} <<EOF
+set -e
+EOF
+
+DEVLIB_TO_CHECK=
+SUFFIX=
+DEVSUFFIX=
+TRANSITIONSUFFIX=
+
+DOIT=no
+while [ -n "$1" ]; do
+ case $1 in
+ --moveshl)
+ echo "$2 $3" >> "${INSTALLFILE_SHLPKG}"
+ shift; shift; shift;
+ ;;
+ --movedev)
+ echo "$2 $3" >> "${INSTALLFILE_DEVPKG}"
+ shift; shift; shift;
+ ;;
+ --movedevdoc)
+ echo "$2 usr/share/doc/\${PKGDEV}" >> "${INSTALLFILE_DEVPKG}"
+ shift; shift;
+ ;;
+ --commit)
+ DOIT=yes
+ shift;
+ ;;
+ --extralib)
+ readlibnameinfo "$2"
+ DEVLIB_TO_CHECK="${DEVLIB_TO_CHECK} $2"
+ echo "$(dirname $2)/${PK}.a usr/lib" >> "${INSTALLFILE_DEVPKG}"
+ echo "$(dirname $2)/${PK}.la usr/lib || true" >> "${INSTALLFILE_DEVPKG}"
+ echo "$(dirname $2)/${PK}.so usr/lib" >> "${INSTALLFILE_DEVPKG}"
+ echo "$(dirname ${REALSO})/${SONAME} usr/lib" >> "${INSTALLFILE_SHLPKG}"
+ echo "${REALSO} usr/lib" >> "${INSTALLFILE_SHLPKG}"
+
+ shift; shift;
+ ;;
+ --shlibs-local)
+ shift;
+ SHLIBSLOCALVER="$1";
+ shift;
+ ;;
+ --suffix)
+ shift;
+ SUFFIX="$1";
+ shift;
+ ;;
+ --devsuffix)
+ shift;
+ DEVSUFFIX="$1";
+ shift;
+ ;;
+ --c102)
+ TRANSITIONSUFFIX="c102"
+ shift;;
+ --ldbl)
+ TRANSITIONSUFFIX="ldbl"
+ shift;;
+ --override)
+ OVERRIDE[${#OVERRIDE[@]}]="$2"
+ shift; shift;;
+ --|*)
+ break;
+ ;;
+ esac
+done
+
+# path/libxxxx.so.yyy.zz.zz
+# ------------------------- REALSO (actual .so filename that is linked to)
+# -------------- SONAME
+# ------- --- SONAMEPKGNAME (lowercased for package name)
+# --------------- $1
+# ---------- PK
+# ---------- PK_LOWER (lowercased for package name)
+
+DEVLIB_TO_CHECK="${DEVLIB_TO_CHECK} $1"
+readlibnameinfo "$1"
+PKGDEV="${SONAMEPKGNAME}${DEVSUFFIX}-dev"
+PKGSHL="${SONAMEPKGNAME}${SUFFIX}${TRANSITIONSUFFIX}"
+
+INSTALLDIR="install -d -m 755 "
+echo "${INSTALLDIR} debian/${PKGDEV}/usr/lib" >> "$execscript"
+echo "${INSTALLDIR} debian/${PKGSHL}/usr/lib" >> "$execscript"
+echo "mv $(dirname $1)/${PK}.a debian/${PKGDEV}/usr/lib" >> "$execscript"
+echo "mv $(dirname $1)/${PK}.la debian/${PKGDEV}/usr/lib || true" >> "$execscript"
+echo "mv $(dirname $1)/${PK}.so debian/${PKGDEV}/usr/lib" >> "$execscript"
+echo "mv $(dirname ${REALSO})/${SONAME} debian/${PKGSHL}/usr/lib" >> "$execscript"
+echo "mv ${REALSO} debian/${PKGSHL}/usr/lib" >> "$execscript"
+
+if [ -n "${SHLIBSLOCALVER}" ]; then
+ echo "echo \"${SONAMELIBNAME} ${SONAMEVERSION} ${PKGSHL} (>= ${SHLIBSLOCALVER})\" >> debian/shlibs.local" >> "$execscript"
+fi
+
+/bin/bash debian/d-devlibdeps "${OVERRIDE[@]/#/--override=}" debian/"${PKGDEV}".substvars "${DEVLIB_TO_CHECK}"
+
+#do some definition for the file.
+echo "PKGDEV=${PKGDEV}" >> "${execscript}"
+echo "PKGSHL=${PKGSHL}" >> "${execscript}"
+
+#do the extra files
+cat "${INSTALLFILE_SHLPKG}" | while read A B; do
+ echo "${INSTALLDIR} debian/${PKGSHL}/${B}" >> "${execscript}"
+ echo "mv ${A} debian/${PKGSHL}/${B}" >> "${execscript}"
+done
+cat "${INSTALLFILE_DEVPKG}" | while read A B; do
+ echo "${INSTALLDIR} debian/${PKGDEV}/${B}" >> "${execscript}"
+ echo "mv ${A} debian/${PKGDEV}/${B}" >> "${execscript}"
+done
+
+cat "${execscript}"
+
+# check the syntax of the control file.
+CHECK_ERROR=false
+
+check_line "${PKGDEV}" "Provides:.*${PK_LOWER}-dev"
+check_line "${PKGDEV}" "Conflicts:.*${PK_LOWER}-dev"
+check_line "${PKGSHL}" "Section: libs"
+if [ -n "${SUFFIX}" ]; then
+ check_line "${PKGSHL}" "Conflicts: ${SONAMEPKGNAME}"
+fi
+if [ -n "${TRANSITIONSUFFIX}" ]; then
+ check_line "${PKGSHL}" "Conflicts: ${SONAMEPKGNAME}${SUFFIX}"
+fi
+check_line "${PKGDEV}" "Section: \(devel\|libdevel\)"
+check_line "${PKGDEV}" "Depends:.*${PKGSHL}"
+check_line "${PKGSHL}" "Depends:.*[$]{shlibs:Depends}"
+
+if [ "${CHECK_ERROR}" = "true" ]; then
+ echo "Error occurred, aborting" >&2
+ exit 1
+fi
+
+if [ "${DOIT}" = "yes" ]; then
+ sh "${execscript}"
+else
+ echo "Dry-run. If you are satisfied, run with --commit"
+ exit 2
+fi
+rm -f "${execscript}" "${INSTALLFILE_DEVPKG}"" ${INSTALLFILE_SHLPKG}"
+
+exit 0
Property changes on: trunk/packages/libgenome/trunk/debian/d-shlibmove
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/packages/libgenome/trunk/debian/rules
===================================================================
--- trunk/packages/libgenome/trunk/debian/rules 2008-04-18 10:01:39 UTC (rev 1795)
+++ trunk/packages/libgenome/trunk/debian/rules 2008-04-18 18:42:23 UTC (rev 1796)
@@ -16,7 +16,7 @@
# /bin/sh debian/debug/
mv debian/tmp/usr/include/*/* debian/tmp/usr/include/
# cp -a doc/html/* debian/tmp/usr/share/doc/html
- d-shlibmove --commit \
+ /bin/bash debian/d-shlibmove --commit \
--movedev "debian/tmp/usr/include/$(name)" usr/include/$(name)-$(version) \
--movedev "$(name)-$(version).pc" usr/share/pkgconfig \
debian/tmp/usr/lib/$(name)-$(version).so
More information about the debian-med-commit
mailing list