[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Failed to stop defining RPATH in libncl



Hi, Andreas


I think there is no way for a binary to pick something not in usr/lib or usr/lib/{triplet}



unless you want to add a new ld.so.conf.d file
cat /etc/ld.so.conf.d/*

(e.g. done by mesa libraries).

Anyhow, I fixed the packaging, and attached a patch to this email.

you should be able to directly git am it.

Please use some fresh packaging for your tools, the current packaging is somewhat bad.

If you want to fix the RPATH issue I guess you are forced to install the shared libraries
into usr/lib or usr/lib/{triplet}, because otherwise with no RPATH, and no ld standard path
the linker won't be able to find them.

http://debomatic-amd64.debian.net/distribution#unstable/libncl/2.1.18+dfsg-1/lintian

cheers,

G.
From 70730ba4b0c76c539f770c89626129a92ab9bd1e Mon Sep 17 00:00:00 2001
From: Gianfranco Costamagna <locutusofborg@debian.org>
Date: Mon, 4 Jan 2016 13:37:09 +0100
Subject: [PATCH] Fix packaging

---
 debian/control            |   3 -
 debian/d-shlibmove        | 296 ----------------------------------------------
 debian/libncl-dev.install |   9 +-
 debian/libncl.install     |   3 +-
 debian/rules              |  32 +----
 5 files changed, 6 insertions(+), 337 deletions(-)
 delete mode 100755 debian/d-shlibmove
 mode change 100755 => 100644 debian/libncl-dev.install
 mode change 100755 => 100644 debian/libncl.install

diff --git a/debian/control b/debian/control
index 693bc4b..7ffc752 100644
--- a/debian/control
+++ b/debian/control
@@ -5,9 +5,6 @@ Section: science
 Priority: optional
 Build-Depends: debhelper (>= 9),
                dh-autoreconf,
-               autotools-dev,
-               d-shlibs,
-               dh-exec,
                python
 Standards-Version: 3.9.6
 Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/libncl.git
diff --git a/debian/d-shlibmove b/debian/d-shlibmove
deleted file mode 100755
index c124e38..0000000
--- a/debian/d-shlibmove
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/bin/bash
-exit 0
-#   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
-
-eval "$(dpkg-architecture -s)"
-
-getname() {
-echo getname
-set -x
-	local SONAMELIBNAME
-	local SONAMEVERSION
-	local SONAME
-	SONAME="$1"
-	SONAMELIBNAME=${SONAME/%.so*}
-	SONAMEVERSION=${SONAME/#*.so.}
-	case "$SONAMELIBNAME" in
-	  *[0-9])
-		RETURN="$SONAMELIBNAME-$SONAMEVERSION"
-		;;
-	  *)
-		RETURN="$SONAMELIBNAME$SONAMEVERSION"
-		;;
-	esac
-set +x
-}
-
-readlibnameinfo() {
-echo readlibnameinfo
-set -x
-	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; "$DEB_HOST_GNU_TYPE-objdump" -p "$LIBNAME" \
-	| sed -n 's/^.*SONAME *//p')
-	getname "$SONAME"
-	SONAMEPKGNAME=$(echo "$RETURN" | tr '[:upper:]_' '[:lower:]-')
-	PK=$(basename "$1" | sed 's/\.so$//')
-	PK_LOWER=$(echo "$PK" | tr '[:upper:]_' '[:lower:]-')
-	REALSO=$(readlink -f "$LIBNAME")
-set +x
-}
-
-check_line() {
-	local PKGNAME="$1"
-	local ENTRYLINE="$2"
-
-	if ! awk '/^Package:.*'"$PKGNAME"'/,/^$/{print}' "$CONTROL" \
-	| perl -0 -pe 's/\n[ \t]+/ /g' \
-	| 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
-
-EXTRALIBS=()
-SUFFIX=
-DEVSUFFIX=
-TRANSITIONSUFFIX=
-
-DOIT=no
-DEVUNVERSIONED=no
-IGNORELIBDEP=no
-INCLUDEA=yes
-INCLUDELA=yes
-MULTIARCH=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;
-		;;
-	  --multiarch)
-		MULTIARCH=yes
-		shift;
-		;;
-	  --extralib)
-		EXTRALIBS+=("$2")
-		shift; shift;
-		;;
-	  --shlibs-local)
-		shift;
-		SHLIBSLOCALVER="$1";
-		shift;
-		;;
-	  --suffix)
-		shift;
-		SUFFIX="$1";
-		shift;
-		;;
-	  --devsuffix)
-		shift;
-		DEVSUFFIX="$1";
-		shift;
-		;;
-	  --devunversioned)
-		DEVUNVERSIONED=yes
-		shift;;
-	  --ignorelibdep)
-		IGNORELIBDEP=yes
-		shift;;
-	  --c102)
-		TRANSITIONSUFFIX="c102"
-		shift;;
-	  --ldbl)
-		TRANSITIONSUFFIX="ldbl"
-		shift;;
-	  --v5)
-		TRANSITIONSUFFIX="v5"
-		shift;;
-	  --include-a)
-		INCLUDEA=yes
-		shift;;
-	  --exclude-a)
-		INCLUDEA=no
-		shift;;
-	  --include-la)
-		INCLUDELA=yes
-		shift;;
-	  --exclude-la)
-		INCLUDELA=no
-		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=()
-for extralib in "${EXTRALIBS[@]}"; do
-	readlibnameinfo "$extralib"
-	DEVLIB_TO_CHECK+=("$extralib")
-	if [ "$INCLUDEA" = "yes" ]; then
-		echo "$(dirname "$extralib")/$PK.a usr/lib" >> "$INSTALLFILE_DEVPKG"
-	fi
-	if [ "$INCLUDELA" = "yes" ]; then
-		echo "$(dirname "$extralib")/$PK.la usr/lib || true" >> "$INSTALLFILE_DEVPKG"
-	fi
-	echo "$(dirname "$extralib")/$PK.so usr/lib" >> "$INSTALLFILE_DEVPKG"
-	echo "$(dirname "$REALSO")/$SONAME usr/lib" >> "$INSTALLFILE_SHLPKG"
-	echo "$REALSO usr/lib" >> "$INSTALLFILE_SHLPKG"
-done
-
-DEVLIB_TO_CHECK+=("$1")
-readlibnameinfo "$1"
-if [ "$DEVUNVERSIONED" = "yes" ]; then
-	PKGDEV="$PK_LOWER$DEVSUFFIX-dev"
-else
-	PKGDEV="$SONAMEPKGNAME$DEVSUFFIX-dev"
-fi
-PKGSHL="$SONAMEPKGNAME$SUFFIX$TRANSITIONSUFFIX"
-
-INSTALLDIR="install -d -m 755"
-echo "$INSTALLDIR debian/$PKGDEV/usr/lib" >> "$execscript"
-echo "$INSTALLDIR debian/$PKGSHL/usr/lib" >> "$execscript"
-if [ "$INCLUDEA" = "yes" ]; then
-	echo "mv $(dirname "$1")/$PK.a debian/$PKGDEV/usr/lib" >> "$execscript"
-fi
-if [ "$INCLUDELA" = "yes" ]; then
-	echo "mv $(dirname "$1")/$PK.la debian/$PKGDEV/usr/lib || true" >> "$execscript"
-fi
-echo "mv $(dirname "$1")/$PK.so debian/$PKGDEV/usr/lib" >> "$execscript"
-echo "mv $(dirname "$REALSO")/$SONAME debian/$PKGSHL/usr/lib" >> "$execscript"
-if [ "$(dirname "$REALSO")/$SONAME" != "$REALSO" ]; then
-	echo "mv $REALSO debian/$PKGSHL/usr/lib" >> "$execscript"
-fi
-if [ -n "$SHLIBSLOCALVER" ]; then
-	echo "echo \"$SONAMELIBNAME $SONAMEVERSION $PKGSHL (>= $SHLIBSLOCALVER)\" >> debian/shlibs.local" >> "$execscript"
-fi
-
-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
-while read A B; do
-	echo "$INSTALLDIR debian/$PKGSHL/$B" >> "$execscript"
-	echo "mv $A debian/$PKGSHL/$B" >> "$execscript"
-done < "$INSTALLFILE_SHLPKG"
-if [ "$INCLUDELA" = "no" ]; then
-	sed -i -e "/^.*\.la usr\/lib || true$/d" "$INSTALLFILE_DEVPKG"
-fi
-while read A B; do
-	echo "$INSTALLDIR debian/$PKGDEV/$B" >> "$execscript"
-	echo "mv $A debian/$PKGDEV/$B" >> "$execscript"
-done < "$INSTALLFILE_DEVPKG"
-
-if [ "$MULTIARCH" = "yes" ]; then
-	sed -i -e "s/usr\/lib\( || true\)\?$/usr\/lib\/$DEB_HOST_MULTIARCH\1/" "$execscript"
-fi
-
-cat "$execscript"
-
-# check the syntax of the control file.
-CHECK_ERROR=false
-
-if ! [ "$DEVUNVERSIONED" = "yes" ]; then
-	check_line "$PKGDEV" "Provides:.*$PK_LOWER-dev"
-	check_line "$PKGDEV" "Conflicts:.*$PK_LOWER-dev"
-fi
-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\)"
-if ! [ "$IGNORELIBDEP" = "yes" ]; then
-	check_line "$PKGDEV" "Depends:.*$PKGSHL"
-fi
-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
diff --git a/debian/libncl-dev.install b/debian/libncl-dev.install
old mode 100755
new mode 100644
index 75cd65b..649a97b
--- a/debian/libncl-dev.install
+++ b/debian/libncl-dev.install
@@ -1,5 +1,4 @@
-#!/usr/bin/dh-exec
-debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/ncl/libncl.so	/usr/lib/${DEB_HOST_MULTIARCH}/
-debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/ncl/*.a	/usr/lib/${DEB_HOST_MULTIARCH}/
-debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig	/usr/lib/${DEB_HOST_MULTIARCH}/
-debian/tmp/usr/include					/usr
+usr/lib/*/ncl/libncl.so
+usr/lib/*/ncl/libncl.a
+usr/lib/*/pkgconfig
+usr/include
diff --git a/debian/libncl.install b/debian/libncl.install
old mode 100755
new mode 100644
index 9c79585..3f4b3e1
--- a/debian/libncl.install
+++ b/debian/libncl.install
@@ -1,2 +1 @@
-#!/usr/bin/dh-exec
-debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/ncl/*[0-9].so	/usr/lib/${DEB_HOST_MULTIARCH}
+usr/lib/*/ncl/libncl-*.so
diff --git a/debian/rules b/debian/rules
index 2dedfb3..10ea35d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,41 +1,11 @@
 #!/usr/bin/make -f
 
