[Pkg-samba-maint] [samba] 02/03: create symbols and shlibs files in separate script
Ivo De Decker
idd-guest at alioth.debian.org
Sun Sep 22 11:36:01 UTC 2013
This is an automated email from the git hooks/post-receive script.
idd-guest pushed a commit to branch samba_4.0
in repository samba.
commit 1e4ae3c0366425c4c57e0e817ec15ae53c5fdc00
Author: Ivo De Decker <ivo.dedecker at ugent.be>
Date: Tue Sep 10 22:05:25 2013 +0200
create symbols and shlibs files in separate script
this should create correct dependencies for public and private libraries
---
debian/make_shlibs | 57 ++++++++++++++++++++++++++++++++++++++++++++++++
debian/merge_shlibs.pl | 33 ++++++++++++++++++++++++++++
debian/rules | 4 +++-
3 files changed, 93 insertions(+), 1 deletion(-)
diff --git a/debian/make_shlibs b/debian/make_shlibs
new file mode 100755
index 0000000..15e5fd4
--- /dev/null
+++ b/debian/make_shlibs
@@ -0,0 +1,57 @@
+#! /bin/bash
+
+set -e
+
+# this could be done with dpkg-parsechangelog -S, but that only works since
+# dpkg 1.17, so we want to avoid this to enable backports
+DEB_VERSION=`dpkg-parsechangelog |grep ^Version: | awk '{ print $2 }'`
+DEB_HOST_MULTIARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH`
+
+
+make_shlibs() {
+ pkg=$1
+ echo $pkg
+ PKGDIR=debian/$pkg/DEBIAN
+
+ # step 1:
+ # - create symbols files:
+ # - we only want symbols for public libraries (so exclude private
+ # ones)
+ # - we want to fail if new symbols appear, which are not listed in
+ # the symbols file (dpkg-gensymbols -c4)
+ # - create first part of the shlibs file:
+ # for public libraries, we want a weak dependency in the shlibs file
+ dh_makeshlibs -p$pkg -V -X/usr/lib/${DEB_HOST_MULTIARCH}/samba -X/usr/lib/${DEB_HOST_MULTIARCH}/plugin -- -c4
+ [ -e $PKGDIR/shlibs ] && mv $PKGDIR/shlibs $PKGDIR/shlibs.1
+
+ # step 2:
+ # - ignore the symbols file generated by this step (it might contain
+ # private symbols):
+ # - output to /dev/null (-O/dev/null)
+ # - don't print info about new symbols (-q)
+ # - create second part of the shlibs file:
+ # for private libraries, we want a strict dependency in the shlibs
+ # file
+ # this step will generate a strict dependency for all libraries (also
+ # public ones), so afterwards, we will have to merge them
+ dh_makeshlibs -p$pkg -V"$pkg (= ${DEB_VERSION})" -X/usr/lib/${DEB_HOST_MULTIARCH}/plugin -- -q -O/dev/null
+
+ if [ -e $PKGDIR/shlibs ]
+ then
+ mv $PKGDIR/shlibs $PKGDIR/shlibs.2
+ # output shlibs entries from the first file
+ # output shlibs entries from the second file if they are not in the first file
+ debian/merge_shlibs.pl $PKGDIR/shlibs.1 $PKGDIR/shlibs.2 > $PKGDIR/shlibs
+ fi
+ rm -f $PKGDIR/shlibs.1
+ rm -f $PKGDIR/shlibs.2
+
+}
+
+
+for pkg in `dh_listpackages`
+do
+ make_shlibs $pkg
+done
+
+
diff --git a/debian/merge_shlibs.pl b/debian/merge_shlibs.pl
new file mode 100755
index 0000000..f451536
--- /dev/null
+++ b/debian/merge_shlibs.pl
@@ -0,0 +1,33 @@
+#! /usr/bin/perl
+
+use strict;
+
+my $file1 = shift;
+my $file2 = shift;
+
+my $seen = ();
+
+open(FILE1,"< $file1");
+
+while(my $line = <FILE1>) {
+ if ($line =~ m/^(\S+)\s+/) {
+ my $lib = $1;
+ $seen->{$lib} = 1;
+ }
+ print $line;
+}
+close(FILE1);
+
+
+open(FILE2,"< $file2");
+
+while(my $line = <FILE2>) {
+ if ($line =~ m/^(\S+)\s+/) {
+ my $lib = $1;
+ next if ($seen->{$lib});
+ }
+ print $line;
+}
+close(FILE2);
+
+
diff --git a/debian/rules b/debian/rules
index 2c164ae..15ffd0d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -154,7 +154,9 @@ override_dh_gencontrol:
dh_gencontrol -- -Vldb:Depends=$(LDB_DEPENDS)
override_dh_makeshlibs:
- dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/plugin
+ # create symbols and shlibs files in separate wrapper script to deal with
+ # private libraries
+ debian/make_shlibs
override_dh_fixperms:
dh_fixperms
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git
More information about the Pkg-samba-maint
mailing list