I set up the DVN development environment on a MacBook Pro running Mac OS X 10.5 (Leopard). Installed MacPorts (www.macports.org), and used that to install the PostgreSQL 8.3 port.
Install of postgresql83-server worked, but when I ran the recommended commands to create a databse instance, it failed in a pretty confusing and counter-intuitive way, even though I followed the installation instructions. The last step in the postgres installation process was to set up the default database with initdb, which needs to be done under user postgres:
su postgres -c 'initdb ...'
This command returned without any messages, i.e. it looked like it worked. In fact it failed, apparently because user postgres had /bin/false for the shell; (su -s /bin/sh -c '...' won't work either; again, silently, no error messages -- !!?). Then postgres startup failed too; with, you guessed it, no error messages either.
So I changed user postgres shell to /bin/sh; but I would assume there's a more elegant way of doing it. And it just seems weird to me that they recommended using su -c '...' for this in the manual (it was actually a MacOS-specific manual!) when they know that the package creates the user with no valid shell.
This site lists the steps needed to install a version of postgres for Mac, and is very thorough and helpful. Note that you first have to install the readline library, then install postgres.
After you intsall postgres, set up a postgre user account to manage the postgresql server, and then set up a user account and database for the DVN installation.
# the apple.dev web page shows the following settings for configure and make:
root@mail:postgresql-7.4.1> ./configure --with-includes=/sw/include/
--with-libraries=/sw/lib
root@mail:postgresql-7.4.1> make
root@mail:postgresql-7.4.1> make install
# for my case, because I chose readline via MacPorts, configure differs:
a_sone:~ $ ./configure --with-includes=/opt/local/include/
--with-libraries=/opt/local/lib
# other related path settings (within ~/.bashrc file)
export PATH=/opt/local/bin:/opt/local/sbin/:$PATH
export MANPATH=/opt/local/man:$MANPATH
# Because the Dataverse uses UTF8, we must explicitly specify it
# during the initialization step of PostgreSQL:
a_sone:~ $ sudo -u postgres initdb -E utf8
--locale=en_US.UTF-8 /Library/PostgreSQL8/data
# or if you have already logged in as the owner postgres that manages PostgreSQL:
Macintosh:~ postgres$ /usr/local/pgsql/bin/initdb -E utf8
--locale=en_US.UTF-8 -D /usr/local/pgsql/data
Leopard OS
DVN v1.2 requires JDK 6, so upgraded OS to Mac OS X 10.5 (Leopard), which includes JDK 6. Otherwise, have to go to soylatte and update Java platform.
PostgreSQL for Mac OS X
I set up the DVN development environment on a MacBook Pro running Mac OS X 10.5 (Leopard). Installed MacPorts (www.macports.org), and used that to install the PostgreSQL 8.3 port.
Install of postgresql83-server worked, but when I ran the recommended commands to create a databse instance, it failed in a pretty confusing and counter-intuitive way, even though I followed the installation instructions. The last step in the postgres installation process was to set up the default database with initdb, which needs to be done under user postgres:
su postgres -c 'initdb ...'
This command returned without any messages, i.e. it looked like it worked. In fact it failed, apparently because user postgres had /bin/false for the shell; (su -s /bin/sh -c '...' won't work either; again, silently, no error messages -- !!?). Then postgres startup failed too; with, you guessed it, no error messages either.
So I changed user postgres shell to /bin/sh; but I would assume there's a more elegant way of doing it. And it just seems weird to me that they recommended using su -c '...' for this in the manual (it was actually a MacOS-specific manual!) when they know that the package creates the user with no valid shell.
See Apple Dev site for postgres help
Look at the Apple Developers website for PostgreSQL: http://developer.apple.com/internet/opensource/postgres.html.
This site lists the steps needed to install a version of postgres for Mac, and is very thorough and helpful. Note that you first have to install the readline library, then install postgres.
After you intsall postgres, set up a postgre user account to manage the postgresql server, and then set up a user account and database for the DVN installation.
Tips for installing from MacPorts on command line
# the apple.dev web page shows the following settings for configure and make:
root@mail:postgresql-7.4.1> ./configure --with-includes=/sw/include/
--with-libraries=/sw/lib
root@mail:postgresql-7.4.1> make
root@mail:postgresql-7.4.1> make install
# for my case, because I chose readline via MacPorts, configure differs:
a_sone:~ $ ./configure --with-includes=/opt/local/include/
--with-libraries=/opt/local/lib
# other related path settings (within ~/.bashrc file)
export PATH=/opt/local/bin:/opt/local/sbin/:$PATH
export MANPATH=/opt/local/man:$MANPATH
# environment variables for PostgreSQL (within ~/.bashrc file)
export PGDATA=/usr/local/pgsql/bin
export PATH=$PATH:/usr/local/pgsql/bin
# Because the Dataverse uses UTF8, we must explicitly specify it
# during the initialization step of PostgreSQL:
a_sone:~ $ sudo -u postgres initdb -E utf8
--locale=en_US.UTF-8 /Library/PostgreSQL8/data
# or if you have already logged in as the owner postgres that manages PostgreSQL:
Macintosh:~ postgres$ /usr/local/pgsql/bin/initdb -E utf8
--locale=en_US.UTF-8 -D /usr/local/pgsql/data