diff options
| author | Max Howell | 2010-01-13 05:15:58 +0000 |
|---|---|---|
| committer | Max Howell | 2010-01-13 11:23:15 +0000 |
| commit | 2131e399ea0b7e975004efdf35f0688c5934284f (patch) | |
| tree | 5a0af906f9ec0b7ec8b85b8187a47d49af622e4f /Library/Formula | |
| parent | 477bfcad291f0dc45315e90d4aa65fb3adf35419 (diff) | |
| download | homebrew-2131e399ea0b7e975004efdf35f0688c5934284f.tar.bz2 | |
Don't show non-64 bit caveats on non-64 bit systems
Also don't use HOMEBREW_PREFIX/bin, assume we're in the PATH, as it's most likely true, and if not, the guy has other problems or knows what he is doing.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/postgresql.rb | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb index 05a699646..870e6a72a 100644 --- a/Library/Formula/postgresql.rb +++ b/Library/Formula/postgresql.rb @@ -6,7 +6,7 @@ class Postgresql <Formula @md5='f2015af17bacbbfe140daf0d1067f9c9' depends_on 'readline' - depends_on 'libxml2' if MACOS_VERSION < 10.6 + depends_on 'libxml2' if MACOS_VERSION < 10.6 #system libxml is too old aka 'postgres' @@ -27,9 +27,7 @@ class Postgresql <Formula "--disable-debug", ] - if MACOS_VERSION >= 10.6 && Hardware.is_64_bit? - configure_args << "ARCHFLAGS='-arch x86_64'" - end + configure_args << "ARCHFLAGS='-arch x86_64'" if bits_64? # Fails on Core Duo with O4 and O3 if Hardware.intel_family == :core @@ -48,26 +46,37 @@ class Postgresql <Formula true end - def caveats; <<-EOS + def bits_64? + MACOS_VERSION >= 10.6 && Hardware.is_64_bit? + end + + def caveats + caveats = <<-EOS If this is your first install, create a database with: - #{HOMEBREW_PREFIX}/bin/initdb #{HOMEBREW_PREFIX}/var/postgres + initdb #{HOMEBREW_PREFIX}/var/postgres Automatically load on login with: launchctl load -w #{prefix}/org.postgresql.postgres.plist Or start manually with: - #{HOMEBREW_PREFIX}/bin/pg_ctl -D #{HOMEBREW_PREFIX}/var/postgres -l #{HOMEBREW_PREFIX}/var/postgres/server.log start + pg_ctl -D #{HOMEBREW_PREFIX}/var/postgres -l #{HOMEBREW_PREFIX}/var/postgres/server.log start And stop with: - #{HOMEBREW_PREFIX}/bin/pg_ctl -D #{HOMEBREW_PREFIX}/var/postgres stop -s -m fast + pg_ctl -D #{HOMEBREW_PREFIX}/var/postgres stop -s -m fast +EOS + + if bits_64? then + caveats << <<-EOS -If you want to install the postgres gem, include ARCHFLAGS in the gem install -to avoid issues: +If you want to install the postgres gem, including ARCHFLAGS is recommended: env ARCHFLAGS="-arch x86_64" gem install postgres To install gems without sudo, see the Homebrew wiki. - EOS + EOS + end + + caveats end def startup_plist |
