aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--Formula/ack.rb10
-rw-r--r--Formula/asciidoc.rb12
-rw-r--r--Formula/boost.rb16
-rw-r--r--Formula/cmake.rb13
-rw-r--r--Formula/dmd.rb42
-rw-r--r--Formula/fftw.rb21
-rw-r--r--Formula/git.rb20
-rw-r--r--Formula/grc.rb70
-rw-r--r--Formula/lame.rb12
-rw-r--r--Formula/liblastfm.rb19
-rw-r--r--Formula/libogg.rb12
-rw-r--r--Formula/libsamplerate.rb12
-rw-r--r--Formula/mad.rb12
-rw-r--r--Formula/pkg-config.rb14
-rw-r--r--Formula/pngcrush.rb12
-rw-r--r--Formula/qt.rb43
-rw-r--r--Formula/taglib.rb12
-rw-r--r--Formula/term.rb10
-rw-r--r--Formula/wget.rb13
-rw-r--r--Formula/xmlrpc-c.rb16
-rw-r--r--Formula/yajl.rb21
-rw-r--r--Library/Homebrew/brewkit.rb (renamed from Cellar/homebrew/brewkit.rb)68
-rw-r--r--Library/Homebrew/env.rb22
-rwxr-xr-xLibrary/Homebrew/unittest.rb (renamed from Cellar/homebrew/unittest.rb)7
-rwxr-xr-xbin/brew (renamed from Cellar/homebrew/brew)30
26 files changed, 75 insertions, 470 deletions
diff --git a/.gitignore b/.gitignore
index 4787e8518..72820f508 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,4 @@
.DS_Store
/*/
-!/Cellar/
-!/Formula/
-/Cellar/*/
-!/Cellar/homebrew/ \ No newline at end of file
+!/Library/
+!/bin/brew \ No newline at end of file
diff --git a/Formula/ack.rb b/Formula/ack.rb
deleted file mode 100644
index 4bab09c89..000000000
--- a/Formula/ack.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'brewkit'
-
-class Ack <UncompressedScriptFormula
- def initialize
- @version='1.88'
- @url="http://ack.googlecode.com/svn/tags/#{@version}/ack"
- @md5='8009a13ab0fc66047bea0ea2ad89419c'
- @homepage='http://betterthangrep.com/'
- end
-end \ No newline at end of file
diff --git a/Formula/asciidoc.rb b/Formula/asciidoc.rb
deleted file mode 100644
index 6b53ff83c..000000000
--- a/Formula/asciidoc.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'brewkit'
-
-class Asciidoc <Formula
- @url='http://www.methods.co.nz/asciidoc/asciidoc-8.4.4.tar.gz'
- @md5='579bcd5762b177ee0ddccece8c34724b'
- @homepage='http://www.methods.co.nz/asciidoc'
-
- def install
- system "./configure --disable-debug --prefix='#{prefix}'"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/boost.rb b/Formula/boost.rb
deleted file mode 100644
index 2022ef952..000000000
--- a/Formula/boost.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'brewkit'
-
-class Boost <Formula
- @homepage='http://www.boost.org'
- @url='http://kent.dl.sourceforge.net/sourceforge/boost/boost_1_39_0.tar.bz2'
- @md5='a17281fd88c48e0d866e1a12deecbcc0'
-
- def install
- #TODO we can save 6300 links if we just had the intelligence to symlink
- #the include/boost dir and not more
-
- # we specify libdir too because the script is apparently broken
- system "./bootstrap.sh --prefix='#{prefix}' --libdir='#{lib}'"
- system "./bjam --layout=system --prefix='#{prefix}' --libdir='#{lib}' install"
- end
-end \ No newline at end of file
diff --git a/Formula/cmake.rb b/Formula/cmake.rb
deleted file mode 100644
index ee35e3eef..000000000
--- a/Formula/cmake.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'brewkit'
-
-class Cmake <Formula
- @url='http://www.cmake.org/files/v2.6/cmake-2.6.3.tar.gz'
- @md5='5ba47a94ce276f326abca1fd72a7e7c6'
-
- def install
- system "./bootstrap --prefix=#{prefix} --system-libs"
- system "make install"
-
- ['man','doc'].each { |d| (prefix+d).mv prefix+'share' }
- end
-end \ No newline at end of file
diff --git a/Formula/dmd.rb b/Formula/dmd.rb
deleted file mode 100644
index 9ad5784be..000000000
--- a/Formula/dmd.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'brewkit'
-
-class Dmd <Formula
- @homepage='http://www.digitalmars.com/d/'
- @url='http://ftp.digitalmars.com/dmd.1.043.zip'
- @md5='6c83b7296cb84090a9ebc11ab0fb94a2'
-
- def doc
- #use d and not dmd, rationale: meh
- prefix+'share'+'doc'+'d'
- end
-
- def install
- ohai "install"
- FileUtils.cp_r 'osx/bin', prefix
- FileUtils.cp_r 'osx/lib', prefix
- FileUtils.cp_r 'man/man1', man
- FileUtils.cp_r 'src', prefix
-
- #lol
- man5=man+'man5'
- man5.mkpath
- (man+'man1'+'dmd.conf.5').mv man5
- #lol ends
-
- html=doc+'html'
- samples=doc+'examples' #examples is the more typical directory name
- html.mkpath
- samples.mkpath
-
- FileUtils.cp_r Dir['html/d/*'], html unless ARGV.include? '--no-html'
- FileUtils.cp_r Dir['samples/d/*'], samples unless ARGV.include? '--no-samples'
-
- # zip files suck TODO FileUtils.chmod
- Dir.chdir(bin) { `chmod u+x dmd dumpobj obj2asm` }
-
- (prefix+'bin'+'dmd.conf').open('w') do |f|
- f.puts "[Environment]"
- f.puts "DFLAGS=-I#{prefix}/src/phobos -L-L#{prefix}/lib"
- end
- end
-end \ No newline at end of file
diff --git a/Formula/fftw.rb b/Formula/fftw.rb
deleted file mode 100644
index e79002fc4..000000000
--- a/Formula/fftw.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'brewkit'
-
-class Fftw <Formula
- @homepage='http://www.fftw.org'
- @url='http://www.fftw.org/fftw-3.2.1.tar.gz'
- @md5='712d3f33625a0a76f5758648d4b925f7'
-
- def install
- configure=<<-EOS
- ./configure --enable-shared --disable-debug --prefix='#{prefix}'
- --enable-threads --enable-single --enable-sse
- --disable-dependency-tracking
- --disable-fortran
- EOS
- system configure.gsub("\n", ' ').strip.squeeze(' ')
- system "make install"
-
- #wtf file?
- (prefix+'share'+'info'+'dir').unlink
- end
-end \ No newline at end of file
diff --git a/Formula/git.rb b/Formula/git.rb
deleted file mode 100644
index 0f0620f40..000000000
--- a/Formula/git.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'brewkit'
-
-class GitManuals <Formula
- @url='http://kernel.org/pub/software/scm/git/git-manpages-1.6.3.1.tar.bz2'
- @md5='971d573e8f261feb83290a59728c2b33'
-end
-
-class Git <Formula
- @url='http://kernel.org/pub/software/scm/git/git-1.6.3.1.tar.bz2'
- @md5='c1f4aab741359c29f0fbf28563ac7387'
- @homepage='http://git-scm.com'
-
- def install
- system "./configure --prefix='#{prefix}' --disable-debug"
- system "make install"
-
- # the manuals come separately, well sort of, it's easier this way though
- GitManuals.new.brew { FileUtils.mv Dir['*'], man }
- end
-end \ No newline at end of file
diff --git a/Formula/grc.rb b/Formula/grc.rb
deleted file mode 100644
index 7f6db90b0..000000000
--- a/Formula/grc.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-require 'brewkit'
-
-def profile_string
- <<-sput
-################################################################## >> Homebrew
-GRC=`which grc`
-if [ "$TERM" != dumb ] && [ -n GRC ]
-then
- alias colourify="$GRC -es --colour=auto"
- alias configure='colourify ./configure'
- alias diff='colourify diff'
- alias make='colourify make'
- alias gcc='colourify gcc'
- alias g++='colourify g++'
- alias as='colourify as'
- alias gas='colourify gas'
- alias ld='colourify ld'
- alias netstat='colourify netstat'
- alias ping='colourify ping'
- alias traceroute='colourify /usr/sbin/traceroute'
-fi
-################################################################## << Homebrew
- sput
-end
-
-######################################################################### ARGV
-case ARGV[0]
- when '--profile' then
- puts profile_string
- exit 0
-end
-
-######################################################################### cook
-class Grc <Formula
- @homepage='http://korpus.juls.savba.sk/~garabik/software/grc.html'
- @url='http://korpus.juls.savba.sk/~garabik/software/grc/grc_1.1.tar.gz'
- @md5='eeb612aba2fff14cbaf1f3bec7e1eb60'
-
- def install
- ohai "make"
- #TODO we should deprefixify since it's python and thus possible
- inreplace 'grc', '/etc', prefix+'etc'
- inreplace 'grc.1', '/etc', prefix+'etc'
- inreplace 'grcat', '/usr/local', prefix
- inreplace 'grcat.1', '/usr/local', prefix
-
- FileUtils.mkpath prefix
- Dir.chdir prefix do
- FileUtils.mkpath 'bin'
- FileUtils.mkpath 'share/grc'
- FileUtils.mkpath 'share/man/man1'
- FileUtils.mkpath 'etc'
- end
-
- `cp -fv grc grcat #{prefix}/bin`
- `cp -fv conf.* #{prefix}/share/grc`
- `cp -fv grc.conf #{prefix}/etc`
- `cp -fv grc.1 grcat.1 #{prefix}/share/man/man1`
- end
-
- def caveats
- <<-EOS
- grc won't work as is. One option is to add some aliases to your ~/.profile
- file. Homebrew can do that for you, just execute this command:
-
- ruby #{$0} --profile >> ~/.profile
-
- EOS
- end
-end \ No newline at end of file
diff --git a/Formula/lame.rb b/Formula/lame.rb
deleted file mode 100644
index 2c248285c..000000000
--- a/Formula/lame.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'brewkit'
-
-class Lame <Formula
- @homepage='http://lame.sourceforge.net/'
- @url='http://kent.dl.sourceforge.net/sourceforge/lame/lame-398-2.tar.gz'
- @md5='719dae0ee675d0c16e0e89952930ed35'
-
- def install
- system "./configure --disable-debug --prefix='#{prefix}' --enable-nasm"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/liblastfm.rb b/Formula/liblastfm.rb
deleted file mode 100644
index 5d1999172..000000000
--- a/Formula/liblastfm.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'brewkit'
-
-class Liblastfm <Formula
- @homepage='http://github.com/mxcl/liblastfm/'
- @url='http://github.com/mxcl/liblastfm/tarball/0.3.0'
- @md5='08e90275ccd06476426a5002d1dad762'
-
- def deps
- dep_test_bin 'qmake' or 'qt'
- dep_test_lib 'fftw3f' or 'fftw'
- dep_test_lib 'samplerate' or 'libsamplerate'
- end
-
- def install
- system "./configure --release --prefix '#{prefix}'"
- system "make"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/libogg.rb b/Formula/libogg.rb
deleted file mode 100644
index 178835342..000000000
--- a/Formula/libogg.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'brewkit'
-
-class Libogg <Formula
- @homepage='http://www.xiph.org/ogg/'
- @url='http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz'
- @md5='eaf7dc6ebbff30975de7527a80831585'
-
- def install
- system "./configure --disable-debug --prefix='#{prefix}'"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/libsamplerate.rb b/Formula/libsamplerate.rb
deleted file mode 100644
index d6dedc6c7..000000000
--- a/Formula/libsamplerate.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'brewkit'
-
-class Libsamplerate <Formula
- @homepage='http://www.mega-nerd.com/SRC'
- @url='http://www.mega-nerd.com/SRC/libsamplerate-0.1.7.tar.gz'
- @md5='ad093e60ec44f0a60de8e29983ddbc0f'
-
- def install
- system "./configure --disable-debug --prefix='#{prefix}'"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/mad.rb b/Formula/mad.rb
deleted file mode 100644
index 0bbcab8f9..000000000
--- a/Formula/mad.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'brewkit'
-
-class Mad <Formula
- @homepage='http://www.underbit.com/products/mad/'
- @url='http://kent.dl.sourceforge.net/sourceforge/mad/libmad-0.15.1b.tar.gz'
- @md5='1be543bc30c56fb6bea1d7bf6a64e66c'
-
- def install
- system "./configure --disable-debugging --enable-fpm=intel --prefix='#{prefix}'"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/pkg-config.rb b/Formula/pkg-config.rb
deleted file mode 100644
index 9254c5a65..000000000
--- a/Formula/pkg-config.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'brewkit'
-
-class PkgConfig <Formula
- @homepage='http://pkgconfig.freedesktop.org'
- @url='http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz'
- @md5='d922a88782b64441d06547632fd85744'
-
- #TODO depend on our glib? --with-installed-glib
-
- def install
- system "./configure --with-pc-path=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:#{$root}/lib/pkgconfig --disable-debug --prefix='#{prefix}'"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/pngcrush.rb b/Formula/pngcrush.rb
deleted file mode 100644
index 00a889403..000000000
--- a/Formula/pngcrush.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'brewkit'
-
-class Pngcrush <Formula
- @homepage='http://pmt.sourceforge.net/pngcrush/'
- @url='http://kent.dl.sourceforge.net/sourceforge/pmt/pngcrush-1.6.17.tar.bz2'
- @md5='8ba31ae9b1b14e7648df320fd1ed27c7'
-
- def install
- system "make"
- FileUtils.cp 'pngcrush', bin
- end
-end \ No newline at end of file
diff --git a/Formula/qt.rb b/Formula/qt.rb
deleted file mode 100644
index 9ce82d600..000000000
--- a/Formula/qt.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require 'brewkit'
-
-class Qt <Formula
- @url='http://get.qtsoftware.com/qt/source/qt-mac-opensource-src-4.5.1.tar.gz'
- @md5='9fc0e96197df6db48a0628ac4d63e0dd'
- @homepage='http://www.qtsoftware.com'
-
- def install
- if version == '4.5.1'
- # Reported 6 months ago (at 4.5.0-rc1), still not fixed in the this release! :(
- makefiles=['plugins/sqldrivers/sqlite/sqlite.pro', '3rdparty/webkit/WebCore/WebCore.pro']
- makefiles.each { |makefile| `echo 'LIBS += -lsqlite3' >> src/#{makefile}` }
- end
-
- configure=<<-EOS
- ./configure -prefix '#{prefix}'
- -system-sqlite -system-libpng -system-zlib
- -nomake demos -nomake examples -no-qt3support
- -release -cocoa -arch x86
- -confirm-license -opensource
- -I /usr/X11R6/include -L /usr/X11R6/lib
- -fast
- EOS
-
- system configure.gsub("\n", ' ').strip.squeeze(' ')
- system "make install"
-
- # fuck weird prl files
- `find #{lib} -name \*.prl -delete`
- # fuck crazy disk usage
- `rm -r #{prefix+'doc'+'html'} #{prefix+'doc'+'src'}`
- # wtf are these anyway?
- `rm -r #{bin}/Assistant_adp.app #{bin}/pixeltool.app #{bin}/qhelpconverter.app`
- # we specified no debug already! :P
- `rm #{lib}/libQtUiTools_debug.a`
- # meh
- `rm #{prefix}/q3porting.xml`
- end
-
- def caveats
- "We agreed to the Qt opensource license for you.\nIf this is unacceptable you should uninstall :P"
- end
-end \ No newline at end of file
diff --git a/Formula/taglib.rb b/Formula/taglib.rb
deleted file mode 100644
index 2811decec..000000000
--- a/Formula/taglib.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'brewkit'
-
-class Taglib <Formula
- @url='http://developer.kde.org/~wheeler/files/src/taglib-1.5.tar.gz'
- @md5='7b557dde7425c6deb7bbedd65b4f2717'
- @homepage='http://developer.kde.org/~wheeler/taglib.html'
-
- def install
- system "./configure --disable-debug --prefix='#{prefix}'"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/term.rb b/Formula/term.rb
deleted file mode 100644
index 427d3607a..000000000
--- a/Formula/term.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'brewkit'
-
-class Term <UncompressedScriptFormula
- def initialize
- @url='http://github.com/liyanage/macosx-shell-scripts/raw/e29f7eaa1eb13d78056dec85dc517626ab1d93e3/term'
- @md5='1bbf4509a50224b27ac8c20d3fe8682e'
- @version='2.1'
- @homepage='http://gist.github.com/116587'
- end
-end \ No newline at end of file
diff --git a/Formula/wget.rb b/Formula/wget.rb
deleted file mode 100644
index 2ba5722e0..000000000
--- a/Formula/wget.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'brewkit'
-
-class Wget <Formula
- @homepage='http://www.gnu.org/software/wget/'
- @url='http://ftp.gnu.org/gnu/wget/wget-1.11.4.tar.bz2'
- @md5='f5076a8c2ec2b7f334cb6e3059820f9c'
-
- def install
- system "./configure --disable-debug --prefix='#{prefix}'"
- system "make"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/xmlrpc-c.rb b/Formula/xmlrpc-c.rb
deleted file mode 100644
index 27d6f3a1e..000000000
--- a/Formula/xmlrpc-c.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'brewkit'
-
-class XmlrpcC <Formula
- @url='http://kent.dl.sourceforge.net/sourceforge/xmlrpc-c/xmlrpc-c-1.06.33.tgz'
- @md5='7dda4d8c5d26ae877d3809e428ce7962'
- @homepage='http://xmlrpc-c.sourceforge.net/'
-
- def install
- ENV['MAKEFLAGS']='' #parallel build doesn't work
- # choosing --enable-libxml2-backend to lose some weight and not statically
- # link in expat
- #NOTE seemingly it isn't possible to build dylibs with this thing
- system "./configure --disable-debug --enable-libxml2-backend --prefix='#{prefix}'"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Formula/yajl.rb b/Formula/yajl.rb
deleted file mode 100644
index f72432dda..000000000
--- a/Formula/yajl.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'brewkit'
-
-class Yajl <Formula
- @homepage='http://lloyd.github.com/yajl/'
- @url='http://github.com/lloyd/yajl/tarball/1.0.5'
- @md5='f4a3cbc764c43231ed1aedc54438b69b'
-
- def deps
- dep_test_bin 'cmake'
- end
-
- def install
- ENV['MAKEFLAGS']='' # can't do parallel builds
-
- # I have pushed this fix upstream
- inreplace 'configure', 'cmake \.\.', "cmake -DCMAKE_INSTALL_PREFIX='#{prefix}' \.\." if @version == "1.0.5"
-
- system "./configure --prefix '#{prefix}'"
- system "make install"
- end
-end \ No newline at end of file
diff --git a/Cellar/homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index ae6879e73..8ca71d332 100644
--- a/Cellar/homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -1,7 +1,23 @@
-# Copyright 2009 Max Howell <max@methylblue.com>
-# Licensed as per the GPL version 3
+# Copyright 2009 Max Howell <max@methylblue.com>
+#
+# This file is part of Homebrew.
+#
+# Homebrew is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Homebrew is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Homebrew. If not, see <http://www.gnu.org/licenses/>.
+
require 'pathname'
require 'osx/cocoa' # to get number of cores
+require "#{File.dirname __FILE__}/env"
HOMEBREW_VERSION='0.1'
@@ -181,36 +197,28 @@ public
FileUtils.rm_rf tmp if tmp
FileUtils.rm tgz if tgz and not self.cache?
end
-
- ohai 'Finishing up'
-
- begin
- prefix
- rescue RuntimeError
- # you can have packages that aren't for installing, see git
- # this is a HACK though, and dirty, and not right
- return
- end
-
- prefix.find do |path|
- if path==prefix #rubysucks
- next
- elsif path.file?
- if path.extname == '.la'
- path.unlink
- else
- fo=`file -h #{path}`
- args=nil
- args='-SxX' if fo =~ /Mach-O dynamically linked shared library/
- args='' if fo =~ /Mach-O executable/ #defaults strip everything
- if args
- puts "Stripping: #{path}" if ARGV.include? '--verbose'
- `strip #{args} #{path}`
- end
+ end
+ end
+
+ def clean
+ prefix.find do |path|
+ if path==prefix #rubysucks
+ next
+ elsif path.file?
+ if path.extname == '.la'
+ path.unlink
+ else
+ fo=`file -h #{path}`
+ args=nil
+ args='-SxX' if fo =~ /Mach-O dynamically linked shared library/
+ args='' if fo =~ /Mach-O executable/ #defaults strip everything
+ if args
+ puts "Stripping: #{path}" if ARGV.include? '--verbose'
+ `strip #{args} #{path}`
end
- elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib'
- Find.prune
end
+ elsif path.directory? and path!=prefix+'bin' and path!=prefix+'lib'
+ Find.prune
end
end
end
diff --git a/Library/Homebrew/env.rb b/Library/Homebrew/env.rb
new file mode 100644
index 000000000..e1beac1c1
--- /dev/null
+++ b/Library/Homebrew/env.rb
@@ -0,0 +1,22 @@
+# Copyright 2009 Max Howell <max@methylblue.com>
+#
+# This file is part of Homebrew.
+#
+# Homebrew is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Homebrew is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Homebrew. If not, see <http://www.gnu.org/licenses/>.
+
+require 'pathname'
+
+$root=Pathname.new(__FILE__).dirname.parent.parent.realpath
+$formula=$root+'Library'+'Formula'
+$cellar=$root+'Cellar' \ No newline at end of file
diff --git a/Cellar/homebrew/unittest.rb b/Library/Homebrew/unittest.rb
index 1982faefc..5ec8f0e5d 100755
--- a/Cellar/homebrew/unittest.rb
+++ b/Library/Homebrew/unittest.rb
@@ -1,11 +1,6 @@
#!/usr/bin/ruby
-$:.unshift File.dirname(__FILE__)
-require 'pathname'
-$root=Pathname.new(__FILE__).realpath.dirname.parent.parent
-$cellar=$root+'Cellar'
-require 'brewkit'
require 'test/unit'
-
+require "#{__FILE__}/../brewkit"
class TestFormula <Formula
def initialize url, md5
diff --git a/Cellar/homebrew/brew b/bin/brew
index 9782c4edd..825872d93 100755
--- a/Cellar/homebrew/brew
+++ b/bin/brew
@@ -1,12 +1,9 @@
#!/usr/bin/ruby
-# Copyright 2009 Max Howell <max@methylblue.com>
-# Licensed as per the GPL version 3
+
require 'find'
require 'pathname'
-$:.unshift "#{File.dirname __FILE__}/../Cellar/homebrew"
-$root=Pathname.new(__FILE__).realpath.dirname.parent.parent
-$formula=$root+'Formula'
-$cellar=$root+'Cellar'
+$:.unshift Pathname.new(__FILE__).dirname.parent.realpath+'Library'+'Homebrew'
+require 'env'
def prune
n=0
@@ -14,7 +11,7 @@ def prune
$root.find do |path|
if path.directory?
name=path.relative_path_from($root).to_s
- if name == '.git' or name == 'Cellar' or name == 'Formula'
+ if name == '.git' or name == 'Cellar' or name == 'Library/Homebrew' or name == 'Library/Formula'
Find.prune
else
dirs<<path
@@ -90,10 +87,10 @@ def ln name
raise '#{keg} is not a keg'
end
- #TODO consider using hardlinks
-
- # yeah indeed, you have to force anything you want in the main tree into
- # these directories :P
+ # yeah indeed, you have to force anything you need in the main tree into
+ # these directories :P
+ # NOTE that not everything needs to be in the main tree
+ # TODO consider using hardlinks
$n=0
lnd(keg, 'etc') {nil}
lnd(keg, 'include') {nil}
@@ -113,13 +110,8 @@ def ln name
end
lnd(keg, 'share') do |path|
- path=path.to_s
- if ['man','doc','locale','info'].include? path
- :mkpath
- else
- mans=(1..9).collect {|x| "man/man#{x}"}
- :mkpath if mans.include? path
- end
+ includes=(1..9).collect {|x| "man/man#{x}"} <<'man'<<'doc'<<'locale'<<'info'
+ :mkpath if includes.include? path.to_s
end
return $n
@@ -219,6 +211,8 @@ begin
o=__obj(name)
raise "#{o.prefix} already exists!" if o.prefix.exist?
o.brew { o.install }
+ ohai 'Finishing up'
+ o.clean
ln name
puts "#{o.prefix}: "+`find #{o.prefix} -type f | wc -l`.strip+
' files, '+