[Lunar-commits] r16561 - in moonbase/trunk/sql/postgresql: . init.d

Dennis Veatch stumbles at lunar-linux.org
Mon Sep 19 18:53:44 UTC 2005


Author: stumbles
Date: 2005-09-19 18:53:39 +0000 (Mon, 19 Sep 2005)
New Revision: 16561

Modified:
   moonbase/trunk/sql/postgresql/BUILD
   moonbase/trunk/sql/postgresql/CONFIGURE
   moonbase/trunk/sql/postgresql/DEPENDS
   moonbase/trunk/sql/postgresql/POST_INSTALL
   moonbase/trunk/sql/postgresql/init.d/postgresql
Log:

This fixes some of my braindeadness from before.

This does a number of things like;

1. adds a usable init.d script
2. adds some additional functions to postgresql
3. will not install current version if you have
   something older than 8.0
4. initializes the database
5. you still have to twiddle with postresql.conf
   and pg_hba to enable network connections, etc
6. I think that's it.



Modified: moonbase/trunk/sql/postgresql/BUILD
===================================================================
--- moonbase/trunk/sql/postgresql/BUILD	2005-09-19 17:37:51 UTC (rev 16560)
+++ moonbase/trunk/sql/postgresql/BUILD	2005-09-19 18:53:39 UTC (rev 16561)
@@ -1,24 +1,16 @@
 (
 
-  if module_installed tcl ; then
-     OPTS=$OPTS" --with-tcl"
-  fi 
+  ./configure  --prefix=/usr  \
+               $OPTS          &&
 
-  if module_installed perl ; then
-     OPTS=$OPTS" --with-perl"
-  fi 
+  default_make                &&
 
-  if module_installed Python ; then
-     OPTS=$OPTS" --with-python"
-  fi 
+# This gives postgresql some additional things like text search,
+# some dbase related utils to name a few.
+# See /usr/share/doc/postgresql/contrib for more info.
 
-  if module_installed Linux-PAM ; then
-     OPTS=$OPTS" --with-pam"
-  fi 
+  cd contrib                  &&
+  make all                    &&
+  make install
 
-  add_priv_user postgres:postgres  &&
-  ./configure  --prefix=/usr        \
-	       $OPTS               &&
-  default_make                                  
-
 ) > $C_FIFO 2>&1

Modified: moonbase/trunk/sql/postgresql/CONFIGURE
===================================================================
--- moonbase/trunk/sql/postgresql/CONFIGURE	2005-09-19 17:37:51 UTC (rev 16560)
+++ moonbase/trunk/sql/postgresql/CONFIGURE	2005-09-19 18:53:39 UTC (rev 16561)
@@ -3,7 +3,8 @@
     then
  if [ `cat /var/lib/pgsql/data/PG_VERSION` != '8.0' ]
     then
-    printf "${PROBLEM_COLOR}A pre 8.0 version of the database was found.\nYou need to upgrade the data format to 8.0.\nRefer to the INSTALL file located in the tarball\nfor the upgrade procedure.\nThe install will not continue.""${DEFAULT_COLOR}"
+    printf "${PROBLEM_COLOR}A pre 8.0 version of the database was found.\nYou need to upgrade the dat$
    exit 1
    fi
  fi
+

Modified: moonbase/trunk/sql/postgresql/DEPENDS
===================================================================
--- moonbase/trunk/sql/postgresql/DEPENDS	2005-09-19 17:37:51 UTC (rev 16560)
+++ moonbase/trunk/sql/postgresql/DEPENDS	2005-09-19 18:53:39 UTC (rev 16561)
@@ -1,3 +1,7 @@
 depends  ncurses  &&
 
-optional_depends "openssl"  "--with-openssl"  ""  "for SSL connections"
+optional_depends "openssl"  "--with-openssl"  ""  "for SSL connections"            &&
+optional_depends "tcl" "--with-tcl" "" "for portable scripting"                    &&
+optional_depends "perl" "--with-perl" "" "for general purpose programming"         &&
+optional_depends "Python" "--with-python" "" "for object oriented programming"     &&
+optional_depends "Linux-PAM" "--with-pam" "" "for user authentication"

Modified: moonbase/trunk/sql/postgresql/POST_INSTALL
===================================================================
--- moonbase/trunk/sql/postgresql/POST_INSTALL	2005-09-19 17:37:51 UTC (rev 16560)
+++ moonbase/trunk/sql/postgresql/POST_INSTALL	2005-09-19 18:53:39 UTC (rev 16561)
@@ -1,3 +1,30 @@
+# Time to initialize the database
+PGDATA=/var/lib/pgsql/data
+INITDB=/usr/bin/initdb
+
+if [ 'grep postgres /etc/passwd' != 'postgres' ]
+     then
+     add_priv_user postgres           \
+                    -d /var/lib/pgsql \
+                    -s /bin/bash      \
+                    -g postgres
+     fi
+
+if [ ! -d $PGDATA ]
+     then
+     mkdir -p $PGDATA
+     chown postgres.postgres $PGDATA
+     chmod go-rwx $PGDATA
+     su postgres -c "$INITDB --pgdata=$PGDATA" # > /dev/null 2>&1"
+     printf "Or run /etc/init.d/postgresql start\n"
+     fi
+# Done with database init.
+
+if [ ! -e /etc/init.d/postgresql ]
+     then
+     cp $SCRIPT_DIRECTORY/posgtresql/init.d/postgresql
+     fi
+
 if  module_installed  DBD-Pg;  then  lin DBD-Pg;   fi
 if  module_installed  php;     then  lin -c php;   fi
 if  module_installed  php5;    then  lin -c php5;  fi

Modified: moonbase/trunk/sql/postgresql/init.d/postgresql
===================================================================
--- moonbase/trunk/sql/postgresql/init.d/postgresql	2005-09-19 17:37:51 UTC (rev 16560)
+++ moonbase/trunk/sql/postgresql/init.d/postgresql	2005-09-19 18:53:39 UTC (rev 16561)
@@ -1,4 +1,4 @@
-#!  /bin/bash
+#! /bin/bash
 
 # chkconfig: 2345 98 02
 # description: PostgreSQL RDBMS
@@ -98,3 +98,4 @@
 esac
 
 exit 0
+



More information about the Lunar-commits mailing list