[SCM] Debian Qt/KDE packaging tools branch, master, updated. debian/0.6.8

Modestas Vainius modax at alioth.debian.org
Wed Mar 3 02:31:24 UTC 2010


The following commit has been merged in the master branch:
commit 550b98610f45a593dc5c62d87f3d232c4944511f
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Wed Mar 3 04:27:06 2010 +0200

    Add dh_sodeps helper program.
    
    It can be used for autogenering dependencies for library development packages
    based on the targets *.so symlinks point to. Also add dh addon "sopdes" for
    dh_sopdeps.
---
 Makefile                                      |    2 +
 debhelper/Debian/Debhelper/Sequence/sodeps.pm |    3 +
 debhelper/dh_sodeps                           |   99 +++++++++++++++++++++++++
 debian/changelog                              |    3 +
 4 files changed, 107 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 4bbf200..36bdfb8 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,8 @@ install:
 	install -m 0755 $(DEBHELPER_DIR)/dh_sameversiondep $(BINDIR)
 	pod2man $(DEBHELPER_DIR)/dh_movelibkdeinit > $(MANDIR)/man1/dh_movelibkdeinit.1
 	install -m 0755 $(DEBHELPER_DIR)/dh_movelibkdeinit $(BINDIR)
+	pod2man $(DEBHELPER_DIR)/dh_sodeps > $(MANDIR)/man1/dh_sodeps.1
+	install -m 0755 $(DEBHELPER_DIR)/dh_sodeps $(BINDIR)
 	
 	# Debhelper addons
 	cd $(DEBHELPER_DIR) && find Debian -type f -name "*.pm" -exec \
diff --git a/debhelper/Debian/Debhelper/Sequence/sodeps.pm b/debhelper/Debian/Debhelper/Sequence/sodeps.pm
new file mode 100644
index 0000000..9ae6a03
--- /dev/null
+++ b/debhelper/Debian/Debhelper/Sequence/sodeps.pm
@@ -0,0 +1,3 @@
+insert_after("dh_shlibdeps", "dh_sodeps");
+
+1;
diff --git a/debhelper/dh_sodeps b/debhelper/dh_sodeps
new file mode 100755
index 0000000..277678e
--- /dev/null
+++ b/debhelper/dh_sodeps
@@ -0,0 +1,99 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_sodeps - generate library dependencies for development *.so symlinks
+
+=head1 SYNOPSIS
+
+B<dh_sodeps> [S<I<debhelper options>>] [B<-V>I<versioninfo>]
+
+=head1 DESCRIPTION
+
+dh_sodeps is a helper program that generates library dependencies for *.so
+symlinks that are typically found in the library development packages.
+
+It basically looks for F<usr/lib/*.so> in the package build directory, finds
+all local arch specific packages that actually contain targets of those
+symlinks and adds dependencies on the discovered packages to the C<so:Depends>
+substitution variable. Dependencies are strict by default, i.e.
+(=${binary:Version}) if the package containing *.so is arch specific or
+(>=${source:Version}) if it is arch independent.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-V>I<versioninfo>, B<--version-info>=I<versioninfo>
+
+Use the specified version information for dependencies. If this option is not
+specified, dh_sodeps will generate a strict dependency as explained above.
+Please note that you don't need to enclose the value in brackets. dh_sodeps
+will do this automatically.
+
+=item B<-X>I<item>, B<--exclude> I<item>
+
+Do not calculate dependencies for *.so files that contain "item" anywhere in
+their path/filename. You may use this option multiple times to build up a list
+of things to exclude.
+
+=back
+
+=cut
+
+use strict;
+use warnings;
+
+use Debian::Debhelper::Dh_Lib;
+
+my $opt_verinfo;
+
+init(options => {
+    'version-info|V' => \$opt_verinfo,
+});
+
+exit 0 unless @{$dh{DOPACKAGES}};
+
+my @packages = getpackages("arch");
+
+foreach my $package (@{$dh{DOPACKAGES}}) {
+    my $tmpdir = tmpdir($package);
+    my @solinks = grep { -l $_ } glob("$tmpdir/usr/lib/*.so");
+
+    if (@solinks) {
+        my $arch = package_arch($package);
+        my $verinfo;
+
+        if (defined $opt_verinfo) {
+            $verinfo = $opt_verinfo;
+        } elsif ($arch eq "all") {
+            $verinfo = '>= ${source:Version}';
+        } else {
+            $verinfo = '= ${binary:Version}';
+        }
+
+        foreach my $solink (@solinks) {
+            next if excludefile($solink);
+
+            my $target = readlink($solink);
+            foreach my $p (@packages) {
+                next if $p eq $package;
+                if (-e "debian/$p/usr/lib/$target") {
+                    addsubstvar($package, "so:Depends", $p, $verinfo);
+                }
+            }
+        }
+    }
+}
+
+exit 0;
+
+=head1 SEE ALSO
+
+L<debhelper(7)>
+
+=head1 AUTHOR
+
+Modestas Vainius <modax at debian.org>
+
+=cut
diff --git a/debian/changelog b/debian/changelog
index 68710cf..2cc2ceb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
 pkg-kde-tools (0.6.8) UNRELEASED; urgency=low
 
+  * Add dh_sodeps helper program for autogenering dependencies for library
+    development packages based on the targets *.so symlinks point to.
+  * Add dh addon "sopdes" for dh_sopdeps.
 
  -- Modestas Vainius <modax at debian.org>  Wed, 03 Mar 2010 04:23:55 +0200
 

-- 
Debian Qt/KDE packaging tools



More information about the pkg-kde-commits mailing list