-# DH_VERBOSE := 1
-
-# some helpful variables - uncomment them if needed
-# shamelessly stolen from http://jmtd.net/log/awk/
-#DEBVERS        := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
-#VERSION        := $(shell echo '$(DEBVERS)' | sed -e 's/^[0-9]*://' -e 's/-.*//')
-#DEBFLAVOR      := $(shell dpkg-parsechangelog | awk '/^Distribution:/ {print $$2}')
-#DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
-#DEBIAN_BRANCH  := $(shell awk 'BEGIN{FS="[= ]+"} /debian-branch/ {print $$2}' debian/gbp.conf)
-#GIT_TAG        := $(subst ~,_,$(VERSION))
-
-# alternatively to manually set those variables, you can
-#  include /usr/share/dpkg/default.mk
-# and use what is set there.
-
 %:
-	dh $@ --with autotools_dev,autoreconf
+	dh $@ --with autoreconf
 
 override_dh_clean:
 	dh_clean
 	find . -name ".roundTripNCL*" -delete
 
-do_not_override_dh_auto_configure:
-	dh_auto_configure
-	# remove rpath specification since I failed to patch the Build-System properly
-	sed -i 's/ -rpath $(pkglibdir)//' ncl/Makefile.in
-	# Throw error if rpath remains ...
-	if grep -- ' -rpath' ncl/Makefile.in ; then exit 1 ; fi
-
-override_dh_install:
-	dh_install
-	bash debian/d-shlibmove --commit \
-		    --multiarch \
-		    --devunversioned \
-		    --movedev "debian/tmp/usr/include/ncl/*.h" usr/include/ncl \
-                        debian/tmp/usr/lib/*/ncl/libncl.so
-
 get-orig-source:
 	uscan --verbose --force-download --repack --compression xz
-- 
2.5.0


Reply to: