2011-12-21 23:28:59 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Dpkg < Formula
|
2013-08-07 22:18:43 +00:00
|
|
|
homepage 'https://wiki.debian.org/Teams/Dpkg'
|
2014-05-07 02:32:04 +00:00
|
|
|
url 'http://ftp.debian.org/debian/pool/main/d/dpkg/dpkg_1.17.9.tar.xz'
|
|
|
|
sha1 '9e49682e77929217da9b88f570be192c4276506a'
|
2011-12-21 23:28:59 +00:00
|
|
|
|
|
|
|
depends_on 'pkg-config' => :build
|
2011-12-23 03:01:24 +00:00
|
|
|
depends_on 'gnu-tar'
|
2011-12-21 23:28:59 +00:00
|
|
|
|
2011-12-23 03:01:24 +00:00
|
|
|
# Fixes the PERL_LIBDIR.
|
2014-03-18 17:13:32 +00:00
|
|
|
patch :DATA
|
2011-12-21 23:28:59 +00:00
|
|
|
|
|
|
|
def install
|
2014-05-09 00:09:44 +00:00
|
|
|
# We need to specify a recent gnutar, otherwise various dpkg C programs will
|
|
|
|
# use the system 'tar', which will fail because it lacks certain switches.
|
|
|
|
ENV["TAR"] = Formula["gnu-tar"].opt_bin/"gtar"
|
2011-12-21 23:28:59 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
2013-08-07 22:18:43 +00:00
|
|
|
"--disable-dselect",
|
2011-12-21 23:28:59 +00:00
|
|
|
"--disable-linker-optimisations",
|
2013-08-07 22:18:43 +00:00
|
|
|
"--disable-start-stop-daemon",
|
|
|
|
"--disable-update-alternatives"
|
2011-12-21 23:28:59 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2013-03-11 21:57:04 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
This installation of dpkg is not configured to install software, so
|
|
|
|
commands such as `dpkg -i`, `dpkg --configure` will fail.
|
|
|
|
EOS
|
|
|
|
end
|
2011-12-21 23:28:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/configure b/configure
|
2014-05-07 02:32:04 +00:00
|
|
|
index 668eefd..2f54912 100755
|
2011-12-21 23:28:59 +00:00
|
|
|
--- a/configure
|
|
|
|
+++ b/configure
|
2014-05-07 02:32:04 +00:00
|
|
|
@@ -8875,9 +8875,7 @@ if test "$PERL" = "no" || test ! -x "$PERL"; then
|
2011-12-21 23:28:59 +00:00
|
|
|
fi
|
2013-08-07 22:18:43 +00:00
|
|
|
# Let the user override the variable.
|
|
|
|
if test -z "$PERL_LIBDIR"; then
|
2011-12-21 23:28:59 +00:00
|
|
|
-PERL_LIBDIR=$($PERL -MConfig -e 'my $r = $Config{vendorlibexp};
|
|
|
|
- $r =~ s/$Config{vendorprefixexp}/\$(prefix)/;
|
|
|
|
- print $r')
|
2013-08-07 22:18:43 +00:00
|
|
|
+PERL_LIBDIR="$prefix/perl"
|
|
|
|
fi
|
|
|
|
|
2011-12-21 23:28:59 +00:00
|
|
|
|
2013-08-20 02:00:24 +00:00
|
|
|
diff --git a/scripts/Dpkg/Checksums.pm b/scripts/Dpkg/Checksums.pm
|
2014-05-07 02:32:04 +00:00
|
|
|
index 07a917c..86d267a 100644
|
2013-08-20 02:00:24 +00:00
|
|
|
--- a/scripts/Dpkg/Checksums.pm
|
|
|
|
+++ b/scripts/Dpkg/Checksums.pm
|
2014-05-07 02:32:04 +00:00
|
|
|
@@ -51,15 +51,15 @@ about supported checksums.
|
2013-08-20 02:00:24 +00:00
|
|
|
|
|
|
|
my $CHECKSUMS = {
|
|
|
|
md5 => {
|
|
|
|
- program => [ 'md5sum' ],
|
|
|
|
+ program => [ 'md5', '-q' ],
|
|
|
|
regex => qr/[0-9a-f]{32}/,
|
|
|
|
},
|
|
|
|
sha1 => {
|
|
|
|
- program => [ 'sha1sum' ],
|
|
|
|
+ program => [ 'shasum', '-a', '1' ],
|
|
|
|
regex => qr/[0-9a-f]{40}/,
|
|
|
|
},
|
|
|
|
sha256 => {
|
|
|
|
- program => [ 'sha256sum' ],
|
|
|
|
+ program => [ 'shasum', '-a', '256' ],
|
|
|
|
regex => qr/[0-9a-f]{64}/,
|
|
|
|
},
|
|
|
|
};
|
2013-10-17 16:05:38 +00:00
|
|
|
diff --git a/scripts/Dpkg/Source/Archive.pm b/scripts/Dpkg/Source/Archive.pm
|
2014-05-07 02:32:04 +00:00
|
|
|
index 6257702..af6101d 100644
|
2013-10-17 16:05:38 +00:00
|
|
|
--- a/scripts/Dpkg/Source/Archive.pm
|
|
|
|
+++ b/scripts/Dpkg/Source/Archive.pm
|
2014-05-07 02:32:04 +00:00
|
|
|
@@ -48,7 +48,7 @@ sub create {
|
2013-10-17 16:05:38 +00:00
|
|
|
$spawn_opts{from_pipe} = \*$self->{tar_input};
|
|
|
|
# Call tar creation process
|
|
|
|
$spawn_opts{delete_env} = [ 'TAR_OPTIONS' ];
|
|
|
|
- $spawn_opts{exec} = [ 'tar', '--null', '-T', '-', '--numeric-owner',
|
|
|
|
+ $spawn_opts{exec} = [ 'gtar', '--null', '-T', '-', '--numeric-owner',
|
|
|
|
'--owner', '0', '--group', '0',
|
|
|
|
@{$opts{options}}, '-cf', '-' ];
|
|
|
|
*$self->{pid} = spawn(%spawn_opts);
|
2014-05-07 02:32:04 +00:00
|
|
|
@@ -125,7 +125,7 @@ sub extract {
|
|
|
|
|
2013-10-17 16:05:38 +00:00
|
|
|
# Call tar extraction process
|
|
|
|
$spawn_opts{delete_env} = [ 'TAR_OPTIONS' ];
|
|
|
|
- $spawn_opts{exec} = [ 'tar', '--no-same-owner', '--no-same-permissions',
|
|
|
|
+ $spawn_opts{exec} = [ 'gtar', '--no-same-owner', '--no-same-permissions',
|
|
|
|
@{$opts{options}}, '-xf', '-' ];
|
|
|
|
spawn(%spawn_opts);
|
|
|
|
$self->close();
|
2014-05-07 02:32:04 +00:00
|
|
|
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
|
|
|
|
index 45cb3d4..bd55234 100644
|
|
|
|
--- a/scripts/Makefile.am
|
|
|
|
+++ b/scripts/Makefile.am
|
|
|
|
@@ -119,7 +119,7 @@ nobase_dist_perllib_DATA = \
|
|
|
|
man3_MANS =
|
|
|
|
|
|
|
|
do_perl_subst = $(AM_V_GEN) \
|
|
|
|
- sed -e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL):" \
|
|
|
|
+ sed -e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL) -I$(PERL_LIBDIR):" \
|
|
|
|
-e "s:\$$CONFDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$CONFDIR='$(pkgconfdir)':" \
|
|
|
|
-e "s:\$$ADMINDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$ADMINDIR='$(admindir)':" \
|
|
|
|
-e "s:\$$LIBDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$LIBDIR='$(pkglibdir)':" \
|
|
|
|
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
|
|
|
|
index 098c202..4b089d7 100644
|
|
|
|
--- a/scripts/Makefile.in
|
|
|
|
+++ b/scripts/Makefile.in
|
|
|
|
@@ -490,7 +490,7 @@ nobase_dist_perllib_DATA = \
|
|
|
|
# Keep it even if empty to have man3dir correctly set
|
|
|
|
man3_MANS =
|
|
|
|
do_perl_subst = $(AM_V_GEN) \
|
|
|
|
- sed -e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL):" \
|
|
|
|
+ sed -e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL) -I$(PERL_LIBDIR):" \
|
|
|
|
-e "s:\$$CONFDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$CONFDIR='$(pkgconfdir)':" \
|
|
|
|
-e "s:\$$ADMINDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$ADMINDIR='$(admindir)':" \
|
|
|
|
-e "s:\$$LIBDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$LIBDIR='$(pkglibdir)':" \
|