#! /bin/sh set -e # This script adds "udeb lines" to shlibs files which allows other udebs # to get correct dependencies when built against glibc libraries. # The script was written by Frans Pop . package="$1" shlibs_file="debian/$package/DEBIAN/shlibs" # Skip packages that don't have an shlibs file. # The "cross-subarch" library packages have an shlibs file, but should # not have udeb lines, so skip those as well. if [ ! -r "$shlibs_file" ] || \ echo "$package" | grep -Eq "^libc[0-9.]+-"; then exit 0 fi # $1: regexp to select libraries for which lines should be duplicated # $2: name of the udeb the new line should point to add_udeb_line() { local regexp udeb line lib soname package rest regexp="$1" udeb="$2" if line="$(grep "^$regexp[[:space:]]" $shlibs_file)"; then echo "$line" | while read lib soname package rest; do echo "udeb: $lib $soname $udeb $rest" >>$shlibs_file done fi } W="[^[:space:]]*" # The following lists should match the ones in the *-udeb.install files # in debian/debhelper.in; $W replaces any "*" wildcards there. expr_libc1="ld$W libm-$W libm libdl$W libresolv$W libc-$W libc" expr_libc2="libutil$W libcrypt$W librt$W libpthread$W" expr_nss_dns="libnss_dns$W" expr_nss_files="libnss_files$W" for expr in $expr_libc1 $expr_libc2; do add_udeb_line "$expr" $package-udeb done for expr in $expr_nss_dns; do add_udeb_line "$expr" libnss-dns-udeb done for expr in $expr_nss_files; do add_udeb_line "$expr" libnss-files-udeb done