Package: googleearth-package
Version: 0.5.4
Severity: minor
Tags: patch

Hi, I made a few changes in the make-googleearth-package script, there are several fixes:

Ignore warnings from dpkg-shlibdeps, at least on my computer there a lot of "dependency on library could be avoided" warnings on each dpkg-shlibsdeps invocation and there are lot of those.

Removed bad line caused by libcolada in shlibs.local.

Improved handling of temporary directory. Use unique directories in /tmp and remove them if the script is aborted.

Set unknown as maintainer if it is not given elsewhere.

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.27 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=sv_SE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages googleearth-package depends on:
ii  bzip2                         1.0.5-1    high-quality block-sorting
ii  curl                          7.18.2-8   Get a file from an HTTP, H
ii  dpkg-dev                      1.14.24    Debian package development
ii  fakeroot                      1.12.1     Gives a fake root envir
ii  file                          4.26-2     Determines file type using
ii  wget                          1.11.4-2   retrieves files from the
ii  x11-common                    1:7.3+18   X Window System (X.Org)

googleearth-package recommends no packages.

googleearth-package suggests no packages.

-- no debconf information
--- /usr/bin/make-googleearth-package	2008-04-18 03:53:22.000000000 +0200
+++ /tmp/make	2009-01-11 11:51:18.000000000 +0100
@@ -40,8 +40,8 @@
 }
 
 function download() {
-  local wget=`which wget`
-  local curl=`which curl`
+  local wget=$(which wget)
+  local curl=$(which curl)
   local downloader
 
   if [ -x $wget ]; then
@@ -87,8 +87,8 @@
 }
 
 function parse_args() {
-  OPT_FULLNAME="$DEBFULLNAME"
-  OPT_EMAIL="$DEBEMAIL"
+  OPT_FULLNAME="${DEBFULLNAME:-unknown}"
+  OPT_EMAIL="${DEBEMAIL:-unknown}"
   OPT_FILE="$GoogleEarth_bin"
   OPT_QUIET=0
   for ((;$#>0;)); do
@@ -281,7 +281,7 @@
 function make_control() {
   local elfs=$(find .. -type f -print0 | xargs -0 file | awk '$2 ~ /^ELF/ {print $1}' | sed 's/:$//')
 
-  local sonames=$(for elf in $elfs; do objdump -p "$elf" | awk '$1 == "SONAME" && $2 !~ /^\.\// {print $2}'; done)
+  local sonames=$(for elf in $elfs; do objdump -p "$elf" | awk '$1 == "SONAME" && $2 !~ /^\.\// && $2 ~ /\.so\.[0-9]/ {print $2}'; done)
   for soname in $sonames; do sed -e 's/\.so\./ /' <<< "$soname"; done > shlibs.local
 
   mkdir debian/
@@ -292,7 +292,7 @@
 Depends:
 EOF
 
-  local deps=$(for elf in $elfs; do dpkg-shlibdeps -O -Lshlibs.local "$elf" | sed -e 's/^shlibs:Depends=//' -e 's/, /\n/g'; done | sort -u)
+  local deps=$(for elf in $elfs; do echo >&2 Checking shlib deps: $(basename $elf); LD_LIBRARY_PATH="../usr/lib/googleearth" dpkg-shlibdeps --warnings=0 -O -Lshlibs.local "$elf" | sed -e 's/^shlibs:Depends=//' -e 's/, /\n/g'; done | sort -u)
   local depends=$(while read dep; do echo -n "$dep, "; done <<< "$deps" | sed 's/, $//')
 
   # clean up dpkg-shlibdeps helper files
@@ -324,14 +324,15 @@
 function build_package() {
   umask 0022
 
-  local instdir="`pwd`/googleearth-deb"
-  local tmpdir="`pwd`/googleearth-tmp"
+  local instdir="$(mktemp -dt googleearth-deb.XXXX || exit 1)"
+  local tmpdir="$(mktemp -dt googleearth-tmp.XXXX || exit 1)"
 
-  rm -rf "$instdir" "$tmpdir"
-  mkdir "$instdir" "$tmpdir"
+  trap 'rm -rf "$tmpdir" "$instdir"; exit 1' 1 2 3 13 15
+  trap 'rm -rf "$tmpdir" "$instdir"' 0
 
-  ln "$OPT_FILE" "$tmpdir"
-  sh "$OPT_FILE" --tar -xvf -C "$tmpdir" >&2
+  ln "$OPT_FILE" "$tmpdir/"
+  echo Unpacking
+  sh "$OPT_FILE" --tar -xf -C "$tmpdir" >&2
 
   cd "$instdir"
   mkdir -p usr/lib/googleearth
@@ -394,7 +395,6 @@
   cd "$instdir"
   find usr/lib -type f -print0 | xargs -0 chmod 644
   chmod 755 usr/lib/googleearth/googleearth-bin
-  chmod 755 usr/lib/googleearth/linux/mailto-scripts/*
 
   cd ..
   find "$instdir" -type d -print0 | xargs -0 chmod 755

Reply via email to