Package: devscripts
Version: 2.10.27
Severity: wishlist
Not using equivs would be great. I have patched mk-build-deps to not
use it, but to avoid parsing of arch-specific dependencies (which I
presume equivs did previously) I used Dpkg::Deps instead.
It cannot be used while reading from apt-cache, but I think that using
apt-cache to get information instead of debian/control isn't useful
anyway.
Attached is a patch that does this (rather hacky).
-- Package-specific info:
--- /etc/devscripts.conf ---
--- ~/.devscripts ---
DEBUILD_DPKG_BUILDPACKAGE_OPTS="-i -ICVS -I.svn"
DEBUILD_PRESERVE_ENVVARS="DISPLAY"
DEBUILD_LINTIAN=yes
DEBUILD_LINTIAN_OPTS=-i
DEBCHANGE_RELEASE_HEURISTIC=changelog
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.25-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages devscripts depends on:
ii dpkg-dev 1.14.19 package building tools for Debian
ii libc6 2.7-11 GNU C Library: Shared libraries
ii perl 5.10.0-10 Larry Wall's Practical Extraction
Versions of packages devscripts recommends:
pn at <none> (no description available)
ii bsd-mailx [mailx] 8.1.2-0.20071201cvs-3 A simple mail user agent
ii bzr 1.5-1 easy to use distributed version co
ii curl 7.18.1-1 Get a file from an HTTP, HTTPS or
ii cvs 1:1.12.13-11 Concurrent Versions System
ii dctrl-tools 2.12 Command-line tools to process Debi
ii debian-keyring 2007.12.04 GnuPG (and obsolete PGP) keys of D
pn debian-maintainers <none> (no description available)
ii dput 0.9.2.32 Debian package upload tool
ii equivs 2.0.7-0.1 Circumvent Debian package dependen
ii fakeroot 1.9.5 Gives a fake root environment
ii git-core 1:1.5.5.1-1 fast, scalable, distributed revisi
ii gnupg 1.4.6-3 GNU privacy guard - a free PGP rep
ii iceweasel [www-bro 2.0.0.14-2 lightweight web browser based on M
ii konqueror [www-bro 4:3.5.9.dfsg.1-2+b1 KDE's advanced file manager, web b
ii libauthen-sasl-per 2.11-1 Authen::SASL - SASL Authentication
ii libcrypt-ssleay-pe 0.57-1+b1 Support for https protocol in LWP
ii libparse-debcontro 2.005-2 Easy OO parsing of Debian control-
ii libsoap-lite-perl 0.71-2 Client and server side SOAP implem
ii libterm-size-perl 0.2-4+b1 Perl extension for retrieving term
ii libtimedate-perl 1.1600-9 Time and date functions for Perl
ii liburi-perl 1.35.dfsg.1-1 Manipulates and accesses URI strin
ii libwww-perl 5.812-1 WWW client/server library for Perl
pn libyaml-syck-perl <none> (no description available)
ii lintian 1.23.48 Debian package checker
ii lsb-release 3.2-12 Linux Standard Base version report
ii lynx [www-browser] 2.8.6-2 Text-mode WWW Browser
ii mailx 1:20071201-3 Transitional package for mailx ren
ii man-db 2.5.2-1 on-line manual pager
ii mercurial 1.0-4 Scalable distributed version contr
ii openssh-client [ss 1:4.7p1-10 secure shell client, an rlogin/rsh
ii patch 2.5.9-5 Apply a diff file to an original
ii patchutils 0.2.31-4 Utilities to work with patches
ii strace 4.5.15-1.2 A system call tracer
ii subversion 1.4.6dfsg1-4 Advanced version control system
ii unzip 5.52-11 De-archiver for .zip files
ii w3m [www-browser] 0.5.1-5.1+b1 WWW browsable pager with excellent
ii wdiff 0.5-17 Compares two files word by word
ii wget 1.11.2-1 retrieves files from the web
-- no debconf information
--- /usr/bin/mk-build-deps 2008-05-03 12:33:35.000000000 -0400
+++ mk-build-deps 2008-05-22 00:48:19.000000000 -0400
@@ -66,6 +66,8 @@
use warnings;
use Getopt::Long;
use File::Basename;
+use Dpkg::Control;
+use Dpkg::Deps;
my $progname = basename($0);
my ($opt_help, $opt_version);
@@ -81,62 +83,73 @@
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 $build_deps;
my $version;
my $last_line_build_deps;
if (-r $control and -f $control) {
- open CONTROL, $control;
+ my $c = Dpkg::Control->new($control);
+ my $fields = $c->get_source();
+ $name = $fields->{"Source"};
+ my $bd_value = 'build-essential';
+ $bd_value .= ", " . $fields->{"Build-Depends"}
+ if defined $fields->{"Build-Depends"};
+ $bd_value .= ", " . $fields->{"Build-Depends-Indep"}
+ if defined $fields->{"Build-Depends-Indep"};
+ my $bd = Dpkg::Deps::parse($bd_value, reduce_arch => 1);
+ $build_deps = $bd->dump();
}
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;
+ 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;
}
- close CONTROL;
- # Now, running equivs-build:
+ # Now, create the package
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;
+ mkdir $name . "-build-deps" or die "Could not create directory";
+ mkdir $name . "-build-deps/DEBIAN" or die "Could not create directory";
+
+ open( CONTROL, ">", $name . "-build-deps/DEBIAN/control" );
+
+ print CONTROL "Package: $name-build-deps\n";
+ print CONTROL "Architecture: all\n";
+ print CONTROL "Section: devel\n";
+ print CONTROL "Priority: optional\n";
+ print CONTROL "Depends: $build_deps\n";
+ print CONTROL "Version: 1.0\n";
+ print CONTROL "Maintainer: [EMAIL PROTECTED]";
+ print CONTROL "Description: build dependencies for $name\n";
+ print CONTROL " Depencency package to build the '$name' package\n";
+
+ close(CONTROL);
- print EQUIVS "Description: build-dependencies for $name\n" .
- " Depencency package to build the '$name' package\n";
+ system("dpkg-deb", "-b", $name . "-build-deps");
+ system("rm -r $name-build-deps");
- close EQUIVS;
}
sub help {