From 7baa16f251a9f21f838348be77a8a369c6cb366c Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sun, 5 Feb 2012 20:33:51 +0000 Subject: Extend dh_xine for out-of-tree plugins. --HG-- rename : debian/dh_xine => debian/dh_xine.in --- debian/dh_xine | 80 -------------------------------------------------- debian/dh_xine.in | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ debian/rules | 7 +++-- 3 files changed, 93 insertions(+), 82 deletions(-) delete mode 100644 debian/dh_xine create mode 100644 debian/dh_xine.in diff --git a/debian/dh_xine b/debian/dh_xine deleted file mode 100644 index 1ae22bd9b..000000000 --- a/debian/dh_xine +++ /dev/null @@ -1,80 +0,0 @@ -#! /usr/bin/perl -w - -=head1 NAME - -dh_xine - calculates xine-lib dependencies - -=cut - -use strict; -use Debian::Debhelper::Dh_Lib; - -=head1 SYNOPSIS - -B [S>] [S>] - -=head1 DESCRIPTION - -dh_xine is a debhelper program that is responsible for generating the -${xine-x:Depends} and ${xine-console:Depends} substitutions and adding them -to substvars files. - -Each xine-lib front end is required to have one of these two substvars -listed in its Depends line in debian/control. Using package names directly -will, sooner or later, break. - -By listing package name suffixes, you can generate dependencies and -recommendations (almost) at will. If you don't specify any, then 'x' and -'console' are used, generating xine-x:Depends and xine-console:Depends. - -=head1 EXAMPLES - -dh_xine is usually called indirectly in a rules file via the dh command. - - %: - dh --with xine $@ - -It can also be called directly, prior to calling dh_gencontrol. - -=head1 CONFORMS TO - -Debian policy, version 3.8.1 - -=cut - -init (); - -no locale; - -my @suffix; - -foreach my $suffix (@ARGV) { - if ($suffix =~ /^[-[:lower:]]*$/) { - push @suffix, $suffix; - } else { - warn "bad package name suffix: $suffix"; - } -} - -@suffix = ('x', 'console') if $#suffix < 0; - -foreach my $package (@{$dh{DOPACKAGES}}) { - my $tmp = tmpdir ($package); - - foreach my $suffix (@suffix) { - delsubstvar($package, "xine-$suffix:Depends"); - addsubstvar ($package, "xine-$suffix:Depends", "libxine1-$suffix"); - } -} - -=head1 SEE ALSO - -L - -This program is not a part of debhelper. - -=head1 AUTHOR - -Darren Salt - -=cut diff --git a/debian/dh_xine.in b/debian/dh_xine.in new file mode 100644 index 000000000..7c9f28caf --- /dev/null +++ b/debian/dh_xine.in @@ -0,0 +1,88 @@ +#! /usr/bin/perl -w + +=head1 NAME + +dh_xine - calculates xine-lib dependencies + +=cut + +use strict; +use Debian::Debhelper::Dh_Lib; + +=head1 SYNOPSIS + +B [S>] [S>] + +=head1 DESCRIPTION + +dh_xine is a debhelper program that is responsible for generating the +${xine-x:Depends} and ${xine-console:Depends} substitutions and adding them +to substvars files. + +Each xine-lib front end is required to have one of these two substvars +listed in its Depends line in debian/control. Using package names directly +will, sooner or later, break. + +By listing package name suffixes, you can generate dependencies and +recommendations (almost) at will. If you don't specify any, then 'x' and +'console' are used, generating xine-x:Depends and xine-console:Depends. + +'-' generates xine:Depends which contains a dependency on libxine1 which is +suitable for use by out-of-tree plugins. + +=head1 EXAMPLES + +dh_xine is usually called indirectly in a rules file via the dh command. + + %: + dh --with xine $@ + +It can also be called directly, prior to calling dh_gencontrol. + +=head1 CONFORMS TO + +Debian policy, version 3.8.1 + +=cut + +init (); + +no locale; + +my @suffix; + +foreach my $suffix (@ARGV) { + if ($suffix =~ /^[-[:lower:]]*$/) { + push @suffix, $suffix; + } else { + warn "bad package name suffix: $suffix"; + } +} + +@suffix = ('x', 'console') if $#suffix < 0; + +foreach my $package (@{$dh{DOPACKAGES}}) { + my $tmp = tmpdir ($package); + + foreach my $suffix (@suffix) { + if ($suffix eq '-') { + delsubstvar($package, "xine:Depends"); + addsubstvar ($package, "xine:Depends", "libxine1 (>= @VERSION@)"); + } else { + delsubstvar($package, "xine-$suffix:Depends"); + addsubstvar ($package, "xine-$suffix:Depends", "libxine1-$suffix"); + } + } +} + +=head1 SEE ALSO + +L + +This program is not a part of debhelper. + +=head1 AUTHOR + +Darren Salt + +=cut diff --git a/debian/rules b/debian/rules index 8c90cbff1..446f6e9cb 100755 --- a/debian/rules +++ b/debian/rules @@ -117,7 +117,7 @@ update-config-sub-guess: clean: dh_testdir dh_testroot - rm -f build-stamp configure-stamp po/*.gmo po/stamp-po + rm -f build-stamp configure-stamp po/*.gmo po/stamp-po debian/dh_xine if test -f .noauto; then \ [ ! -f Makefile ] || $(MAKE) distclean; \ else \ @@ -125,7 +125,10 @@ clean: fi dh_clean -install: build +debian/dh_xine: debian/dh_xine.in + sed -e's/@VERSION@/'$(shell dpkg-parsechangelog -c1 | sed -e '/^Version:/! d; s/^.* //; s/-[^-]*$$//')'/' $< >$@ + +install: build debian/dh_xine dh_testdir dh_testroot dh_clean -k -- cgit v1.2.3