osc 0.154.0 (new formula)

Add Open Build Service CLI

Closes #2493.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
Kirill A. Korinsky 2016-06-30 18:06:19 +04:00 committed by Dominyk Tiller
parent d9d67ade6f
commit b76f044627

49
Formula/osc.rb Normal file
View file

@ -0,0 +1,49 @@
class Osc < Formula
desc "The Command Line Interface to work with an Open Build Service"
homepage "https://github.com/openSUSE/osc"
url "https://github.com/openSUSE/osc/archive/0.154.0.tar.gz"
sha256 "88daae5b94354e9bcab03523aa7e3d270f69ffeaef8e4a1493bce19757d4699d"
head "https://github.com/openSUSE/osc.git"
depends_on :python if MacOS.version <= :snow_leopard
depends_on "swig" => :build
depends_on "openssl" # For M2Crypto
resource "pycurl" do
url "https://dl.bintray.com/pycurl/pycurl/pycurl-7.43.0.tar.gz"
sha256 "aa975c19b79b6aa6c0518c0cc2ae33528900478f0b500531dbcdbf05beec584c"
end
resource "urlgrabber" do
url "http://urlgrabber.baseurl.org/download/urlgrabber-3.10.1.tar.gz"
sha256 "06b13ff8d527dba3aee04069681b2c09c03117592d5485a80ae4b807cdf33476"
end
resource "m2crypto" do
url "https://pypi.python.org/packages/packages/source/M/M2Crypto/M2Crypto-0.24.0.tar.gz"
sha256 "80a56441a1d2c0cf27e725be7554c92598b938fc8767ee2c71fdbc2fdc055ee8"
end
def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
resources.each do |r|
r.stage do
inreplace "setup.py", "self.openssl = '/usr'", "self.openssl = '#{Formula["openssl"].opt_prefix}'" if r.name == "m2crypto"
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
# Fix for Homebrew's custom OpenSSL cert path.
inreplace "osc/conf.py", "'/etc/ssl/certs'", "'#{etc}/openssl/cert.pem'"
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(prefix)
bin.install "osc-wrapper.py" => "osc"
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system bin/"osc", "--version"
end
end