2012-02-15 19:04:45 +00:00
|
|
|
class Bup < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Backup tool"
|
2014-07-21 02:22:28 +00:00
|
|
|
homepage "https://github.com/bup/bup"
|
2016-06-13 08:06:25 +00:00
|
|
|
url "https://github.com/bup/bup/archive/0.28.1.tar.gz"
|
|
|
|
sha256 "fd962dbdade1b8ea257ac0e95d771ba11e6da4ef6f8ca6bee498a5b1bce8c817"
|
2015-08-07 20:50:02 +00:00
|
|
|
head "https://github.com/bup/bup.git"
|
2014-10-12 19:31:28 +00:00
|
|
|
|
2015-08-08 15:28:46 +00:00
|
|
|
bottle do
|
2016-02-08 23:43:01 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-06-13 08:16:52 +00:00
|
|
|
sha256 "2d69255f361fd0dc199f3864a50a741af5c738f4930193aa9cde85f711d5db62" => :el_capitan
|
|
|
|
sha256 "c7cf25a60351bf6c7eeb8373f785abb31013f99e870090234843cc1b53b56bb3" => :yosemite
|
|
|
|
sha256 "a2175f3f5c6d6e65799cb1c72ea2177b1d96aa297736023d56baaad4eca25602" => :mavericks
|
2015-08-08 15:28:46 +00:00
|
|
|
end
|
|
|
|
|
2015-03-09 04:59:14 +00:00
|
|
|
option "with-pandoc", "Build and install the manpages"
|
2016-06-13 08:06:25 +00:00
|
|
|
option "with-test", "Run unit tests after compilation"
|
|
|
|
option "without-web", "Build without repository access via `bup web`"
|
2015-03-09 04:59:14 +00:00
|
|
|
|
2015-12-07 21:24:37 +00:00
|
|
|
deprecated_option "run-tests" => "with-test"
|
|
|
|
deprecated_option "with-tests" => "with-test"
|
2015-03-09 04:59:14 +00:00
|
|
|
|
|
|
|
depends_on "pandoc" => [:optional, :build]
|
2016-06-13 08:06:25 +00:00
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
|
|
|
|
|
|
|
resource "backports_abc" do
|
|
|
|
url "https://pypi.python.org/packages/source/b/backports_abc/backports_abc-0.4.tar.gz"
|
|
|
|
sha256 "8b3e4092ba3d541c7a2f9b7d0d9c0275b21c6a01c53a61c731eba6686939d0a5"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "backports.ssl-match-hostname" do
|
|
|
|
url "https://pypi.python.org/packages/source/b/backports.ssl_match_hostname/backports.ssl_match_hostname-3.5.0.1.tar.gz"
|
|
|
|
sha256 "502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "certifi" do
|
|
|
|
url "https://pypi.python.org/packages/source/c/certifi/certifi-2016.2.28.tar.gz"
|
|
|
|
sha256 "5e8eccf95924658c97b990b50552addb64f55e1e3dfe4880456ac1f287dc79d0"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "singledispatch" do
|
|
|
|
url "https://pypi.python.org/packages/source/s/singledispatch/singledispatch-3.4.0.3.tar.gz"
|
|
|
|
sha256 "5b06af87df13818d14f08a028e42f566640aef80805c3b50c5056b086e3c2b9c"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "six" do
|
|
|
|
url "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz"
|
|
|
|
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "tornado" do
|
|
|
|
url "https://pypi.python.org/packages/source/t/tornado/tornado-4.3.tar.gz"
|
|
|
|
sha256 "c9c2d32593d16eedf2cec1b6a41893626a2649b40b21ca9c4cac4243bde2efbf"
|
|
|
|
end
|
2015-03-09 04:59:14 +00:00
|
|
|
|
2012-02-15 19:04:45 +00:00
|
|
|
def install
|
2016-06-13 08:06:25 +00:00
|
|
|
# `make test` gets stuck unless the Python Tornado module is installed
|
|
|
|
# Fix provided 12 Jun 2016 by upstream in #bup channel on IRC freenode
|
|
|
|
inreplace "t/test-web.sh", "if test -n \"$run_test\"; then", <<-EOS.undent
|
|
|
|
if ! python -c 'import tornado'; then
|
|
|
|
WVSTART 'unable to import tornado; skipping test'
|
|
|
|
run_test=''
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n \"$run_test\"; then
|
|
|
|
EOS
|
|
|
|
|
|
|
|
if build.with? "web"
|
|
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
|
|
|
|
resources.each do |r|
|
|
|
|
r.stage do
|
|
|
|
system "python", *Language::Python.setup_install_args(libexec/"vendor")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-01-04 13:02:46 +00:00
|
|
|
system "make"
|
2016-06-13 08:06:25 +00:00
|
|
|
system "make", "test" if build.bottle? || build.with?("test")
|
2013-11-17 20:19:59 +00:00
|
|
|
system "make", "install", "DESTDIR=#{prefix}", "PREFIX="
|
2016-06-13 08:06:25 +00:00
|
|
|
|
|
|
|
if build.with? "web"
|
|
|
|
mv bin/"bup", libexec/"bup.py"
|
2016-09-24 15:45:48 +00:00
|
|
|
(bin/"bup").write_env_script libexec/"bup.py", :PYTHONPATH => ENV["PYTHONPATH"]
|
2016-06-13 08:06:25 +00:00
|
|
|
end
|
2012-02-15 19:04:45 +00:00
|
|
|
end
|
2015-03-09 04:59:14 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
system bin/"bup", "init"
|
|
|
|
assert File.exist?("#{testpath}/.bup")
|
|
|
|
end
|
2012-02-15 19:04:45 +00:00
|
|
|
end
|