2011-12-21 23:28:59 +00:00
|
|
|
class Dpkg < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Debian package management system"
|
2014-11-12 01:47:07 +00:00
|
|
|
homepage "https://wiki.debian.org/Teams/Dpkg"
|
2015-08-22 22:59:36 +00:00
|
|
|
url "https://mirrors.kernel.org/debian/pool/main/d/dpkg/dpkg_1.18.2.tar.xz"
|
|
|
|
mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/d/dpkg/dpkg_1.18.2.tar.xz"
|
|
|
|
sha256 "11484f2a73d027d696e720a60380db71978bb5c06cd88fe30c291e069ac457a4"
|
2011-12-21 23:28:59 +00:00
|
|
|
|
2014-11-12 15:26:51 +00:00
|
|
|
bottle do
|
2015-09-22 16:27:12 +00:00
|
|
|
sha256 "cbaeb0690b51fce1e23b6a80362ec5106839868b3e0246ead17765b24dcc930c" => :el_capitan
|
2015-08-23 00:09:15 +00:00
|
|
|
sha256 "467a5d686281876289c33a5d7c297c425c39a6cd67155c40bc2c2e72fa1f6c09" => :yosemite
|
|
|
|
sha256 "00fa151281d448c9c3f89bd269fc5d4b29cef5589ff0504c59670244fae11abb" => :mavericks
|
|
|
|
sha256 "b6353be833eea2f48811735c4879d140a0a6bcc64239221c8d217f00fdc9e306" => :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
|
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-24 01:55:25 +00:00
|
|
|
|
|
|
|
# Theoretically, we could reinsert a patch here submitted upstream previously
|
|
|
|
# but the check for PERL_LIB remains in place and incompatible with Homebrew.
|
|
|
|
# Using an env and scripting is a solution less likely to break over time.
|
|
|
|
# Both variables need to be set. One is compile-time, the other run-time.
|
|
|
|
ENV["PERL_LIBDIR"] = libexec/"lib/perl5"
|
|
|
|
ENV.prepend_create_path "PERL5LIB", libexec+"lib/perl5"
|
|
|
|
|
2011-12-21 23:28:59 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
2015-04-13 01:27:28 +00:00
|
|
|
"--disable-silent-rules",
|
2015-04-24 01:55:25 +00:00
|
|
|
"--prefix=#{libexec}",
|
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",
|
2015-02-01 14:10:17 +00:00
|
|
|
"--disable-start-stop-daemon"
|
2011-12-21 23:28:59 +00:00
|
|
|
system "make"
|
2014-11-12 01:47:07 +00:00
|
|
|
system "make", "install"
|
2015-04-24 01:55:25 +00:00
|
|
|
|
|
|
|
bin.install Dir["#{libexec}/bin/*"]
|
|
|
|
man.install Dir["#{libexec}/share/man/*"]
|
|
|
|
bin.env_script_all_files(libexec+"bin", :PERL5LIB => ENV["PERL5LIB"])
|
2015-02-12 02:29:52 +00:00
|
|
|
|
|
|
|
(buildpath/"dummy").write "Vendor: dummy\n"
|
|
|
|
(etc/"dpkg/origins").install "dummy"
|
|
|
|
(etc/"dpkg/origins").install_symlink "dummy" => "default"
|
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
|