diff options
| author | Kieran Pilkington | 2009-09-26 17:49:03 +1200 |
|---|---|---|
| committer | Max Howell | 2009-09-29 16:26:37 +0100 |
| commit | 239892e582be38721f0d008fed1faa72664f48ae (patch) | |
| tree | e31fc7be031ac62aa2882b3e2c9971c7d7101cab /Library/Formula | |
| parent | 56b1334942245bf33ae582f1d168d874e575227e (diff) | |
| download | homebrew-239892e582be38721f0d008fed1faa72664f48ae.tar.bz2 | |
Don't assume /usr/local in postgresql formula
Adding user creation commands, and adding note about aliasing commands.
Formula working nicely now :-D
Adding note about postgres gem to avoid conflicts (took me a while to figure
out)
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/postgresql.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb index 54c5ad3dd..19c0e7fd9 100644 --- a/Library/Formula/postgresql.rb +++ b/Library/Formula/postgresql.rb @@ -40,25 +40,35 @@ class Postgresql <Formula def caveats; <<-EOS Suggested next steps: - * Create a user for postgresql (we'll name it "postgres"). + * Create a user for postgresql (we'll name it "postgres"). Do it via System preferences or by running: + + $ sudo dscl . -create /Users/postgres + $ sudo dscl . -create /Users/postgres Usershell /bin/bash + * Create a databse: - + $ sudo mkdir -p /var/db/postgresql/defaultdb $ sudo chown postgres /var/db/postgresql/defaultdb - $ sudo su postgres -c '/usr/local/bin/initdb -D /var/db/postgresql/defaultdb' + $ sudo su postgres -c '#{HOMEBREW_PREFIX}/bin/initdb -D /var/db/postgresql/defaultdb' $ sudo touch /var/log/postgres.log $ sudo chown postgres /var/log/postgres.log Starting: - $ sudo su postgres -c "/usr/local/bin/pg_ctl -D /var/db/postgresql/defaultdb start -l /var/log/postgres.log" + $ sudo su postgres -c "#{HOMEBREW_PREFIX}/bin/pg_ctl -D /var/db/postgresql/defaultdb start -l /var/log/postgres.log" Stopping: - $ sudo su postgres -c "/usr/local/bin/pg_ctl -D /var/db/postgresql/defaultdb stop -s -m fast" + $ sudo su postgres -c "#{HOMEBREW_PREFIX}/bin/pg_ctl -D /var/db/postgresql/defaultdb stop -s -m fast" + +You can also alias the above commands in your bash profile to pg_start and pg_stop. Google around for org.postgresql.plist if you want launchd support. + +If you're wanting to install the postgres gem, include ARCHFLAGS in the gem install to avoid issues: + +sudo env ARCHFLAGS="-arch x86_64" gem install postgres EOS end end |
