2011-12-21 23:28:59 +00:00
|
|
|
class Dpkg < Formula
|
2014-11-12 01:47:07 +00:00
|
|
|
homepage "https://wiki.debian.org/Teams/Dpkg"
|
2015-04-13 01:27:28 +00:00
|
|
|
url "https://mirrors.kernel.org/debian/pool/main/d/dpkg/dpkg_1.17.25.tar.xz"
|
|
|
|
mirror "http://ftp.debian.org/debian/pool/main/d/dpkg/dpkg_1.17.25.tar.xz"
|
|
|
|
sha256 "07019d38ae98fb107c79dbb3690cfadff877f153b8c4970e3a30d2e59aa66baa"
|
2011-12-21 23:28:59 +00:00
|
|
|
|
2014-11-12 15:26:51 +00:00
|
|
|
bottle do
|
2015-04-13 03:39:00 +00:00
|
|
|
sha256 "7c0ce804c160ee36c1328365f2e2921a7ace51a908dde2bf41f8c0ca7592ce9b" => :yosemite
|
|
|
|
sha256 "5de02303b6d3e2842feb1a836fbf4ee6b6d5886a2cb9013d8158273cae753cfa" => :mavericks
|
|
|
|
sha256 "d9855d5f78de6bc75a883f4fe04ea61152fea560554b27121ed76cec27fff8e5" => :mountain_lion
|
2014-11-12 15:26:51 +00:00
|
|
|
end
|
|
|
|
|
2014-11-12 01:47:07 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "gnu-tar"
|
2015-04-13 01:27:28 +00:00
|
|
|
depends_on "xz" # For LZMA
|
2011-12-21 23:28:59 +00:00
|
|
|
|
|
|
|
def install
|
2015-04-13 01:27:28 +00:00
|
|
|
# Fix for OS X checksum utility names.
|
|
|
|
inreplace "scripts/Dpkg/Checksums.pm" do |s|
|
|
|
|
s.gsub! "md5sum", "md5"
|
|
|
|
s.gsub! "sha1sum", "shasum"
|
|
|
|
s.gsub! "sha256sum", "'shasum', '-a', '256'"
|
2014-11-12 01:47:07 +00:00
|
|
|
end
|
|
|
|
|
2014-05-09 00:09:44 +00:00
|
|
|
# We need to specify a recent gnutar, otherwise various dpkg C programs will
|
2014-11-12 01:47:07 +00:00
|
|
|
# use the system "tar", which will fail because it lacks certain switches.
|
2014-05-09 00:09:44 +00:00
|
|
|
ENV["TAR"] = Formula["gnu-tar"].opt_bin/"gtar"
|
2015-04-13 01:27:28 +00:00
|
|
|
ENV["PERL_LIBDIR"] = lib/"perl5/site_perl"
|
2011-12-21 23:28:59 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
2015-04-13 01:27:28 +00:00
|
|
|
"--disable-silent-rules",
|
2011-12-21 23:28:59 +00:00
|
|
|
"--prefix=#{prefix}",
|
2015-04-13 01:27:28 +00:00
|
|
|
"--sysconfdir=#{etc}",
|
|
|
|
"--localstatedir=#{var}",
|
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"
|
2014-11-12 01:47:07 +00:00
|
|
|
system "make", "install"
|
2011-12-21 23:28:59 +00:00
|
|
|
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
|
|
|
|
2014-11-12 01:47:07 +00:00
|
|
|
test do
|
|
|
|
# Do not remove the empty line from the end of the control file
|
|
|
|
# All deb control files MUST end with an empty line
|
2015-04-13 01:27:28 +00:00
|
|
|
(testpath/"test/data/homebrew.txt").write <<-EOS.undent
|
|
|
|
Homebrew was here.
|
|
|
|
EOS
|
2014-11-12 01:47:07 +00:00
|
|
|
|
2015-04-13 01:27:28 +00:00
|
|
|
(testpath/"test/DEBIAN/control").write <<-EOS.undent
|
2014-11-12 01:47:07 +00:00
|
|
|
Package: test
|
|
|
|
Version: 1.40.99
|
|
|
|
Architecture: amd64
|
|
|
|
Description: I am a test
|
|
|
|
Maintainer: Dpkg Developers <test@test.org>
|
|
|
|
|
|
|
|
EOS
|
2015-04-13 01:27:28 +00:00
|
|
|
system bin/"dpkg", "-b", testpath/"test", "test.deb"
|
2014-11-12 01:47:07 +00:00
|
|
|
assert File.exist?("test.deb")
|
2015-04-13 01:27:28 +00:00
|
|
|
|
|
|
|
rm_rf "test"
|
|
|
|
system bin/"dpkg", "-x", "test.deb", testpath
|
|
|
|
assert File.exist?("data/homebrew.txt")
|
2014-11-12 01:47:07 +00:00
|
|
|
end
|
|
|
|
end
|