-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibre10.rb
97 lines (84 loc) · 4.04 KB
/
libre10.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
require "formula"
# Documentation: https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook
# /usr/local/Library/Contributions/example-formula.rb
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
HOMEBREW_BREWALL_VERSION = '1.6.0'
class Libre10 < Formula
homepage "http://libre10.rec10.org"
version "1.6.0"
url 'https://bitbucket.org/gn64/libre10.git', :tag => "#{HOMEBREW_BREWALL_VERSION}"
#url 'https://bitbucket.org/gn64/libre10.git', :branch => "release/1.6"
sha1 ""
version HOMEBREW_BREWALL_VERSION
head 'https://bitbucket.org/gn64/libre10.git', :branch => 'master'
depends_on "libtiff"
depends_on "libjpeg"
depends_on "webp"
depends_on "little-cms2"
depends_on "graphicsmagick"
depends_on "poppler"
depends_on "libjpeg-turbo"
depends_on :java => "1.7"
depends_on :python
resource "pycrypto" do
url "https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz"
sha1 "aeda3ed41caf1766409d4efc689b9ca30ad6aeb2"
end
resource "requests" do
url "https://pypi.python.org/packages/source/r/requests/requests-2.4.3.tar.gz"
sha1 "411f1bfa44556f7dd0f34cd822047c31baa7d741"
end
resource "pillow" do
url "https://pypi.python.org/packages/source/P/Pillow/Pillow-2.6.1.tar.gz"
sha1 "d789cad38db37b14d7650817111f000da7776c73"
end
resource "docopt" do
url "https://pypi.python.org/packages/source/d/docopt/docopt-0.6.2.tar.gz"
sha1 "224a3ec08b56445a1bd1583aad06b00692671e04"
end
resource "cherrypy" do
url "https://pypi.python.org/packages/source/C/CherryPy/CherryPy-3.6.0.tar.gz"
sha1 "bbbeb4e2bb81cb37049a32f78c6cb151b12d7857"
end
resource "paste" do
url "https://pypi.python.org/packages/source/P/Paste/Paste-1.7.5.1.tar.gz"
sha1 "11d3c5a2dc52c5e725139a9334574291a0f9d04f"
end
resource "sqlalchemy" do
url "https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.9.8.tar.gz"
sha1 "19ff863f54904c5eafb9d88960939842578f851c"
end
resource "anyjson" do
url "https://pypi.python.org/packages/source/a/anyjson/anyjson-0.3.3.tar.gz"
sha1 "2cd3c6cc61206664268e0e8684dbadf6e2428497"
end
resource "simplejson" do
url "https://pypi.python.org/packages/source/s/simplejson/simplejson-3.6.5.tar.gz"
sha1 "4e3f2557fc8003115cf5d9c388845c03aec83121"
end
def install
ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", prefix+"lib/python2.7/site-packages"
ENV.prepend_create_path "PATH", prefix+"/usr/local/bin"
ENV.prepend_create_path "PATH", libexec+"/usr/local/bin"
resource("pillow").stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
resource("docopt").stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
resource("pycrypto").stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
resource("requests").stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
resource("anyjson").stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
resource("simplejson").stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
resource("sqlalchemy").stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
resource("paste").stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
inreplace "conf/org.rec10.libre10.solr.plist", "[username]", `whoami`.gsub("\n","")
inreplace "conf/org.rec10.libre10.wsgi.plist", "[username]", `whoami`.gsub("\n","")
system "cp conf/org.rec10.libre10.solr.plist ~/Library/LaunchAgents"
system "cp conf/org.rec10.libre10.wsgi.plist ~/Library/LaunchAgents"
system "python ./www/libre10_exec.py install --data-dir=#{HOMEBREW_PREFIX}/var --bin-dir=#{bin} --www-dir=#{prefix}/www --disable-env --python-path=/usr/local/bin/python2"
bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
#system "#{bin}/libre10 import"
end
test do
system "true"
end
end