From 2131e399ea0b7e975004efdf35f0688c5934284f Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 13 Jan 2010 05:15:58 +0000 Subject: 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. --- Library/Formula/postgresql.rb | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'Library/Formula') 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 = 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 = 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 -- cgit v1.2.3