Skip to content

Instantly share code, notes, and snippets.

@eighthave
Created August 6, 2015 12:29
Show Gist options
  • Save eighthave/d7eed8aaa823cd37ad62 to your computer and use it in GitHub Desktop.
Save eighthave/d7eed8aaa823cd37ad62 to your computer and use it in GitHub Desktop.
Homebrew Formula for the F-Droid app repo tools aka fdroidserver
class Fdroidserver < Formula
desc "Tools for creating and managing Android app repositories for F-Droid"
homepage "https://f-droid.org/"
url "https://pypi.python.org/packages/source/f/fdroidserver/fdroidserver-0.4.0.tar.gz"
sha256 "89742f2e03e082c9d185835dbb4f166dade19a0e257b247a6e0bca3b4fd9b523"
depends_on :java => "1.7"
depends_on "libmagic" => :recommended
depends_on "libyaml"
depends_on :python if MacOS.version <= :snow_leopard
depends_on "android-sdk" => :recommended
resource "apache-libcloud" do
url "https://pypi.python.org/packages/source/a/apache-libcloud/apache-libcloud-0.17.0.tar.gz"
sha256 "8ac4895c5ed2fa51812237dfd587675e3cbc4b7e57d9b44722ce849eab2131c2"
end
resource "mwclient" do
url "https://pypi.python.org/packages/source/m/mwclient/mwclient-0.7.2.zip"
sha256 "195462115fadbe3cee73b5a0fe3cc28c8bdc0115c590cdc0f8b5083861003d1a"
end
resource "paramiko" do
url "https://pypi.python.org/packages/source/p/paramiko/paramiko-1.15.2.tar.gz"
sha256 "4f56a671a3eecbb76e6143e6e4ca007d503a39aa79aa9e14ade667fa53fd6e55"
end
resource "pillow" do
url "https://pypi.python.org/packages/source/P/Pillow/Pillow-2.8.1.tar.gz"
sha256 "8760c118a0215eba163f7782110e7efcdbb15f8a7321f3f61c5ac0dbbb12c996"
end
resource "pyasn1" do
url "https://pypi.python.org/packages/source/p/pyasn1/pyasn1-0.1.7.tar.gz"
sha256 "e4f81d53c533f6bd9526b047f047f7b101c24ab17339c1a7ad8f98b25c101eab"
end
resource "pyasn1-modules" do
url "https://pypi.python.org/packages/source/p/pyasn1-modules/pyasn1-modules-0.0.5.tar.gz"
sha256 "be65f00ed28e30756f1ef39377cb382480a2368699179d646a84d79fe9349941"
end
resource "python-magic" do
url "https://pypi.python.org/packages/source/p/python-magic/python-magic-0.4.6.tar.gz"
sha256 "903d3d3c676e2b1244892954e2bbbe27871a633385a9bfe81f1a81a7032df2fe"
end
resource "PyYAML" do
url "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz"
sha256 "c36c938a872e5ff494938b33b14aaa156cb439ec67548fcab3535bb78b0846e8"
end
resource "requests" do
url "https://pypi.python.org/packages/source/r/requests/requests-2.7.0.tar.gz"
sha256 "398a3db6d61899d25fd4a06c6ca12051b0ce171d705decd7ed5511517b4bb93d"
end
def install
ENV["PYTHONPATH"] = Formula["libdnet"].opt_lib/"python2.7/site-packages"
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
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(libexec)
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
def caveats; <<-EOS.undent
In order to function, fdroidserver requires that the Android SDK's
"Build-tools" are installed. Also, it is best if the base path of the
Android SDK is set in the standard environment variable ANDROID_HOME.
EOS
end
test do
# fdroid prefers to work in a dir called 'fdroid'
mkdir testpath/"fdroid" do
ENV['ANDROID_HOME'] =
system "#{bin}/fdroid", "init", "--verbose"
assert File.exist?("config.py")
assert File.exist?("keystore.jks")
system "#{bin}/fdroid", "update", "--create-metadata", "--verbose"
assert File.exist?("metadata")
assert File.exist?("repo/index.jar")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment