Author: adam-guest
Date: 2008-04-05 10:35:51 +0000 (Sat, 05 Apr 2008)
New Revision: 1238

Added:
   trunk/scripts/mk-build-deps.pl
Modified:
   trunk/README
   trunk/debian/changelog
   trunk/debian/control
   trunk/po4a/devscripts-po4a.conf
   trunk/scripts/Makefile
Log:
* mk-build-deps: New script by Vincent Fourmond to build a binary package
  satisfying the build-dependencies of a given package (Closes: #474302)
* README, debian/control:
  + Add equivs to Suggests (for mk-build-deps)


Modified: trunk/README
===================================================================
--- trunk/README        2008-04-04 19:49:15 UTC (rev 1237)
+++ trunk/README        2008-04-05 10:35:51 UTC (rev 1238)
@@ -165,6 +165,10 @@
 - mergechanges: merge .changes files from the same release but built
   on different architectures.
 
+- mk-build-deps [equivs]: Given a package name and/or control
+  file, generate a binary package which may be installed to satisfy the
+  build-dependencies of the given package.
+
 - nmudiff [patchutils, mutt]: prepare a diff of this version
   (presumably an NMU against the previously released version (as per
   the changelog) and submit the diff to the BTS.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-04-04 19:49:15 UTC (rev 1237)
+++ trunk/debian/changelog      2008-04-05 10:35:51 UTC (rev 1238)
@@ -42,11 +42,15 @@
   * dscverify:
     + Add debian-maintainers to the default set of keyrings
     + Add a --no-default-keyrings option to override the default keyrings
+  * mk-build-deps: New script by Vincent Fourmond to build a binary package
+    satisfying the build-dependencies of a given package (Closes: #474302)
   * tagpending: Allow the mail sent to the BTS to be displayed and (assuming
     --noact is not in effect) confirmed before sending
   * who-uploads: Mention the debian-maintainers keyring in --help
-  * README, debian/control: Add libsasl-authen-perl to Suggests and the
-    description of bts, to support SMTP authentication
+  * README, debian/control:
+    + Add libsasl-authen-perl to Suggests and the description of bts, to
+      support SMTP authentication
+    + Add equivs to Suggests (for mk-build-deps)
 
  -- Adam D. Barratt <[EMAIL PROTECTED]>  Tue, 25 Mar 2008 18:51:59 +0000
 

Modified: trunk/debian/control
===================================================================
--- trunk/debian/control        2008-04-04 19:49:15 UTC (rev 1237)
+++ trunk/debian/control        2008-04-05 10:35:51 UTC (rev 1238)
@@ -20,7 +20,7 @@
 Recommends: fakeroot
 Suggests: devscripts-el, at, build-essential, curl | wget, cvs-buildpackage,
  cvs | subversion | svk | tla | bzr | git-core | mercurial, dctrl-tools,
- debian-keyring, debian-maintainers, dupload (>=2.1) | dput,
+ debian-keyring, debian-maintainers, dupload (>=2.1) | dput, equivs,
  gnupg (>= 1.0.7), gnuplot, libauthen-sasl-perl, libcrypt-ssleay-perl,
  libdigest-md5-perl, libfile-desktopentry-perl, libsoap-lite-perl,
  libterm-size-perl, libtimedate-perl, liburi-perl, libwww-perl, lintian,
@@ -91,6 +91,9 @@
   - mass-bug: mass-file bug reports [mailx | mailutils]
   - mergechanges: merge .changes files from a package built on different
     architectures
+  - mk-build-deps [equivs]: Given a package name and/or control
+    file, generate a binary package which may be installed to satisfy the
+    build-dependencies of the given packages.
   - nmudiff: mail a diff of the current package against the previous version
     to the BTS to assist in tracking NMUs [patchutils, mutt]
   - plotchangelog: view a nice plot of the data in a changelog file

Modified: trunk/po4a/devscripts-po4a.conf
===================================================================
--- trunk/po4a/devscripts-po4a.conf     2008-04-04 19:49:15 UTC (rev 1237)
+++ trunk/po4a/devscripts-po4a.conf     2008-04-05 10:35:51 UTC (rev 1238)
@@ -85,6 +85,8 @@
        fr:fr/mass-bug.fr.pl add_fr:add_fr/translator_pod.add
 [type:man] ../scripts/mergechanges.1 \
        fr:fr/mergechanges.fr.1 add_fr:add_fr/translator_man.add
+[type:pod] ../scripts/mk-build-deps.pl \
+       fr:fr/mk-build-deps.fr.pl add_fr:add_fr/translator_pod.add
 [type:man] ../scripts/nmudiff.1 \
        fr:fr/nmudiff.fr.1 add_fr:add_fr/translator_man.add
 [type:man] ../scripts/plotchangelog.1 \

Modified: trunk/scripts/Makefile
===================================================================
--- trunk/scripts/Makefile      2008-04-04 19:49:15 UTC (rev 1237)
+++ trunk/scripts/Makefile      2008-04-05 10:35:51 UTC (rev 1238)
@@ -15,7 +15,7 @@
 
 GEN_MAN1S = bts.1 chdist.1 debcheckout.1 debcommit.1 deb-reversion.1 \
            desktop2menu.1 dget.1 licensecheck.1 mass-bug.1 rmadison.1 \
-           svnpath.1 tagpending.1 build-rdeps.1
+           svnpath.1 tagpending.1 build-rdeps.1 mk-build-deps.1
 
 BINDIR = /usr/bin
 LIBDIR = /usr/lib/devscripts

Added: trunk/scripts/mk-build-deps.pl
===================================================================
--- trunk/scripts/mk-build-deps.pl                              (rev 0)
+++ trunk/scripts/mk-build-deps.pl      2008-04-05 10:35:51 UTC (rev 1238)
@@ -0,0 +1,162 @@
+#!/usr/bin/perl
+
+# mk-build-deps: make a dummy package to satisfy build-deps of a package
+# Copyright 2008 by Vincent Fourmond
+#
+# 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+# Changes:
+# * (Vincent Fourmond 4/4/2008): now take Build-Depends-Indep
+#   into consideration
+
+=head1 NAME
+
+mk-build-deps - build a package satisfying a package's build-dependencies
+
+=head1 SYNOPSIS
+
+B<mk-build-deps> --help|--version
+
+B<mk-build-deps> <control file | package name> [...]
+
+=head1 DESCRIPTION
+
+Given a package name and/or control file, B<mk-build-deps>
+will use B<equivs> to generate a binary package which may be installed to
+satisfy the build-dependencies of the given package.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-h>, B<--help>
+
+Show a summary of options.
+
+=item B<-v>, B<--version>
+
+Show version and copyright information.
+
+=back
+
+=head1 AUTHOR
+
+B<mk-build-deps> is copyright by Vincent Fourmond and was modified for the
+devscripts package by Adam D. Barratt <[EMAIL PROTECTED]>.
+
+This program comes with ABSOLUTELY NO WARRANTY.
+You are free to redistribute this code under the terms of the GNU
+General Public License, version 2 or later.
+
+=cut
+
+use strict;
+use warnings;
+use Getopt::Long;
+use File::Basename;
+
+my $progname = basename($0);
+my ($opt_help, $opt_version);
+my $control;
+
+GetOptions("help|h" => \$opt_help,
+           "version|v" => \$opt_version,
+           )
+    or die "Usage: $progname <control file | package name> [...]\nRun 
$progname --help for more details\n";
+
+if ($opt_help) { help(); exit 0; }
+if ($opt_version) { version(); exit 0; }
+
+die "Usage: $progname <control file | package name> [...]\nRun $progname 
--help for more details\n" unless @ARGV;
+
+system("command -v equivs-build >/dev/null 2>&1");
+if ($?) {
+    die "$progname: You must have equivs installed to use this program.\n";
+}
+
+while ($control = shift) {
+    my $name;
+    my $build_deps = "";
+    my $version;
+    my $last_line_build_deps;
+
+    if( -r $control) {
+       open CONTROL, $control;
+    }
+    else {
+       open CONTROL, "apt-cache showsrc $control |";
+    }
+
+    while (<CONTROL>) {
+       if (/^Package:\s*(\S+)/ && !$name) {
+           $name = $1;
+       }
+       if (/^Version:\s*(\S+)/) {
+           $version = $1;
+       }
+       if (/^Build-Depends(?:-Indep)?:\s*(.*)/) {
+           $build_deps .= $1;
+           $last_line_build_deps = 1;
+       }
+       elsif (/^(\S+):/) {
+           $last_line_build_deps = 0;
+       }
+       elsif(/^\s+(.*)/ && $last_line_build_deps) {
+           $build_deps .= $1;
+       }
+    }
+    close CONTROL;
+
+    # Now, running equivs-build:
+
+    die "$progname: Unable to find package name in '$control'\n" unless $name;
+    die "$progname: Unable to find build-deps for $name\n" unless $build_deps;
+
+    open EQUIVS, "| equivs-build -"
+       or die "$progname: Failed to execute equivs-build: $!\n";
+    print EQUIVS "Section: devel\n" .
+       "Priority: optional\n".
+       "Standards-Version: 3.7.3\n\n".
+       "Package: ".$name."-build-deps\n".
+       "Depends: $build_deps\n";
+    print EQUIVS "Version: $version\n" if $version;
+
+    print EQUIVS "Description: build-dependencies for $name\n" .
+       " Depencency package to build the '$name' package\n";
+
+    close EQUIVS;
+}
+
+sub help {
+   print <<"EOF";
+Usage: $progname <control file> | <package name> [...]
+Valid options are:
+   --help, -h             Display this message
+   --version, -v          Display version and copyright info
+EOF
+}
+
+sub version {
+    print <<"EOF";
+This is $progname, from the Debian devscripts package, version ###VERSION###
+Copyright (C) 2008 Vincent Fourmond
+
+This program comes with ABSOLUTELY NO WARRANTY.
+You are free to redistribute this code under the terms of the
+GNU General Public License, version 2, or (at your option) any
+later version.
+EOF
+}
+



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to