Issue #1663 - PostgreSQL Upgrade

- we are now building PostgreSQL 9.2.3 and psql 9.2.3 from source
- we are building pgadmin3 1.16.1 from source
- we can build both a 32-bit and 64-bit version of PostgreSQL, psql, and pgadmin3
- the following extensions are also built with PostgreSQL:
   * geos 3.3.7
   * postgis 2.0.2
   * proj 4.8.0
   * gdal 1.9.2
- database creation scripts and configuration have been updated for compatibility
- removed remaining references to prefixed psql and postgresql rpms
- removed unused sql scripts from the baseline
- we are now using modified versions of the PostgreSQL 9.2.3 postgresql.conf file
- updated the postgresql jdbc drivers

Change-Id: Ibe61cfcb2540cd4d8b9fae492688109d8bd715d8

Former-commit-id: 9e99447eee [formerly 8faf829eb0a8721093a181fe1335d5ee15a1fbaa]
Former-commit-id: 4fd4786ae5
This commit is contained in:
Bryan Kowal 2013-03-12 14:38:00 -05:00 committed by Steve Harris
parent aefbc4f54f
commit fcc7b102ad
66 changed files with 1718 additions and 22473 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="postgresql-8.3-603.jdbc3.jar" sourcepath="org.postgressrc.zip"/>
<classpathentry exported="true" kind="lib" path="postgis.jar" sourcepath="org.postgressrc.zip"/>
<classpathentry exported="true" kind="lib" path="postgis-jdbc-2.0.2SVN.jar"/>
<classpathentry exported="true" kind="lib" path="postgresql-9.2-1002.jdbc4.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,5 +1,6 @@
#Thu Mar 26 11:26:56 CDT 2009
#Tue Mar 12 15:29:23 CDT 2013
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

View file

@ -1,15 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Postgres Plug-in
Bundle-Name: Postgres
Bundle-SymbolicName: org.postgres
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: postgresql-8.3-603.jdbc3.jar,
postgis.jar
Bundle-Version: 9.2
Bundle-ClassPath: postgis-jdbc-2.0.2SVN.jar,
postgresql-9.2-1002.jdbc4.jar
Export-Package: examples,
org.postgis,
org.postgis.binary,
org.postgis.java2d,
org.postgresql,
org.postgresql.copy,
org.postgresql.core,
org.postgresql.core.types,
org.postgresql.core.v2,
@ -17,16 +18,21 @@ Export-Package: examples,
org.postgresql.ds,
org.postgresql.ds.common,
org.postgresql.ds.jdbc23,
org.postgresql.ds.jdbc4,
org.postgresql.fastpath,
org.postgresql.geometric,
org.postgresql.gss,
org.postgresql.jdbc2,
org.postgresql.jdbc2.optional,
org.postgresql.jdbc3,
org.postgresql.jdbc3g,
org.postgresql.jdbc4,
org.postgresql.largeobject,
org.postgresql.ssl,
org.postgresql.ssl.jdbc4,
org.postgresql.translation,
org.postgresql.util,
org.postgresql.xa
Edex-Deploy: postgis.jar,
postgresql-8.3-603.jdbc3.jar
org.postgresql.xa,
org.postgresql.xa.jdbc3,
org.postgresql.xa.jdbc4
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -1,4 +1,3 @@
bin.includes = META-INF/,\
.,\
postgresql-8.3-603.jdbc3.jar,\
postgis.jar
postgis-jdbc-2.0.2SVN.jar,\
postgresql-9.2-1002.jdbc4.jar

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -46,9 +46,6 @@ SET client_min_messages = warning;
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: awips
--
CREATE PROCEDURAL LANGUAGE plpgsql;
ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO awips;
SET search_path = public, pg_catalog;

View file

@ -23,7 +23,6 @@ DROP TABLESPACE IF EXISTS maps;
CREATE TABLESPACE maps owner awips location '%{database_files_home}%/maps';
CREATE DATABASE maps OWNER awips TABLESPACE maps;
\connect maps
CREATE PROCEDURAL LANGUAGE plpgsql;
CREATE SCHEMA mapdata AUTHORIZATION awips;
CREATE TABLE mapdata.map_version (
table_name varchar(256) not null,

View file

@ -32,6 +32,7 @@ STATIC_DATA_DIR="database/sqlScripts/share/sql/maps"
SHARED_SQL_DIR="${1}/database/sqlScripts/share"
DATABASEDIR=${1}/${STATIC_DATA_DIR}
POSTGRESDIR=${1}/postgresql
POSTGIS_CONTRIB=${POSTGRESDIR}/share/contrib/postgis-2.0
PGBINDIR=${1}/postgresql/bin
PSQLBINDIR=${1}/psql/bin
@ -48,8 +49,8 @@ else
fi
${PSQLBINDIR}/psql -d postgres -U $PGUSER -q -p $PGPORT -f ${DATABASEDIR}/createMapsDb.sql
${PSQLBINDIR}/psql -d maps -U $PGUSER -q -p $PGPORT -f ${SHARED_SQL_DIR}/lwpostgis.sql
${PSQLBINDIR}/psql -d maps -U $PGUSER -q -p $PGPORT -f ${SHARED_SQL_DIR}/spatial_ref_sys.sql
${PSQLBINDIR}/psql -d maps -U $PGUSER -q -p $PGPORT -f ${POSTGIS_CONTRIB}/postgis.sql
${PSQLBINDIR}/psql -d maps -U $PGUSER -q -p $PGPORT -f ${POSTGIS_CONTRIB}/spatial_ref_sys.sql
if [ -f ${DATABASEDIR}/maps.db ] ; then
${PSQLBINDIR}/psql -d maps -U ${PGUSER} -q -p ${PGPORT} -c "DROP TABLE IF EXISTS mapdata.map_version"
${PGBINDIR}/pg_restore -d maps -U $PGUSER -p $PGPORT -n mapdata ${DATABASEDIR}/maps.db

View file

@ -18,7 +18,7 @@
* further licensing information.
**/
drop database if exists fxatext;
create database fxatext with encoding='SQL_ASCII';
create database fxatext with TEMPLATE = template0 ENCODING = 'SQL_ASCII';
\c fxatext;
create user postgres superuser;
create user pguser nosuperuser;
@ -43,11 +43,3 @@ GRANT ALL ON SCHEMA public TO PUBLIC;
SET SESSION AUTHORIZATION 'pguser';
SET search_path = public, pg_catalog;
--
-- TOC entry 3 (OID 2200)
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'Standard public schema';

View file

@ -1,7 +1,5 @@
\connect ncep
CREATE PROCEDURAL LANGUAGE plpgsql;
-- create bounds schema
DROP SCHEMA IF EXISTS bounds CASCADE;
CREATE SCHEMA bounds AUTHORIZATION awips;

View file

@ -1,49 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
--This is the inital setup SQL to create the AWIPS metadata database.
--This script creates the AWIPS user, tablespace, database and objects
--accessed by the AWIPS Data Layer. Use psql to execute this script as the postgres user.
--Create the awips user and modify passwords
ALTER USER $USER_NAME with password 'postgres';
ALTER USER postgres with password 'postgres';
CREATE ROLE awips with password 'awips' login superuser createdb createrole;
ALTER USER awips with password 'awips';
--Create the metadata tablespace
CREATE TABLESPACE metadata owner awips location '$database_files_home/metadata';
--Create the database
CREATE DATABASE metadata OWNER awips TABLESPACE metadata;
--Switch to the metadata database
\c metadata;
CREATE PROCEDURAL LANGUAGE plpgsql;
--Create the AWIPS schema
CREATE SCHEMA awips AUTHORIZATION awips;
COMMENT ON ROLE awips IS 'Primary AWIPS user';
COMMENT ON DATABASE metadata IS 'AWIPS Metadata Database';
COMMENT ON TABLESPACE metadata IS 'AWIPS Metadata Database Tablespace';
COMMENT ON SCHEMA awips IS 'AWIPS Schema';
CREATE TABLESPACE pgdata_ihfs OWNER awips LOCATION '$database_files_home/pgdata_ihfs';
COMMENT ON TABLESPACE pgdata_ihfs IS 'IHFS Database tablespace';

View file

@ -23,7 +23,6 @@
--Create the awips user and modify passwords
ALTER USER %{databaseUsername} with password 'postgres';
ALTER USER postgres with password 'postgres';
CREATE ROLE awips with password 'awips' login superuser createdb createrole;
ALTER USER awips with password 'awips';
@ -35,7 +34,6 @@ CREATE DATABASE metadata OWNER awips TABLESPACE metadata;
--Switch to the metadata database
\c metadata;
CREATE PROCEDURAL LANGUAGE plpgsql;
--Create the AWIPS schema
CREATE SCHEMA awips AUTHORIZATION awips;

File diff suppressed because it is too large Load diff

View file

@ -1,471 +0,0 @@
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The '=' is optional.) White space may be used. Comments are introduced
# with '#' anywhere on a line. The complete list of option names and
# allowed values can be found in the PostgreSQL documentation. The
# commented-out settings shown in this file represent the default values.
#
# Please note that re-commenting a setting is NOT sufficient to revert it
# to the default value, unless you restart the server.
#
# Any option can also be given as a command line switch to the server,
# e.g., 'postgres -c log_connections=on'. Some options can be changed at
# run-time with the 'SET' SQL command.
#
# This file is read on server startup and when the server receives a
# SIGHUP. If you edit the file on a running system, you have to SIGHUP the
# server for the changes to take effect, or use "pg_ctl reload". Some
# settings, which are marked below, require a server shutdown and restart
# to take effect.
#
# Memory units: kB = kilobytes MB = megabytes GB = gigabytes
# Time units: ms = milliseconds s = seconds min = minutes h = hours d = days
#---------------------------------------------------------------------------
# FILE LOCATIONS
#---------------------------------------------------------------------------
# The default values of these variables are driven from the -D command line
# switch or PGDATA environment variable, represented here as ConfigDir.
#data_directory = 'ConfigDir' # use data in another directory
# (change requires restart)
#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
# (change requires restart)
#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
#external_pid_file = '(none)' # write an extra PID file
# (change requires restart)
#---------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#---------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 300 # (change requires restart)
# Note: increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction). You
# might also need to raise shared_buffers to support more connections.
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directory = '' # (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # octal
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
# - Security & Authentication -
#authentication_timeout = 1min # 1s-600s
#ssl = off # (change requires restart)
#password_encryption = on
#db_user_namespace = off
# Kerberos
#krb_server_keyfile = '' # (change requires restart)
#krb_srvname = 'postgres' # (change requires restart)
#krb_server_hostname = '' # empty string matches any keytab entry
# (change requires restart)
#krb_caseins_users = off # (change requires restart)
# - TCP Keepalives -
# see 'man 7 tcp' for details
#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
# 0 selects the system default
#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
# 0 selects the system default
#tcp_keepalives_count = 0 # TCP_KEEPCNT;
# 0 selects the system default
#---------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#---------------------------------------------------------------------------
# - Memory -
shared_buffers = 1024MB # min 128kB or max_connections*16kB
# (change requires restart)
temp_buffers = 16MB # min 800kB
#max_prepared_transactions = 5 # can be 0 or more
# (change requires restart)
# Note: increasing max_prepared_transactions costs ~600 bytes of shared memory
# per transaction slot, plus lock space (see max_locks_per_transaction).
work_mem = 8MB # min 64kB
maintenance_work_mem = 32MB # min 1MB
#max_stack_depth = 2MB # min 100kB
# - Free Space Map -
max_fsm_pages = 3500000 # min max_fsm_relations*16, 6 bytes each
# (change requires restart)
max_fsm_relations = 1500 # min 100, ~70 bytes each
# (change requires restart)
# - Kernel Resource Usage -
#max_files_per_process = 1000 # min 25
# (change requires restart)
#shared_preload_libraries = '' # (change requires restart)
# - Cost-Based Vacuum Delay -
#vacuum_cost_delay = 0 # 0-1000 milliseconds
#vacuum_cost_page_hit = 1 # 0-10000 credits
#vacuum_cost_page_miss = 10 # 0-10000 credits
#vacuum_cost_page_dirty = 20 # 0-10000 credits
#vacuum_cost_limit = 200 # 0-10000 credits
# - Background writer -
#bgwriter_delay = 200ms # 10-10000ms between rounds
#bgwriter_lru_percent = 1.0 # 0-100% of LRU buffers scanned/round
#bgwriter_lru_maxpages = 5 # 0-1000 buffers max written/round
#bgwriter_all_percent = 0.333 # 0-100% of all buffers scanned/round
#bgwriter_all_maxpages = 5 # 0-1000 buffers max written/round
#---------------------------------------------------------------------------
# WRITE AHEAD LOG
#---------------------------------------------------------------------------
# - Settings -
fsync = off # turns forced synchronization on or off
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
# fdatasync
# fsync
# fsync_writethrough
# open_sync
#full_page_writes = on # recover from partial page writes
#wal_buffers = 64kB # min 32kB
# (change requires restart)
commit_delay = 50000 # range 0-100000, in microseconds
commit_siblings = 5 # range 1-1000
# - Checkpoints -
checkpoint_segments = 10 # in logfile segments, min 1, 16MB each
#checkpoint_timeout = 5min # range 30s-1h
#checkpoint_warning = 30s # 0 is off
# - Archiving -
#archive_command = '' # command to use to archive a logfile segment
#archive_timeout = 0 # force a logfile segment switch after this
# many seconds; 0 is off
#---------------------------------------------------------------------------
# QUERY TUNING
#---------------------------------------------------------------------------
# - Planner Method Configuration -
#enable_bitmapscan = on
#enable_hashagg = on
#enable_hashjoin = on
#enable_indexscan = on
#enable_mergejoin = on
#enable_nestloop = on
#enable_seqscan = on
#enable_sort = on
#enable_tidscan = on
# - Planner Cost Constants -
#seq_page_cost = 1.0 # measured on an arbitrary scale
#random_page_cost = 4.0 # same scale as above
#cpu_tuple_cost = 0.01 # same scale as above
#cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above
effective_cache_size = 2048MB
# - Genetic Query Optimizer -
#geqo = on
#geqo_threshold = 12
#geqo_effort = 5 # range 1-10
#geqo_pool_size = 0 # selects default based on effort
#geqo_generations = 0 # selects default based on effort
#geqo_selection_bias = 2.0 # range 1.5-2.0
# - Other Planner Options -
#default_statistics_target = 10 # range 1-1000
#constraint_exclusion = off
#from_collapse_limit = 8
#join_collapse_limit = 8 # 1 disables collapsing of explicit
# JOINs
#---------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#---------------------------------------------------------------------------
# - Where to Log -
#log_destination = 'stderr' # Valid values are combinations of
# stderr, syslog and eventlog,
# depending on platform.
# This is used when logging to stderr:
logging_collector = on # Enable capturing of stderr into log
# files
# (change requires restart)
# These are only used if redirect_stderr is on:
log_directory = 'pg_log' # Directory where log files are written
# Can be absolute or relative to PGDATA
log_filename = 'postgresql-%A.log' # Log file name pattern.
# Can include strftime() escapes
log_truncate_on_rotation = on # If on, any existing log file of the same
# name as the new log file will be
# truncated rather than appended to. But
# such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
log_rotation_age = 1d # Automatic rotation of logfiles will
# happen after that time. 0 to
# disable.
log_rotation_size = 0 # Automatic rotation of logfiles will
# happen after that much log
# output. 0 to disable.
# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
# - When to Log -
#client_min_messages = notice # Values, in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error
#log_min_messages = notice # Values, in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic
#log_error_verbosity = default # terse, default, or verbose messages
log_min_error_statement = log # Values in order of increasing severity:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations.
#silent_mode = off # DO NOT USE without syslog or
# redirect_stderr
# (change requires restart)
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = off
#log_connections = off
#log_disconnections = off
#log_duration = off
log_line_prefix='%t %x %d : %h : '
# Special values:
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %p = PID
# %t = timestamp (no milliseconds)
# %m = timestamp with milliseconds
# %i = command tag
# %c = session id
# %l = session line number
# %s = session start timestamp
# %x = transaction id
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_statement = 'none' # none, ddl, mod, all
#log_hostname = off
#---------------------------------------------------------------------------
# RUNTIME STATISTICS
#---------------------------------------------------------------------------
# - Query/Index Statistics Collector -
#stats_command_string = on
#update_process_title = on
#stats_block_level = off
track_counts = on
#stats_reset_on_server_start = off # (change requires restart)
# - Statistics Monitoring -
#log_parser_stats = off
#log_planner_stats = off
#log_executor_stats = off
#log_statement_stats = off
#---------------------------------------------------------------------------
# AUTOVACUUM PARAMETERS
#---------------------------------------------------------------------------
autovacuum = on # enable autovacuum subprocess?
# 'on' requires stats_start_collector
# and stats_row_level to also be on
#autovacuum_naptime = 1min # time between autovacuum runs
#autovacuum_vacuum_threshold = 500 # min # of tuple updates before
# vacuum
#autovacuum_analyze_threshold = 250 # min # of tuple updates before
# analyze
#autovacuum_vacuum_scale_factor = 0.2 # fraction of rel size before
# vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of rel size before
# analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart)
#autovacuum_vacuum_cost_delay = -1 # default vacuum cost delay for
# autovacuum, -1 means use
# vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
# autovacuum, -1 means use
# vacuum_cost_limit
#---------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#---------------------------------------------------------------------------
# - Statement Behavior -
#search_path = '"$user",public' # schema names
#default_tablespace = '' # a tablespace name, '' uses
# the default
#check_function_bodies = on
#default_transaction_isolation = 'read committed'
#default_transaction_read_only = off
statement_timeout = 1800000 # 0 is disabled, statements running for more than 30 minutes will timeout
#vacuum_freeze_min_age = 100000000
# - Locale and Formatting -
datestyle = 'iso, mdy'
timezone = GMT # actually, defaults to TZ
# environment setting
#timezone_abbreviations = 'Default' # select the set of available timezone
# abbreviations. Currently, there are
# Default
# Australia
# India
# However you can also create your own
# file in share/timezonesets/.
#extra_float_digits = 0 # min -15, max 2
#client_encoding = 'en_US.UTF-8' # actually, defaults to database
# encoding
# These settings are initialized by initdb -- they might be changed
lc_messages = 'en_US.UTF-8' # locale for system error message
# strings
lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
lc_numeric = 'en_US.UTF-8' # locale for number formatting
lc_time = 'en_US.UTF-8' # locale for time formatting
# - Other Defaults -
#explain_pretty_print = on
#dynamic_library_path = '$libdir'
#local_preload_libraries = ''
#---------------------------------------------------------------------------
# LOCK MANAGEMENT
#---------------------------------------------------------------------------
#deadlock_timeout = 1s
#max_locks_per_transaction = 64 # min 10
# (change requires restart)
# Note: each lock table slot uses ~270 bytes of shared memory, and there are
# max_locks_per_transaction * (max_connections + max_prepared_transactions)
# lock table slots.
#---------------------------------------------------------------------------
# VERSION/PLATFORM COMPATIBILITY
#---------------------------------------------------------------------------
# - Previous Postgres Versions -
#add_missing_from = off
#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#default_with_oids = off
#escape_string_warning = on
#standard_conforming_strings = off
#regex_flavor = advanced # advanced, extended, or basic
#sql_inheritance = on
# - Other Platforms & Clients -
#transform_null_equals = off
#---------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#---------------------------------------------------------------------------
#custom_variable_classes = '' # list of custom variable class names

View file

@ -1,42 +0,0 @@
#!/bin/bash
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
# $1 = USER_HOME
# $2 = INSTALL_PATH
# $3 = databasePort
# $4 = database_files_home
# $5 = databaseUsername
# $6 = databaseGroup
echo "export LD_LIBRARY_PATH=\"$2/lib:\$LD_LIBRARY_PATH\" ##Added By EDEX Installer" >> $1/.bashrc
echo "export PATH=\"$2/bin:\$PATH\" ##Added By EDEX Installer" >> $1/.bashrc
perl -p -i -e "s/#port = 5432/port = ${3}/g" ${2}/share/sql/postgresql.conf
SETUPDIR=$2/share/sql
if [ "$5" == '$databaseUsername' ];
then
${SETUPDIR}/setup_developer.sh $2 $3 $4
else
${SETUPDIR}/setup_server.sh $2 $3 $4 $5 $6
fi

View file

@ -1,164 +0,0 @@
#!/bin/bash
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
# $1 == install directory
# $2 == port number
# $3 == database location directory
export LD_LIBRARY_PATH="${1}/lib"
/bin/chmod a+x ${1}/bin/*
PGDATA=${3}
PGHOME=${1}/share/sql
PGDATABASE=metadata
METADATA=${PGDATA}/metadata
IHFS=${PGDATA}/pgdata_ihfs
MAPS=${PGDATA}/maps
DAMCAT=${PGDATA}/damcat
HMDB=${PGDATA}/hmdb
USER=`whoami`
# Check to see if an instance of PostgreSQL is running on the port specified
PGCHECK=`/bin/netstat -l | /bin/grep -c "PGSQL.$2"`
CNT=0
while [ "$PGCHECK" -eq "1" ]
do
if [ "$CNT" -eq "0" ]
then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "!! WARNING!"
echo "!!"
echo "!! Another PostgreSQL process is running on"
echo "!! port $2. Please shut down the other"
echo "!! instance of PostgreSQL to continue install."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
CNT=`expr $CNT + 1`
fi
PGCHECK=`/bin/netstat -l | /bin/grep -c "PGSQL.$2"`
done
#start posgresql with the initdb command
echo **Initialize the database and start the service
mkdir -p $PGDATA
###cp ./conf/postgresql /etc/sysconfig/pgsql
###chmod 755 /etc/sysconfig/pgsql/postgresql
#copy non-default postgresql parameters to /etc/sysconfig/pgsql
${1}/bin/initdb --auth=trust --locale=en_US.UTF-8 --pgdata=${PGDATA} --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8
###rm -f ~postgres/.bash_profile
###cp ./conf/bash_profile ~postgres/.bash_profile
###chown postgres ~postgres/.bash_profile
###chgrp postgres ~postgres/.bash_profile
###/etc/init.d/postgresql start
#copy postgresql configuration for non-IPv6 kernels
#copy setup.sql to postgres dir
echo **Copy configuration files and setup sql
rm -f $PGDATA/postgresql.conf
cp $PGHOME/postgresql.conf $PGDATA
#create a metadata tablespace directory
echo **Create a directory for the metadata tablespace
mkdir $METADATA
#create a maps tablespace directory
echo **Create a directory for the maps tablespace
mkdir $MAPS
#create a ihfs tablespace directory
echo **Create a directory for the ihfs tablespace
mkdir $IHFS
#create a damcat tablespace directory
echo **Create a directory for the damcat tablespace
mkdir $DAMCAT
#create an hmdb tablespace directory
echo **Create a directory for the hmdb tablespace
mkdir $HMDB
#restart postgresql service
echo **Starting PostgreSQL configuration
${1}/bin/pg_ctl start -D ${PGDATA} -o "-p ${2}" -w
#create the tablespace and awips objects
echo **Run the initial SQL script
${1}/bin/psql postgres -U $USER -q -p $2 -f ${PGHOME}/initial_setup_developer.sql > $PGHOME/sql_install.log 2>&1
#create the postgis objects
echo **Create the GIS database
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${1}/share/lwpostgis.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${1}/share/spatial_ref_sys.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/permissions.sql >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating station table...
echo -----------------------------------------------------
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/create_subscription_tables.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/fxatext.sql >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating maps database...
echo -----------------------------------------------------
#${1}/bin/psql -d postgres -U $USER -q -p $2 -f ${PGHOME}/createMapsDb.sql >> $PGHOME/sql_install.log 2>&1
#${1}/bin/psql -d maps -U $USER -q -p $2 -f ${1}/share/lwpostgis.sql >> $PGHOME/sql_install.log 2>&1
#${1}/bin/psql -d maps -U $USER -q -p $2 -f ${1}/share/spatial_ref_sys.sql >> $PGHOME/sql_install.log 2>&1
#${1}/bin/pg_restore -d maps -U $USER -p $2 -n mapdata ${PGHOME}/maps.db >> $PGHOME/sql_install.log 2>&1
#${1}/bin/pg_restore -d maps -U $USER -n public -t geometry_columns -a ${PGHOME}/maps.db >> $PGHOME/sql_install.log 2>&1
${PGHOME}/initializeMapsDb.sh $1 $USER $2 >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating shef tables...
echo -----------------------------------------------------
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/hd_ob83oax.sql >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating damcat tables...
echo -----------------------------------------------------
${1}/bin/psql -d postgres -U $USER -q -p $2 -f ${PGHOME}/createDamcat.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d dc_ob7oax -U $USER -q -p $2 -f ${PGHOME}/dcob7oax.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d dc_ob7oax -U $USER -q -p $2 -f ${PGHOME}/populateDamcatDatabase.sql >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating HMDB database...
echo -----------------------------------------------------
${PGHOME}/createHMDB.sh ${1} ${2} ${USER} ${PGHOME} ${PGHOME}/sql_install.log
echo -----------------------------------------------------
echo \| Creating VTEC tables...
echo -----------------------------------------------------
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/vtec_initial_setup.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/create_p_vtec_tables.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/populate_p_vtec_tables.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/populate_vtec_events_table.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/populate_vtec_afos_product_table.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/populate_event_product_index.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/populate_vtec_event_tracking_table.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/create_h_vtec_tables.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $USER -q -p $2 -f ${PGHOME}/populate_h_vtec_tables.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/pg_ctl stop -D ${PGDATA} -o "-p ${2}" -w
#set the connections and restrict logons
echo **Copy additional configuration files
rm -f $PGDATA/pg_hba.conf
cp ${PGHOME}/pg_hba.conf $PGDATA/pg_hba.conf
echo Database creation is complete.

View file

@ -1,263 +0,0 @@
#!/bin/bash
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
# $1 == install directory
# $2 == port number
# $3 == database location directory
# $4 == username to log into postgres as
# $5 == group to set file permissions to
export LD_LIBRARY_PATH="${1}/lib"
/bin/chmod a+x ${1}/bin/*
PGDATA=${3}
PGHOME=${1}/share/sql
#PGDATABASE=metadata
METADATA=${PGDATA}/metadata
IHFS=${PGDATA}/pgdata_ihfs
MAPS=${PGDATA}/maps
DAMCAT=${PGDATA}/damcat
HMDB=${PGDATA}/hmdb
USER=`whoami`
# Check to see if an instance of PostgreSQL is running on the port specified
PGCHECK=`/bin/netstat -l | /bin/grep -c "PGSQL.$2"`
CNT=0
while [ "$PGCHECK" -eq "1" ]
do
if [ "$CNT" -eq "0" ]
then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "!! WARNING!"
echo "!!"
echo "!! Another PostgreSQL process is running on"
echo "!! port $2. Please shut down the other"
echo "!! instance of PostgreSQL to continue install."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
CNT=`expr $CNT + 1`
fi
PGCHECK=`/bin/netstat -l | /bin/grep -c "PGSQL.$2"`
done
# End of check
#start posgresql with the initdb command
echo **Initialize the database and start the service
mkdir -p $PGDATA
chown $4 $PGDATA
chgrp $5 $PGDATA
###cp ./conf/postgresql /etc/sysconfig/pgsql
###chmod 755 /etc/sysconfig/pgsql/postgresql
#copy non-default postgresql parameters to /etc/sysconfig/pgsql
if [ $USER = "root" ]; then
su $4 -c "${1}/bin/initdb --auth=trust --locale=en_US.UTF-8 --pgdata=${PGDATA} --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8"
elif [ $USER = $4 ]; then
${1}/bin/initdb --auth=trust --locale=en_US.UTF-8 --pgdata=${PGDATA} --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8
fi
###rm -f ~postgres/.bash_profile
###cp ./conf/bash_profile ~postgres/.bash_profile
###chown postgres ~postgres/.bash_profile
###chgrp postgres ~postgres/.bash_profile
###/etc/init.d/postgresql start
#copy postgresql configuration for non-IPv6 kernels
#copy setup.sql to postgres dir
echo **Copy configuration files and setup sql
rm -f $PGDATA/postgresql.conf
cp $PGHOME/postgresql.conf $PGDATA
chown $4 $PGDATA/postgresql.conf
chown $4 $PGHOME/initial_setup_server.sql
chown $4 $PGHOME/vtec_initial_setup.sql
chown $4 $PGHOME/create_p_vtec_tables.sql
chown $4 $PGHOME/populate_p_vtec_tables.sql
chown $4 $PGHOME/populate_vtec_events_table.sql
chown $4 $PGHOME/populate_vtec_afos_product_table.sql
chown $4 $PGHOME/populate_event_product_index.sql
chown $4 $PGHOME/populate_vtec_event_tracking_table.sql
chown $4 $PGHOME/create_h_vtec_tables.sql
chown $4 $PGHOME/populate_h_vtec_tables.sql
chown $4 $PGHOME/permissions.sql
chown $4 $PGHOME/create_subscription_tables.sql
chown $4 $PGHOME/fxatext.sql
chown $4 $PGHOME/hd_ob83oax.sql
chown $4 $PGHOME/IhfsSchema83.sql
chown $4 $PGHOME/IhfsSampleData83.sql
chown $4 $PGHOME/IhfsAlterSchema83.sql
chown $4 $PGHOME/createMapsDb.sql
chgrp $5 $PGDATA/postgresql.conf
chgrp $5 $PGHOME/initial_setup_server.sql
chgrp $5 $PGHOME/vtec_initial_setup.sql
chgrp $5 $PGHOME/create_p_vtec_tables.sql
chgrp $5 $PGHOME/populate_p_vtec_tables.sql
chgrp $5 $PGHOME/populate_vtec_events_table.sql
chgrp $5 $PGHOME/populate_vtec_afos_product_table.sql
chgrp $5 $PGHOME/populate_event_product_index.sql
chgrp $5 $PGHOME/populate_vtec_event_tracking_table.sql
chgrp $5 $PGHOME/create_h_vtec_tables.sql
chgrp $5 $PGHOME/populate_h_vtec_tables.sql
chgrp $5 $PGHOME/permissions.sql
chgrp $5 $PGHOME/create_subscription_tables.sql
chgrp $5 $PGHOME/fxatext.sql
chgrp $5 $PGHOME/hd_ob83oax.sql
chgrp $5 $PGHOME/IhfsSchema83.sql
chgrp $5 $PGHOME/IhfsSampleData83.sql
chgrp $5 $PGHOME/IhfsAlterSchema83.sql
chgrp $5 $PGHOME/createMapsDb.sql
#create a metadata tablespace directory
echo **Create a directory for the metadata tablespace
mkdir $METADATA
chown $4 $METADATA
chgrp $5 $METADATA
#create a maps tablespace directory
echo **Create a directory for the maps tablespace
mkdir $MAPS
chown $4 $MAPS
chgrp $5 $MAPS
#create a ihfs tablespace directory
echo **Create a directory for the ihfs tablespace
mkdir $IHFS
chown $4 $IHFS
chgrp $5 $IHFS
#create a damcat tablespace directory
echo **Create a directory for the damcat tablespace
mkdir $DAMCAT
chown $4 $DAMCAT
chgrp $5 $DAMCAT
#create an hmdb tablespace directory
echo **Create a directory for the hmdb tablespace
mkdir $HMDB
chown $4 $HMDB
chgrp $5 $HMDB
#restart postgresql service
echo **Starting PostgreSQL configuration
if [ $USER = "root" ]; then
su $4 -c "${1}/bin/pg_ctl start -D ${PGDATA} -o \"-p ${2}\" -w"
#create the tablespace and awips objects
echo **Run the initial SQL script
su $4 -c "${1}/bin/psql postgres -U $4 -q -p $2 -f ${PGHOME}/initial_setup_server.sql" > $PGHOME/sql_install.log 2>&1
chown $4 $PGHOME/sql_install.log
chgrp $5 $PGHOME/sql_install.log
#create the postgis objects
echo **Spatially enable the metadata database
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${1}/share/lwpostgis.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${1}/share/spatial_ref_sys.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/permissions.sql" >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating station table, this will take some time...
echo -----------------------------------------------------
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/create_subscription_tables.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/fxatext.sql" >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating maps database...
echo -----------------------------------------------------
#su $4 -c "${1}/bin/psql -d postgres -U $4 -q -p $2 -f ${PGHOME}/createMapsDb.sql" >> $PGHOME/sql_install.log 2>&1
#su $4 -c "${1}/bin/psql -d maps -U $4 -q -p $2 -f ${1}/share/lwpostgis.sql" >> $PGHOME/sql_install.log 2>&1
#su $4 -c "${1}/bin/psql -d maps -U $4 -q -p $2 -f ${1}/share/spatial_ref_sys.sql" >> $PGHOME/sql_install.log 2>&1
#su $4 -c "${1}/bin/pg_restore -d maps -U $4 -p $2 -n mapdata ${PGHOME}/maps.db" >> $PGHOME/sql_install.log 2>&1
#su $4 -c "${1}/bin/pg_restore -d maps -U $4 -p $2 -n public -t geometry_columns -a ${PGHOME}/maps.db" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${PGHOME}/initializeMapsDb.sh $1 $4 $2" >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating shef tables...
echo -----------------------------------------------------
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/hd_ob83oax.sql" >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating damcat tables...
echo -----------------------------------------------------
su $4 -c "${1}/bin/psql -d postgres -U $4 -q -p $2 -f ${PGHOME}/createDamcat.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d dc_ob7oax -U $4 -q -p $2 -f ${PGHOME}/dcob7oax.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d dc_ob7oax -U $4 -q -p $2 -f ${PGHOME}/populateDamcatDatabase.sql" >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating HMDB database...
echo -----------------------------------------------------
su $4 -c "${PGHOME}/createHMDB.sh ${1} ${2} ${4} ${PGHOME} ${PGHOME}/sql_install.log"
echo -----------------------------------------------------
echo \| Creating VTEC tables...
echo -----------------------------------------------------
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/vtec_initial_setup.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/create_p_vtec_tables.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/populate_p_vtec_tables.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/populate_vtec_events_table.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/populate_vtec_afos_product_table.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/populate_event_product_index.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/populate_vtec_event_tracking_table.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/create_h_vtec_tables.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/populate_h_vtec_tables.sql" >> $PGHOME/sql_install.log 2>&1
su $4 -c "${1}/bin/pg_ctl stop -D ${PGDATA} -o \"-p ${2}\" -w"
elif [ $USER = $4 ]; then
${1}/bin/pg_ctl start -D ${PGDATA} -o "-p ${2}" -w
#create the tablespace and awips objects
echo **Run the initial SQL script
${1}/bin/psql postgres -U $4 -q -p $2 -f ${PGHOME}/initial_setup.sql > $PGHOME/sql_install.log 2>&1
#create the postgis objects
echo **Create the GIS database
${1}/bin/createlang -p $2 plpgsql metadata
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${1}/share/lwpostgis.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${1}/share/spatial_ref_sys.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/permissions.sql >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating station table, this will take some time...
echo -----------------------------------------------------
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/create_subscription_tables.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/fxatext.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/hd_ob81oax.sql >> $PGHOME/sql_install.log 2>&1
echo -----------------------------------------------------
echo \| Creating shef tables...
echo -----------------------------------------------------
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/IhfsSchema83.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/IhfsSampleData83.sql >> $PGHOME/sql_install.log 2>&1
${1}/bin/psql -d metadata -U $4 -q -p $2 -f ${PGHOME}/IhfsAlterSchema83.sql $PGHOME/sql_install.log
${1}/bin/pg_ctl stop -D ${PGDATA} -o "-p ${2}" -w
fi
#set the connections and restrict logons
echo **Copy additional configuration files
rm -f $PGDATA/pg_hba.conf
cp ${PGHOME}/pg_hba.conf $PGDATA/pg_hba.conf
chown $4 ${PGDATA}/pg_hba.conf
chgrp $5 ${PGDATA}/pg_hba.conf
echo Database creation is complete.

View file

@ -1,36 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
alter user $USER_NAME with password 'postgres';
create role awips with password 'awips' login nosuperuser;
create tablespace metadata owner awips location '$database_files_home/metadata';
create database metadata owner awips tablespace metadata;
\c metadata;
create schema awips authorization awips;
create table awips.static();
alter table awips.static owner to awips;
create or replace rule rule_static as on insert to awips.static do also delete from awips.static;
CREATE TABLE awips.plugin_version (name varchar(20),table_name varchar(40),version varchar(10),"key" int4 NOT NULL,hib_class varchar(40),CONSTRAINT plugin_version_pkey PRIMARY KEY ("key")) WITH OIDS;
ALTER TABLE awips.plugin_version OWNER TO awips;
create sequence awips.hibernate_sequence start 1 increment 1;
alter table awips.hibernate_sequence owner to awips;

File diff suppressed because it is too large Load diff

View file

@ -1,27 +0,0 @@
#!/bin/sh
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
# $1 = database files home
# remove the database files directory just in case it is outside of the main
# awips directory
if [ -e ${1} ]; then
rm -rf ${1}
fi

View file

@ -7,6 +7,7 @@ Version: %{_component_version}
Release: %{_component_release}
Group: AWIPSII
BuildRoot: /tmp
BuildArch: noarch
URL: N/A
License: N/A
Distribution: N/A
@ -53,4 +54,7 @@ fi
rm -rf ${RPM_BUILD_ROOT}
%files
%attr(644,awips,fxalpha) /awips2/data/postgresql.conf
%defattr(644,awips,fxalpha,755)
%dir /awips2
%dir /awips2/data
/awips2/data/postgresql.conf

View file

@ -7,6 +7,7 @@ Version: %{_component_version}
Release: %{_component_release}
Group: AWIPSII
BuildRoot: /tmp
BuildArch: noarch
URL: N/A
License: N/A
Distribution: N/A
@ -53,4 +54,7 @@ fi
rm -rf ${RPM_BUILD_ROOT}
%files
%attr(644,awips,fxalpha) /awips2/data/postgresql.conf
%defattr(644,awips,fxalpha,755)
%dir /awips2
%dir /awips2/data
/awips2/data/postgresql.conf

View file

@ -11,6 +11,7 @@ Version: %{_component_version}
Release: %{_component_release}
Group: AWIPSII
BuildRoot: /tmp
BuildArch: noarch
Prefix: %{_component_default_prefix}
URL: N/A
License: N/A
@ -72,23 +73,6 @@ do
cp -r %{_baseline_workspace}/${PATH_TO_DDL}/${dir}/* \
${RPM_BUILD_ROOT}/awips2/database/sqlScripts/share/sql
done
# All Files To Exclude Are In share/sql/setup
FILES_TO_EXCLUDE=( 'lwpostgis.sql' 'spatial_ref_sys.sql' 'uninstalldb.sh' \
'setup.sh' 'setup_developer.sh' 'setup_server.sh' 'postgresql.conf' )
PATH_TO_EXCLUDE_FILES=${RPM_BUILD_ROOT}/awips2/database/sqlScripts/share/sql
for file in ${FILES_TO_EXCLUDE[*]};
do
if [ -f ${PATH_TO_EXCLUDE_FILES}/${file} ]; then
rm -f ${PATH_TO_EXCLUDE_FILES}/${file}
fi
done
# Copy Two Other Files To The Temporary Share Directory.
cp -r %{_baseline_workspace}/${PATH_TO_DDL}/setup/lwpostgis.sql \
${RPM_BUILD_ROOT}/awips2/database/sqlScripts/share
cp -r %{_baseline_workspace}/${PATH_TO_DDL}/setup/spatial_ref_sys.sql \
${RPM_BUILD_ROOT}/awips2/database/sqlScripts/share
# Create our installation log file.
touch ${RPM_BUILD_ROOT}/awips2/database/sqlScripts/share/sql/sql_install.log
@ -111,17 +95,6 @@ if [ "${1}" = "2" ]; then
exit 0
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| Installing the AWIPS II Database Installation...\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
POSTGRESQL_INSTALL="/awips2/postgresql"
PSQL_INSTALL="/awips2/psql"
AWIPS2_DATA_DIRECTORY="/awips2/data"
echo -e "\e[1;34m Installation Root = ${RPM_INSTALL_PREFIX}\e[m"
echo -e "\e[1;34m PostgreSQL Install Root = ${POSTGRESQL_INSTALL}\e[m"
echo -e "\e[1;34m PSQL Install Root = ${PSQL_INSTALL}\e[m"
echo -e "\e[1;34m AWIPS II Data Directory = ${AWIPS2_DATA_DIRECTORY}\e[m"
%post
# Get Important Directories Again. Even Exporting Them The First Time Still
# Will Not Make Them Available.
@ -148,9 +121,6 @@ function printFailureMessage()
exit 1
}
echo "--------------------------------------------------------------------------------"
echo "\| Preparing the SQL Scripts..."
echo "--------------------------------------------------------------------------------"
AWIPS_DEFAULT_OWNER="awips"
AWIPS_DEFAULT_USER="awips"
@ -176,15 +146,10 @@ function is_postgresql_running()
{
NUM_PGSQL_COUNT=`/bin/netstat -l | /bin/grep -c "PGSQL.${AWIPS_DEFAULT_PORT}"`
if [ ${NUM_PGSQL_COUNT} -gt 0 ]; then
echo "--------------------------------------------------------------------------------"
echo "\| Warning - PostgreSQL Is Already Running On Port ${AWIPS_DEFAULT_PORT}."
echo "--------------------------------------------------------------------------------"
echo "PostgreSQL is already running or PostgreSQL lock files exist!" > \
/awips2/database/sqlScripts/share/sql/sql_install.log
printFailureMessage
fi
echo "--------------------------------------------------------------------------------"
echo "\| No Instances of PostgreSQL Were Found On Port ${AWIPS_DEFAULT_PORT}..."
echo "--------------------------------------------------------------------------------"
}
function create_sql_element()
@ -241,28 +206,10 @@ function execute_initial_sql_script()
# $1 == script to execute
su ${AWIPS_DEFAULT_USER} -c \
"${PSQL_INSTALL}/bin/psql postgres -U ${AWIPS_DEFAULT_USER} -q -p ${AWIPS_DEFAULT_PORT} -f ${1}" \
"${PSQL_INSTALL}/bin/psql -d postgres -U ${AWIPS_DEFAULT_USER} -q -p ${AWIPS_DEFAULT_PORT} -f ${1}" \
> ${SQL_LOG} 2>&1
}
function update_lwpostgis()
{
echo ${POSTGRESQL_INSTALL} | sed 's/\//\\\//g' > .awips2_escape.tmp
POSTGRESQL_INSTALL_ESCAPED=`cat .awips2_escape.tmp`
rm -f .awips2_escape.tmp
perl -p -i -e "s/%{INSTALL_PATH}%/${POSTGRESQL_INSTALL_ESCAPED}/g" \
${SHARE_DIR}/lwpostgis.sql
}
function update_createMapsDb()
{
echo ${AWIPS2_DATA_DIRECTORY} | sed 's/\//\\\//g' > .awips2_escape.tmp
AWIPS2_DATA_DIRECTORY_ESCAPED=`cat .awips2_escape.tmp`
rm -f .awips2_escape.tmp
perl -p -i -e "s/%{database_files_home}%/${AWIPS2_DATA_DIRECTORY_ESCAPED}/g" \
${SQL_SHARE_DIR}/createMapsDb.sql
}
function update_createDamcat()
{
echo ${AWIPS2_DATA_DIRECTORY} | sed 's/\//\\\//g' > .awips2_escape.tmp
@ -307,96 +254,40 @@ function copy_addl_config()
update_owner ${AWIPS2_DATA_DIRECTORY}/pg_hba.conf
}
echo "--------------------------------------------------------------------------------"
echo "\| Determining If PostgreSQL Is Running..."
echo "--------------------------------------------------------------------------------"
is_postgresql_running
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Initializing the Database and Starting the Service..."
echo "--------------------------------------------------------------------------------"
init_db
RC="$?"
if [ ! "${RC}" = "0" ]; then
echo "--------------------------------------------------------------------------------"
echo "\| ERROR - INITDB HAS FAILED."
echo "--------------------------------------------------------------------------------"
printFailureMessage
fi
echo "--------------------------------------------------------------------------------"
echo "\| Copying Configuration Files and Setting Up SQL..."
echo "--------------------------------------------------------------------------------"
echo "--------------------------------------------------------------------------------"
echo "\| Creating a Directory for the metadata Tablespace..."
echo "--------------------------------------------------------------------------------"
create_sql_element ${METADATA}
echo "--------------------------------------------------------------------------------"
echo "\| Creating a Directory for the ihfs Tablespace..."
echo "--------------------------------------------------------------------------------"
create_sql_element ${IFHS}
echo "--------------------------------------------------------------------------------"
echo "\| Creating a Directory for the damcat Tablespace..."
echo "--------------------------------------------------------------------------------"
create_sql_element ${DAMCAT}
echo "--------------------------------------------------------------------------------"
echo "\| Creating a Directory for the hmdb Tablespace..."
echo "--------------------------------------------------------------------------------"
create_sql_element ${HMDB}
echo "--------------------------------------------------------------------------------"
echo "\| Creating a Directory for the ebxml Tablespace..."
echo "--------------------------------------------------------------------------------"
create_sql_element ${EBXML}
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Starting PostgreSQL..."
echo "--------------------------------------------------------------------------------"
control_pg_ctl "start"
RC="$?"
# Ensure that the database started.
if [ ! "${RC}" = "0" ]; then
echo "--------------------------------------------------------------------------------"
echo "\| ERROR - UNABLE TO START THE POSTGRESQL SERVER."
echo "--------------------------------------------------------------------------------"
if [ $? -ne 0 ]; then
printFailureMessage
fi
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Run the Initial SQL Script..."
echo "--------------------------------------------------------------------------------"
execute_initial_sql_script ${SQL_SHARE_DIR}/initial_setup_server.sql
update_lwpostgis
echo "--------------------------------------------------------------------------------"
echo "\| Spatially Enabling the metadata Database..."
echo "--------------------------------------------------------------------------------"
execute_psql_sql_script ${SHARE_DIR}/lwpostgis.sql metadata
execute_psql_sql_script ${SHARE_DIR}/spatial_ref_sys.sql metadata
execute_psql_sql_script /awips2/postgresql/share/contrib/postgis-2.0/postgis.sql metadata
execute_psql_sql_script /awips2/postgresql/share/contrib/postgis-2.0/spatial_ref_sys.sql metadata
execute_psql_sql_script /awips2/postgresql/share/contrib/postgis-2.0/rtpostgis.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/permissions.sql metadata
echo "--------------------------------------------------------------------------------"
echo "\| Creating station Table..."
echo "--------------------------------------------------------------------------------"
execute_psql_sql_script ${SQL_SHARE_DIR}/create_subscription_tables.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/fxatext.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/afoslookup.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/bit_table.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/collective.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/national_category.sql metadata
# create the events schema
execute_psql_sql_script ${SQL_SHARE_DIR}/createEventsSchema.sql metadata
echo "--------------------------------------------------------------------------------"
echo "\| Creating shef Tables..."
echo "--------------------------------------------------------------------------------"
execute_psql_sql_script ${SQL_SHARE_DIR}/hd_ob83oax.sql metadata
update_createDamcat
echo "--------------------------------------------------------------------------------"
echo "\| Creating damcat Tables..."
echo "--------------------------------------------------------------------------------"
execute_psql_sql_script ${SQL_SHARE_DIR}/createDamcat.sql postgres
execute_psql_sql_script ${SQL_SHARE_DIR}/dcob7oax.sql dc_ob7oax
execute_psql_sql_script ${SQL_SHARE_DIR}/populateDamcatDatabase.sql dc_ob7oax
@ -406,39 +297,13 @@ su ${AWIPS_DEFAULT_USER} -c \
"${SQL_SHARE_DIR}/createHMDB.sh ${PSQL_INSTALL} ${AWIPS_DEFAULT_PORT} ${AWIPS_DEFAULT_USER} ${SQL_SHARE_DIR} ${SQL_LOG}"
update_createEbxml
echo "--------------------------------------------------------------------------------"
echo "\| Creating ebxml Tables..."
echo "--------------------------------------------------------------------------------"
execute_psql_sql_script ${SQL_SHARE_DIR}/createEbxml.sql postgres
echo "--------------------------------------------------------------------------------"
echo "\| Creating VTEC Tables..."
echo "--------------------------------------------------------------------------------"
execute_psql_sql_script ${SQL_SHARE_DIR}/vtec_initial_setup.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/create_p_vtec_tables.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/populate_p_vtec_tables.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/populate_vtec_events_table.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/populate_vtec_afos_product_table.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/populate_event_product_index.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/populate_vtec_event_tracking_table.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/create_h_vtec_tables.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/populate_h_vtec_tables.sql metadata
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Stopping PostgreSQL..."
echo "--------------------------------------------------------------------------------"
control_pg_ctl "stop"
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Copy Additional Configuration Files..."
echo "--------------------------------------------------------------------------------"
copy_addl_config
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;32m\| AWIPS II Database Installation - COMPLETE\e[m"
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
%preun
if [ "${1}" = "1" ]; then
exit 0
@ -485,9 +350,6 @@ su ${DB_OWNER} -c \
"${PG_CTL} status -D /awips2/data > /dev/null 2>&1"
RC="$?"
if [ ! "${RC}" = "0" ]; then
echo "--------------------------------------------------------------------------------"
echo "\| Starting PostgreSQL As User - ${DB_OWNER}..."
echo "--------------------------------------------------------------------------------"
su ${DB_OWNER} -c \
"${POSTMASTER} -D /awips2/data > /dev/null 2>&1 &"
RC="$?"
@ -514,17 +376,14 @@ do
"${DROPDB} -U awips ${db}"
done
echo ""
# Attempt To Drop The Tablespaces In Our List ...
for tb in ${TBS_TO_DROP[*]};
do
echo "Dropping Tablespace ... ${tb}"
TB_DIR=`${PSQL} -U awips -d postgres -c "\db" | grep ${tb} | awk '{print $5}'`
su ${DB_OWNER} -c \
"${PSQL} -U awips -d postgres -c \"DROP TABLESPACE ${tb}\""
# remove the tablespace directory.
echo "Attempting To Remove Directory: ${TB_DIR}"
if [ -d "${TB_DIR}" ]; then
su ${DB_OWNER} -c "rmdir ${TB_DIR}"
fi
@ -532,18 +391,11 @@ done
# Attempt To Stop PostgreSQL (If We Started It)
if [ "${I_STARTED_POSTGRESQL}" = "Y" ]; then
echo ""
su ${DB_OWNER} -c \
"${PG_CTL} stop -D /awips2/data"
fi
%postun
if [ "${1}" = "1" ]; then
exit 0
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| The AWIPS II Database Installation Has Been Successfully Removed\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
%clean
rm -rf ${RPM_BUILD_ROOT}
@ -558,7 +410,6 @@ rm -rf ${RPM_BUILD_ROOT}
/awips2/database/sqlScripts/share/sql/pg_hba.conf
%defattr(755,awips,fxalpha,755)
/awips2/database/sqlScripts/share/*.sql
%dir /awips2/database/sqlScripts/share/sql
/awips2/database/sqlScripts/share/sql/*.sql
/awips2/database/sqlScripts/share/sql/*.sh

View file

@ -1,27 +0,0 @@
#!/bin/bash
export DELTA_BUILD="11.4"
export DELTA_ID="updateA2_32211_acars1"
export DELTA_DESC="drop acarssoundinglayer and acarssounding tables due to schema change"
export DELTA_RUN_USER="awips"
function runUpdate()
{
local PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-psql`
local PSQL="${PSQL_INSTALL}/bin/psql -U awips -d metadata -c"
# Drop acarssoundinglayer
${PSQL} "drop table acarssoundinglayer;" > /dev/null 2>&1
# Drop acarssounding
${PSQL} "drop table acarssounding;" > /dev/null 2>&1
# Update plugin_info
${PSQL} "update plugin_info set initialized=false where name='acarssounding';" > /dev/null 2>&1
return 0
}

View file

@ -1,37 +0,0 @@
#!/bin/bash
export DELTA_BUILD="11.4"
export DELTA_ID="update_32811_gfe"
export DELTA_DESC="purge existing gfe hdf5 files; uninitialize gfe in plugin_info."
export DELTA_RUN_USER="awips"
function runUpdate()
{
local PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-psql`
local PSQL="${PSQL_INSTALL}/bin/psql -U awips -d metadata -c"
local HDF5_DIR="/awips2/edex/data/hdf5/gfe"
# remove existing gfe hdf5 files
cd ${HDF5_DIR}
local COUNT=`ls -1 | wc -l`
if [ "${COUNT}" -gt 0 ]; then
for dir in `ls -1 ${HDF5_DIR}`;
do
if [ ! "${dir}" = "climo" ] &&
[ ! "${dir}" = "hlsTopo" ]; then
if [ -d ${HDF5_DIR}/${dir} ]; then
rm -rf ${HDF5_DIR}/${dir}/*
fi
fi
done
fi
# re-initialize plugin_info
${PSQL} "UPDATE plugin_info SET initialized='False' WHERE name='gfe';" > /dev/null 2>&1
return 0
}

View file

@ -1,79 +0,0 @@
#!/bin/bash
export DELTA_BUILD="11.4"
export DELTA_ID="updateA2_DR2469_purge"
export DELTA_DESC="remove unused columns in plugin_info and purge satellite, sfcobs, bufrsigwx, and bufrmos tables"
export DELTA_RUN_USER="awips"
function runUpdate()
{
local HDF5_DIR="/awips2/edex/data/hdf5"
# find psql.
local PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-psql`
local PSQL="${PSQL_INSTALL}/bin/psql -U awips -d metadata -c"
################################################################
# Remove the unused columns from the plugin_info table
################################################################
${PSQL} "ALTER TABLE awips.plugin_info DROP COLUMN version;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
${PSQL} "ALTER TABLE awips.plugin_info DROP COLUMN retentiontime;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
################################################################
# Delete all satellite data due to HDF5 path changes
################################################################
${PSQL} "DELETE FROM awips.satellite;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
rm -rf ${HDF5_DIR}/satellite
################################################################
# Delete all sfcobs data due to HDF5 path changes
################################################################
${PSQL} "DELETE FROM awips.sfcobs;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
rm -rf ${HDF5_DIR}/sfcobs
################################################################
# Delete all bufrsigwx data due to HDF5 path changes
################################################################
${PSQL} "DELETE FROM awips.bufrsigwx;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
rm -rf ${HDF5_DIR}/bufrsigwx
################################################################
# Delete all bufrmos data due to HDF5 path changes
################################################################
${PSQL} "DELETE FROM awips.bufrmos;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
rm -rf ${HDF5_DIR}/bufrmos
################################################################
# Rename grib files
################################################################
cd ${HDF5_DIR}/grib
find . -name "*.h5" -exec bash -c "mv \$1 \`echo \$1 | sed s/00-FH-/-FH-/\`" -- {} \;
return 0
}

View file

@ -1,18 +0,0 @@
#!/bin/bash
export DELTA_BUILD="11.4"
export DELTA_ID="updateA2_DR7018_ActiveTable1"
export DELTA_DESC="Expand ActiveTableRecord.overviewtext hibernate field."
export DELTA_RUN_USER="awips"
function runUpdate()
{
local PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-psql`
local PSQL="${PSQL_INSTALL}/bin/psql -U awips -d metadata -c" > /dev/null 2>&1
${PSQL} "ALTER TABLE activetable ALTER COLUMN overviewtext TYPE text;"
return 0
}

View file

@ -1,18 +0,0 @@
#!/bin/bash
export DELTA_BUILD="11.4"
export DELTA_ID="updateA2_DR7018_Warning1"
export DELTA_DESC="Expand WarningRecord.overviewtext hibernate field."
export DELTA_RUN_USER="awips"
function runUpdate()
{
local PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-psql`
local PSQL="${PSQL_INSTALL}/bin/psql -U awips -d metadata -c" > /dev/null 2>&1
${PSQL} "ALTER TABLE warning ALTER COLUMN overviewtext TYPE text;"
return 0
}

View file

@ -1,42 +0,0 @@
#!/bin/bash
export DELTA_BUILD="11.4"
export DELTA_ID="updateA2_pilDelta_purge"
export DELTA_DESC="remove old-style subscription tables"
export DELTA_RUN_USER="awips"
function runUpdate()
{
#find pgsql
local PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-psql`
local PSQL="${PSQL_INSTALL}/bin/psql -U awips -d metadata -c"
################################################################
# Remove the static table.
################################################################
${PSQL} "DROP TABLE IF EXISTS subscription.static;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
################################################################
# Remove the replacements table.
################################################################
${PSQL} "DROP TABLE IF EXISTS subscription.replacements;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
################################################################
# Remove the subscriptions table.
################################################################
${PSQL} "DROP TABLE IF EXISTS subscription.subscriptions;"
RC="$?"
if [ ! "${RC}" = "0" ]; then
return 1
fi
return 0
}

View file

@ -114,7 +114,7 @@ fi
_QPID_VERSION="0.7"
RPM_PROJECT="%{_baseline_workspace}/rpms"
POSTGRES_INITD="${RPM_PROJECT}/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres"
POSTGRES_INITD="${RPM_PROJECT}/awips2.core/Installer.postgres/scripts/init.d/edex_postgres"
QPID_INITD="${RPM_PROJECT}/awips2.qpid/${_QPID_VERSION}/SOURCES/qpidd"
QUEUE_SH="${RPM_PROJECT}/awips2.qpid/${_QPID_VERSION}/SOURCES/queueCreator.sh"
EDEX_INITD="${RPM_PROJECT}/awips2.edex/Installer.edex-base/scripts/init.d/edex_camel"

View file

@ -9,6 +9,7 @@ Version: %{_component_version}
Release: %{_component_release}
Group: AWIPSII
BuildRoot: /tmp
BuildArch: noarch
URL: N/A
License: N/A
Distribution: N/A
@ -82,15 +83,6 @@ if [ ! -f /awips2/data/postgresql.conf ]; then
exit 1
fi
if [ "${1}" = "2" ]; then
exit 0
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| Installing The AWIPS Maps Database Distribution...\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m Installation Root = /awips2/database\e[m"
%post
if [ "${1}" = "2" ]; then
exit 0
@ -130,26 +122,16 @@ RC="$?"
# Start PostgreSQL if it is not running.
if [ ! "${RC}" = "0" ]; then
echo "--------------------------------------------------------------------------------"
echo "\| Starting PostgreSQL As User - ${DB_OWNER}..."
echo "--------------------------------------------------------------------------------"
su ${DB_OWNER} -c \
"${POSTMASTER} -D /awips2/data > /dev/null 2>&1 &"
RC="$?"
if [ ! "${RC}" = "0" ]; then
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Error - failed to start the PostgreSQL Server."
echo "--------------------------------------------------------------------------------"
printFailureMessage
fi
# Give PostgreSQL Time To Start.
sleep 10
I_STARTED_POSTGRESQL="YES"
else
echo "--------------------------------------------------------------------------------"
echo "\| Found Running PostgreSQL Server..."
echo "--------------------------------------------------------------------------------"
# Show The User.
su ${DB_OWNER} -c \
"${PG_CTL} status -D /awips2/data"
@ -161,78 +143,53 @@ MAPS_DB=`${PSQL} -U awips -l | grep maps | awk '{print $1}'`
if [ "${MAPS_DB}" = "maps" ]; then
MAPS_DB_EXISTS="true"
# We Have a Maps Database, There Is Nothing To Do.
echo "--------------------------------------------------------------------------------"
echo "\| Maps Database Already Exists..."
echo "--------------------------------------------------------------------------------"
fi
if [ "${MAPS_DB_EXISTS}" = "false" ]; then
# Create the maps directory; remove any existing directories.
echo "--------------------------------------------------------------------------------"
echo "\| Creating a Directory for the maps Tablespace..."
echo "--------------------------------------------------------------------------------"
if [ -d /awips2/data/maps ]; then
su ${DB_OWNER} -c "rm -rf /awips2/data/maps"
fi
su ${DB_OWNER} -c "mkdir -p /awips2/data/maps"
# Update: lwpostgis.sql
echo ${POSTGRESQL_INSTALL} | sed 's/\//\\\//g' > .awips2_escape.tmp
POSTGRESQL_INSTALL_ESCAPED=`cat .awips2_escape.tmp`
rm -f .awips2_escape.tmp
perl -p -i -e "s/%{INSTALL_PATH}%/${POSTGRESQL_INSTALL_ESCAPED}/g" \
/awips2/database/sqlScripts/share/lwpostgis.sql
# Update the sql script that creates the maps database / tables.
perl -p -i -e "s/%{database_files_home}%/\/awips2\/data/g" \
/awips2/database/sqlScripts/share/sql/maps/createMapsDb.sql
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Creating maps Database..."
echo "--------------------------------------------------------------------------------"
# Run the setup sql for the maps database.
SQL_FILE="/awips2/database/sqlScripts/share/sql/maps/createMapsDb.sql"
su ${DB_OWNER} -c \
"${PSQL} -d postgres -U awips -q -p 5432 -f ${SQL_FILE}" >> ${SQL_LOG} 2>&1
RC=$?
if [ ! "${RC}" -eq 0 ]; then
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Error - Failed to execute: createMapsDb.sql."
echo "--------------------------------------------------------------------------------"
printFailureMessage
fi
SQL_FILE="/awips2/database/sqlScripts/share/lwpostgis.sql"
SQL_FILE="/awips2/postgresql/share/contrib/postgis-2.0/postgis.sql"
su ${DB_OWNER} -c \
"${PSQL} -d maps -U awips -q -p 5432 -f ${SQL_FILE}" >> ${SQL_LOG} 2>&1
RC=$?
if [ ! "${RC}" -eq 0 ]; then
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Error - Failed to execute: lwpostgis.sql."
echo "--------------------------------------------------------------------------------"
printFailureMessage
fi
SQL_FILE="/awips2/database/sqlScripts/share/spatial_ref_sys.sql"
SQL_FILE="/awips2/postgresql/share/contrib/postgis-2.0/spatial_ref_sys.sql"
su ${DB_OWNER} -c \
"${PSQL} -d maps -U awips -q -p 5432 -f ${SQL_FILE}" >> ${SQL_LOG} 2>&1
RC=$?
if [ ! "${RC}" -eq 0 ]; then
printFailureMessage
fi
SQL_FILE="/awips2/postgresql/share/contrib/postgis-2.0/rtpostgis.sql"
su ${DB_OWNER} -c \
"${PSQL} -d maps -U awips -q -p 5432 -f ${SQL_FILE}" >> ${SQL_LOG} 2>&1
RC=$?
if [ ! "${RC}" -eq 0 ]; then
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Error - Failed to execute: spatial_ref_sys.sql."
echo "--------------------------------------------------------------------------------"
printFailureMessage
fi
# Import the data into the maps database.
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Restoring map data..."
echo "--------------------------------------------------------------------------------"
DB_ARCHIVE="/awips2/database/sqlScripts/share/sql/maps/maps.db"
su ${DB_OWNER} -c \
"${PG_RESTORE} -d maps -U awips -p 5432 -n mapdata ${DB_ARCHIVE}" >> ${SQL_LOG} 2>&1
@ -244,10 +201,6 @@ fi
# stop PostgreSQL if we started it.
if [ "${I_STARTED_POSTGRESQL}" = "YES" ]; then
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Stopping PostgreSQL As User - ${DB_OWNER}..."
echo "--------------------------------------------------------------------------------"
su ${DB_OWNER} -c \
"${PG_CTL} stop -D /awips2/data"
RC="$?"
@ -256,10 +209,6 @@ if [ "${I_STARTED_POSTGRESQL}" = "YES" ]; then
fi
sleep 10
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| SUCCESSFUL INSTALLATION ~ awips2-maps-database\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
%preun
if [ "${1}" = "1" ]; then
@ -304,9 +253,6 @@ RC="$?"
# Start PostgreSQL if it is not running.
if [ ! "${RC}" = "0" ]; then
echo "--------------------------------------------------------------------------------"
echo "\| Starting PostgreSQL As User - ${DB_OWNER}..."
echo "--------------------------------------------------------------------------------"
su ${DB_OWNER} -c \
"${POSTMASTER} -D /awips2/data > /dev/null 2>&1 &"
RC="$?"
@ -318,9 +264,6 @@ if [ ! "${RC}" = "0" ]; then
sleep 10
I_STARTED_POSTGRESQL="YES"
else
echo "--------------------------------------------------------------------------------"
echo "\| Found Running PostgreSQL Server..."
echo "--------------------------------------------------------------------------------"
# Show The User.
su ${DB_OWNER} -c \
"${PG_CTL} status -D /awips2/data"
@ -331,10 +274,6 @@ MAPS_DB=`${PSQL} -U awips -l | grep maps | awk '{print $1}'`
if [ "${MAPS_DB}" = "maps" ]; then
# drop the maps database
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Dropping the maps Database..."
echo "--------------------------------------------------------------------------------"
su ${DB_OWNER} -c \
"${DROPDB} -U awips maps" >> ${SQL_LOG}
fi
@ -345,10 +284,6 @@ MAPS_DIR=`${PSQL} -U awips -d postgres -c "\db" | grep maps | awk '{print $5}'`
if [ ! "${MAPS_DIR}" = "" ]; then
# drop the maps tablespace
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Dropping the maps Tablespace..."
echo "--------------------------------------------------------------------------------"
su ${DB_OWNER} -c \
"${PSQL} -U awips -d postgres -c \"DROP TABLESPACE maps\"" >> ${SQL_LOG}
@ -361,10 +296,6 @@ fi
# stop PostgreSQL if we started it
if [ "${I_STARTED_POSTGRESQL}" = "YES" ]; then
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Stopping PostgreSQL As User - ${DB_OWNER}..."
echo "--------------------------------------------------------------------------------"
su ${DB_OWNER} -c \
"${PG_CTL} stop -D /awips2/data"
sleep 2
@ -375,10 +306,6 @@ if [ "${1}" = "1" ]; then
exit 0
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| SUCCESSFUL UNINSTALLATION ~ awips2-maps-database\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
%clean
rm -rf ${RPM_BUILD_ROOT}

View file

@ -69,12 +69,12 @@ echo -e "\e[1;34m---------------------------------------------------------------
if [ "${1}" = "2" ]; then
exit 0
fi
POSTGRESQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-postgresql`
POSTGRESQL_INSTALL="/awips2/postgresql"
# Need this for the lwpostgis.sql and spatial_ref_sys.sql scripts
DATABASE_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-database`
AWIPS2_DATA_DIRECTORY="${POSTGRESQL_INSTALL}/data"
POSTGRESQL_INSTALL="${POSTGRESQL_INSTALL}/postgresql"
PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-psql`
PSQL_INSTALL="/awips2/psql"
POSTMASTER="${POSTGRESQL_INSTALL}/bin/postmaster"
PG_CTL="${POSTGRESQL_INSTALL}/bin/pg_ctl"
@ -86,8 +86,8 @@ DB_OWNER=`ls -l /awips2/ | grep -w 'data' | awk '{print $3}'`
# Our log file
SQL_LOG="${RPM_INSTALL_PREFIX}/sqlScripts/share/sql/ncep/ncep_sql_install.log"
SQL_SHARE_DIR="${RPM_INSTALL_PREFIX}/sqlScripts/share/sql/ncep"
LWPOSTGIS_SQL="${DATABASE_INSTALL}/sqlScripts/share/lwpostgis.sql"
SPATIAL_SQL="${DATABASE_INSTALL}/sqlScripts/share/spatial_ref_sys.sql"
LWPOSTGIS_SQL="/awips2/postgresql/share/contrib/postgis-2.0/postgis.sql"
SPATIAL_SQL="/awips2/postgresql/share/contrib/postgis-2.0/spatial_ref_sys.sql"
# Determine if PostgreSQL is running.
I_STARTED_POSTGRESQL="NO"
@ -184,9 +184,8 @@ if [ "${1}" = "1" ]; then
exit 0
fi
POSTGRESQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-postgresql`
POSTGRESQL_INSTALL="${POSTGRESQL_INSTALL}/postgresql"
PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-psql`
POSTGRESQL_INSTALL="/awips2/postgresql"
PSQL_INSTALL="/awips2/psql"
POSTMASTER="${POSTGRESQL_INSTALL}/bin/postmaster"
PG_CTL="${POSTGRESQL_INSTALL}/bin/pg_ctl"

View file

@ -0,0 +1,131 @@
%define _build_arch %(uname -i)
%define _pgadmin3_version 1.16.1
#
# AWIPS II PostgreSQL Spec File
#
Name: awips2-pgadmin3
Summary: AWIPS II pgadmin3 Distribution
Version: %{_pgadmin3_version}
Release: 1
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: %{_build_arch}
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
BuildRequires: awips2-postgresql = 9.2.3-1
BuildRequires: postgresql = 8.1.18-2.el5_4.1
BuildRequires: postgresql-devel = 8.1.18-2.el5_4.1
BuildRequires: postgresql-libs = 8.1.18-2.el5_4.1
BuildRequires: wxGTK = 2.8.12-1.el5.rf
BuildRequires: wxGTK-devel = 2.8.12-1.el5.rf
provides: awips2-pgadmin3
requires: awips2-psql = 9.2.3-1
requires: wxGTK = 2.8.12-1.el5.rf
%description
AWIPS II pgadmin3 Distribution - A custom compilation of the pgadmin3 client compatible with
CentOS / Redhat 5.5.
%prep
# Ensure that a "buildroot" has been specified.
if [ "%{_build_root}" = "" ]; then
echo "ERROR: A BuildRoot has not been specified."
echo "FATAL: Unable to Continue ... Terminating."
exit 1
fi
if [ -d %{_build_root} ]; then
rm -rf %{_build_root}
fi
/bin/mkdir -p %{_build_root}
if [ $? -ne 0 ]; then
exit 1
fi
SRC_DIR="%{_baseline_workspace}/rpms/awips2.core/Installer.pgadmin/SOURCES"
PGADMIN_BUILD_DIR="awips2/pgadmin-build"
PGADMIN_TAR_FILE="pgadmin3-%{_pgadmin3_version}.tar.gz"
mkdir -p %{_build_root}/awips2/pgadmin3
mkdir -p %{_build_root}/${PGADMIN_BUILD_DIR}
# Copy our source tar file to the build directory.
cp ${SRC_DIR}/${PGADMIN_TAR_FILE} \
${RPM_BUILD_ROOT}/${PGADMIN_BUILD_DIR}
# Untar the postgresql source
cd ${RPM_BUILD_ROOT}/${PGADMIN_BUILD_DIR}
tar -xvf ${PGADMIN_TAR_FILE}
%build
PGADMIN_BUILD_DIR="awips2/pgadmin-build"
cd ${RPM_BUILD_ROOT}/${PGADMIN_BUILD_DIR}/pgadmin3-%{_pgadmin3_version}
export CPPFLAGS="-I/awips2/postgresql/include -I/awips2/postgresql/include/server"
export LDFLAGS="-L/awips2/postgresql/lib"
./configure --prefix=%{_build_root}/awips2/pgadmin3
if [ $? -ne 0 ]; then
exit 1
fi
make
if [ $? -ne 0 ]; then
exit 1
fi
%install
# Copies the standard Raytheon licenses into a license directory for the
# current component.
function copyLegal()
{
# $1 == Component Build Root
COMPONENT_BUILD_DIR=${1}
mkdir -p ${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
# Create a Tar file with our FOSS licenses.
tar -cjf %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
%{_baseline_workspace}/rpms/legal/FOSS_licenses/
cp %{_baseline_workspace}/rpms/legal/license.txt \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
cp "%{_baseline_workspace}/rpms/legal/Master Rights File.pdf" \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
cp %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
rm -f %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar
}
PGADMIN_BUILD_DIR="awips2/pgadmin-build"
cd ${RPM_BUILD_ROOT}/${PGADMIN_BUILD_DIR}/pgadmin3-%{_pgadmin3_version}
make install
if [ $? -ne 0 ]; then
exit 1
fi
rm -rf ${RPM_BUILD_ROOT}/${PGADMIN_BUILD_DIR}
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2
%dir /awips2/pgadmin3
%dir /awips2/pgadmin3/share
/awips2/pgadmin3/share/*
%defattr(755,awips,fxalpha,755)
%dir /awips2/pgadmin3/bin
/awips2/pgadmin3/bin/*

View file

@ -0,0 +1,343 @@
%define _build_arch %(uname -i)
%define _postgresql_version 9.2.3
#
# AWIPS II PostgreSQL Spec File
#
Name: awips2-postgresql
Summary: AWIPS II PostgreSQL Distribution
Version: %{_postgresql_version}
Release: 1
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: %{_build_arch}
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
provides: awips2-postgresql
provides: awips2-base-component
%description
AWIPS II PostgreSQL Distribution - Contains the AWIPS II PostgreSQL Distribution.
This is just the postgresql application. There is a separate rpm that will initialize
and populate the AWIPS II databases.
%prep
# Ensure that a "buildroot" has been specified.
if [ "%{_build_root}" = "" ]; then
echo "ERROR: A BuildRoot has not been specified."
echo "FATAL: Unable to Continue ... Terminating."
exit 1
fi
if [ -d %{_build_root} ]; then
rm -rf %{_build_root}
fi
/bin/mkdir %{_build_root}
if [ $? -ne 0 ]; then
exit 1
fi
SRC_DIR="%{_baseline_workspace}/rpms/awips2.core/Installer.postgres/SOURCES"
POSTGRESQL_BUILD_DIR="awips2/postgresql-build"
POSTGRESQL_TAR_FILE="postgresql-%{_postgresql_version}.tar.gz"
mkdir -p %{_build_root}/awips2/postgresql
mkdir -p %{_build_root}/awips2/psql
mkdir -p %{_build_root}/${POSTGRESQL_BUILD_DIR}
mkdir -p %{_build_root}/etc/profile.d
mkdir -p %{_build_root}/etc/ld.so.conf.d
touch %{_build_root}/etc/ld.so.conf.d/awips2-postgresql-%{_build_arch}.conf
echo "/awips2/postgresql/lib" >> %{_build_root}/etc/ld.so.conf.d/awips2-postgresql-%{_build_arch}.conf
PROFILE_D_DIR="rpms/awips2.core/Installer.postgres/scripts/profile.d"
cp %{_baseline_workspace}/${PROFILE_D_DIR}/* ${RPM_BUILD_ROOT}/etc/profile.d
# Copy our source tar file to the build directory.
cp ${SRC_DIR}/${POSTGRESQL_TAR_FILE} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
# Untar the postgresql source
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
tar -xvf ${POSTGRESQL_TAR_FILE}
%build
POSTGRESQL_BUILD_DIR="awips2/postgresql-build"
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}/postgresql-%{_postgresql_version}
./configure --prefix=${RPM_BUILD_ROOT}/awips2/postgresql \
--with-libxml
if [ $? -ne 0 ]; then
exit 1
fi
make clean
if [ $? -ne 0 ]; then
exit 1
fi
make
if [ $? -ne 0 ]; then
exit 1
fi
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}/postgresql-%{_postgresql_version}/contrib/xml2
make
if [ $? -ne 0 ]; then
exit 1
fi
%install
# Copies the standard Raytheon licenses into a license directory for the
# current component.
function copyLegal()
{
# $1 == Component Build Root
COMPONENT_BUILD_DIR=${1}
mkdir -p ${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
# Create a Tar file with our FOSS licenses.
tar -cjf %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
%{_baseline_workspace}/rpms/legal/FOSS_licenses/
cp %{_baseline_workspace}/rpms/legal/license.txt \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
cp "%{_baseline_workspace}/rpms/legal/Master Rights File.pdf" \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
cp %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
rm -f %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar
}
POSTGRESQL_BUILD_DIR="awips2/postgresql-build"
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}/postgresql-%{_postgresql_version}
make install
if [ $? -ne 0 ]; then
exit 1
fi
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}/postgresql-%{_postgresql_version}/contrib/xml2
make install
if [ $? -ne 0 ]; then
exit 1
fi
# relocate the psql executable
mkdir -p %{_build_root}/awips2/psql/bin
mv %{_build_root}/awips2/postgresql/bin/psql \
%{_build_root}/awips2/psql/bin/psql
# duplicate libpq; eventually, we should just have PostgreSQL
# reference the libpq in /awips2/psq/lib
mkdir -p %{_build_root}/awips2/psql/lib
cp -P %{_build_root}/awips2/postgresql/lib/libpq.so* \
%{_build_root}/awips2/psql/lib
SRC_DIR="%{_baseline_workspace}/rpms/awips2.core/Installer.postgres/SOURCES"
PROJ_SRC="proj-4.8.0.zip"
POSTGIS_SRC="postgis-2.0.2.tar.gz"
GEOS_SRC="geos-3.3.7.tar.bz2"
GDAL_SRC="gdal192.zip"
# The directory that the src will be in after the tars are unzipped.
PROJ_SRC_DIR="proj-4.8.0"
POSTGIS_SRC_DIR="postgis-2.0.2"
GEOS_SRC_DIR="geos-3.3.7"
GDAL_SRC_DIR="gdal-1.9.2"
cp ${SRC_DIR}/${POSTGIS_SRC} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
cp ${SRC_DIR}/${PROJ_SRC} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
cp ${SRC_DIR}/${GEOS_SRC} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
cp ${SRC_DIR}/${GDAL_SRC} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
unzip ${PROJ_SRC}
if [ $? -ne 0 ]; then
exit 1
fi
tar -xvf ${POSTGIS_SRC}
if [ $? -ne 0 ]; then
exit 1
fi
tar -xvf ${GEOS_SRC}
if [ $? -ne 0 ]; then
exit 1
fi
unzip ${GDAL_SRC}
if [ $? -ne 0 ]; then
exit 1
fi
cd ${GEOS_SRC_DIR}
./configure --prefix=${RPM_BUILD_ROOT}/awips2/postgresql
if [ $? -ne 0 ]; then
exit 1
fi
make
if [ $? -ne 0 ]; then
exit 1
fi
make install
if [ $? -ne 0 ]; then
exit 1
fi
cd ../${PROJ_SRC_DIR}
./configure --prefix=${RPM_BUILD_ROOT}/awips2/postgresql --without-jni
if [ $? -ne 0 ]; then
exit 1
fi
make
if [ $? -ne 0 ]; then
exit 1
fi
make install
if [ $? -ne 0 ]; then
exit 1
fi
cd ../${GDAL_SRC_DIR}
./configure --prefix=${RPM_BUILD_ROOT}/awips2/postgresql \
--with-expat-lib=%{_usr}/%{_lib}
if [ $? -ne 0 ]; then
exit 1
fi
make
if [ $? -ne 0 ]; then
exit 1
fi
make install
if [ $? -ne 0 ]; then
exit 1
fi
cd ../${POSTGIS_SRC_DIR}
_POSTGRESQL_ROOT=${RPM_BUILD_ROOT}/awips2/postgresql
_POSTGRESQL_BIN=${_POSTGRESQL_ROOT}/bin
# disable doc since it attempts to download files from
# the internet
./configure \
--with-pgconfig=${_POSTGRESQL_BIN}/pg_config \
--with-geosconfig=${_POSTGRESQL_BIN}/geos-config \
--with-projdir=${_POSTGRESQL_ROOT} \
--with-gdalconfig=${_POSTGRESQL_BIN}/gdal-config \
--without-doc \
--prefix=${_POSTGRESQL_ROOT}
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make install
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
# Remove the postgresql build directory.
rm -rf ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
# Create The PostgreSQL Data Directory
mkdir -p ${RPM_BUILD_ROOT}/awips2/data
STARTUP_SCRIPTS_TO_INCLUDE=('start_developer_postgres.sh' 'start_postgres.sh')
PATH_TO_STARTUP_SCRIPTS="rpms/awips2.core/Installer.postgres/scripts"
STARTUP_SCRIPT_DESTINATION="awips2/postgresql/bin"
# Copy The Startup Scripts
for script in ${STARTUP_SCRIPTS_TO_INCLUDE[*]};
do
cp -r %{_baseline_workspace}/${PATH_TO_STARTUP_SCRIPTS}/${script} \
${RPM_BUILD_ROOT}/${STARTUP_SCRIPT_DESTINATION}
done
copyLegal "awips2/postgresql"
# Include the postgresql service script
mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
cp %{_baseline_workspace}/rpms/awips2.core/Installer.postgres/scripts/init.d/edex_postgres \
${RPM_BUILD_ROOT}/etc/init.d
%pre
%post
# Run ldconfig
/sbin/ldconfig
%preun
if [ "${1}" = "1" ]; then
exit 0
fi
if [ -f /etc/init.d/edex_postgres ]; then
/sbin/chkconfig --del edex_postgres
fi
%postun
%clean
rm -rf ${RPM_BUILD_ROOT}
%package -n awips2-psql
Summary: AWIPS II PSQL Distribution
Group: AWIPSII
provides: awips2-psql
%description -n awips2-psql
AWIPS II PSQL Distribution - Contains the AWIPS II PSQL Distribution.
This is just the postgresql application. There is a separate rpm that will initialize
and populate the AWIPS II databases.
%files
%defattr(644,awips,fxalpha,755)
%attr(755,root,root) /etc/profile.d/awips2Postgres.csh
%attr(755,root,root) /etc/profile.d/awips2Postgres.sh
%attr(755,root,root) /etc/ld.so.conf.d/awips2-postgresql-%{_build_arch}.conf
%attr(744,root,root) /etc/init.d/edex_postgres
%attr(700,awips,fxalpha) /awips2/data
%dir /awips2/postgresql
%dir /awips2/postgresql/include
/awips2/postgresql/include/*
%dir /awips2/postgresql/lib
/awips2/postgresql/lib/*
%docdir /awips2/postgresql/licenses
%dir /awips2/postgresql/licenses
/awips2/postgresql/licenses/*
%dir /awips2/postgresql/share
/awips2/postgresql/share/*
%defattr(755,awips,fxalpha,755)
%dir /awips2/postgresql/bin
/awips2/postgresql/bin/*
%files -n awips2-psql
%defattr(755,awips,fxalpha,755)
%attr(755,root,root) /etc/profile.d/awips2PSQL.csh
%attr(755,root,root) /etc/profile.d/awips2PSQL.sh
%dir /awips2
%dir /awips2/psql
%dir /awips2/psql/bin
/awips2/psql/bin/*
%defattr(644,awips,fxalpha,755)
%dir /awips2/psql/lib
/awips2/psql/lib/*

View file

@ -1,7 +1,7 @@
#!/bin/csh
# Determine where psql has been installed.
set PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-psql`
set PSQL_INSTALL="/awips2/psql"
if $?LD_LIBRARY_PATH then
setenv LD_LIBRARY_PATH ${PSQL_INSTALL}/lib:$LD_LIBRARY_PATH

View file

@ -8,10 +8,7 @@ if [ ${RC} -ne 0 ]; then
fi
# Determine Where awips2-psql Has Been Installed.
PSQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-psql`
if [ "${PSQL_INSTALL}" = "" ]; then
return
fi
PSQL_INSTALL="/awips2/psql"
# Update The Environment.
# Determine if awips2-psql is Already On LD_LIBRARY_PATH

View file

@ -1,8 +1,7 @@
#!/bin/csh
# Determine where postgres has been installed.
set POSTGRES_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-postgresql`
set POSTGRES_INSTALL="${POSTGRES_INSTALL}/postgresql"
set POSTGRES_INSTALL="/awips2/postgresql"
if $?LD_LIBRARY_PATH then
setenv LD_LIBRARY_PATH ${POSTGRES_INSTALL}/lib:$LD_LIBRARY_PATH

View file

@ -8,8 +8,7 @@ if [ ${RC} -ne 0 ]; then
fi
# Determine Where awips2-postgresql Has Been Installed.
POSTGRESQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}' awips2-postgresql`
POSTGRESQL_INSTALL="${POSTGRESQL_INSTALL}/postgresql"
POSTGRESQL_INSTALL="/awips2/postgresql"
if [ "${POSTGRESQL_INSTALL}" = "" ]; then
return
fi

View file

@ -3,7 +3,7 @@
## EDIT FROM HERE
# Use rpm to find installation locations / directory paths.
POSTGRESQL_INSTALL=`rpm -q --queryformat '%{INSTALLPREFIX}\n' awips2-postgresql`
POSTGRESQL_INSTALL="/awips2"
# Installation prefix
prefix="${POSTGRESQL_INSTALL}/postgresql"

View file

@ -1,360 +0,0 @@
#
# AWIPS II PostgreSQL Spec File
#
Name: awips2-postgresql
Summary: AWIPS II PostgreSQL Distribution
Version: 8.3.4
Release: 4
Group: AWIPSII
BuildRoot: /tmp
Prefix: /awips2
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
provides: awips2-postgresql
provides: awips2-base-component
%description
AWIPS II PostgreSQL Distribution - Contains the AWIPS II PostgreSQL Distribution.
This is just the postgresql application. There is a separate rpm that will initialize
and populate the AWIPS II databases.
%prep
# Verify That The User Has Specified A BuildRoot.
if [ "${RPM_BUILD_ROOT}" = "/tmp" ]
then
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
echo "Unable To Continue ... Terminating"
exit 1
fi
# Ensure That awips2-psql Has Been Installed.
COMMAND=`rpm -q awips2-psql`
RC="$?"
if [ ! "${RC}" = "0" ]; then
echo "ERROR: awips2-psql Must Be Installed."
echo "Unable To Continue ... Terminating."
exit 1
fi
POSTGRESQL_BUILD_DIR="awips2/postgresql-build"
POSTGRESQL_SOURCE_DIR="%{_awipscm_share}/packages/postgresqlSource"
POSTGRESQL_TAR_FILE="postgresql-8.3.4.tar.gz"
mkdir -p ${RPM_BUILD_ROOT}/awips2/postgresql
mkdir -p ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
mkdir -p ${RPM_BUILD_ROOT}/etc/profile.d
mkdir -p ${RPM_BUILD_ROOT}/etc/ld.so.conf.d
touch ${RPM_BUILD_ROOT}/etc/ld.so.conf.d/awips2-postgresql-i386.conf
PROFILE_D_DIR="rpms/awips2.core/Installer.postgresql/scripts/profile.d"
cp %{_baseline_workspace}/${PROFILE_D_DIR}/* ${RPM_BUILD_ROOT}/etc/profile.d
# Copy our source tar file to the build directory.
cp ${POSTGRESQL_SOURCE_DIR}/${POSTGRESQL_TAR_FILE} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
# Untar the postgresql source
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
tar -xvf ${POSTGRESQL_TAR_FILE}
%build
export LD_LIBRARY_PATH=/awips2/psql/lib
export LDFLAGS="-L%{_baseline_workspace}/rpms/awips2.core/Installer.postgresql/pre-reqs/lib -L/awips2/psql/lib"
POSTGRESQL_BUILD_DIR="awips2/postgresql-build"
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}/postgresql-8.3.4
./configure --prefix=${RPM_BUILD_ROOT}/awips2/postgresql
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make clean
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
# !!! HACK ! HACK ! HACK !!!
# Note: This May Not Be Necessary With Newer Versions Of PostgreSQL.
POSTGRESQL_MANUAL_BUILD_DIR="contrib/spi"
POSTGRESQL_MANUAL_BUILD_FILES=( 'autoinc' \
'insert_username' 'moddatetime' 'refint' \
'timetravel' )
cd ${POSTGRESQL_MANUAL_BUILD_DIR}
# Note: This Will Only Be Needed For 32-Bit Compiles On A 64-Bit Machine.
for file in ${POSTGRESQL_MANUAL_BUILD_FILES[*]};
do
gcc -m32 -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels \
-fno-strict-aliasing -fwrapv -fpic -DREFINT_VERBOSE -I. -I../../src/include -D_GNU_SOURCE \
-c -o ${file}.o ${file}.c
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
gcc -m32 -shared -o ${file}.so ${file}.o
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
done
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}/postgresql-8.3.4
make
if [ ! "${RC}" = "0" ]; then
exit 1
fi
%install
# Copies the standard Raytheon licenses into a license directory for the
# current component.
function copyLegal()
{
# $1 == Component Build Root
COMPONENT_BUILD_DIR=${1}
mkdir -p ${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
# Create a Tar file with our FOSS licenses.
tar -cjf %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
%{_baseline_workspace}/rpms/legal/FOSS_licenses/
cp %{_baseline_workspace}/rpms/legal/license.txt \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
cp "%{_baseline_workspace}/rpms/legal/Master Rights File.pdf" \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
cp %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
rm -f %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar
}
POSTGRESQL_BUILD_DIR="awips2/postgresql-build"
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}/postgresql-8.3.4
make install
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
POSTGRESQL_EXT_SRC_DIR="%{_baseline_workspace}/rpms/awips2.core/Installer.postgresql/extensions"
PROJ_SRC="proj-4.6.1.tar.gz"
POSTGIS_SRC="postgis-1.3.5.tar.gz"
GEOS_SRC="geos-3.0.2.tar.bz2"
# The directory that the src will be in after the tars are unzipped.
PROJ_SRC_DIR="proj-4.6.1"
POSTGIS_SRC_DIR="postgis-1.3.5"
GEOS_SRC_DIR="geos-3.0.2"
cp ${POSTGRESQL_EXT_SRC_DIR}/${POSTGIS_SRC} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
cp ${POSTGRESQL_EXT_SRC_DIR}/${PROJ_SRC} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
cp ${POSTGRESQL_EXT_SRC_DIR}/${GEOS_SRC} \
${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
cd ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
tar -xvf ${PROJ_SRC}
tar -xvf ${POSTGIS_SRC}
tar -xvf ${GEOS_SRC}
# a few of the postgresql extensions ignore CFLAGS
# if statement; check for 32 / 64 bit compile flag
export CPPFLAGS="-m32"
cd ${GEOS_SRC_DIR}
./configure --prefix=${RPM_BUILD_ROOT}/awips2/postgresql
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make install
if [ ! "${RC}" = "0" ]; then
exit 1
fi
cd ../${PROJ_SRC_DIR}
./configure --prefix=${RPM_BUILD_ROOT}/awips2/postgresql
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make install
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
cd ../${POSTGIS_SRC_DIR}
export PATH=${RPM_BUILD_ROOT}/awips2/postgresql/bin:$PATH
./configure \
--with-pgconfig=${RPM_BUILD_ROOT}/awips2/postgresql/bin/pg_config \
--with-geosconfig=${RPM_BUILD_ROOT}/awips2/postgresql/bin/geos-config \
--with-projdir=${RPM_BUILD_ROOT}/awips2/postgresql \
--prefix=${RPM_BUILD_ROOT}/awips2/postgresql
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
make install
RC="$?"
if [ ! "${RC}" = "0" ]; then
exit 1
fi
# Remove the postgresql build directory.
rm -rf ${RPM_BUILD_ROOT}/${POSTGRESQL_BUILD_DIR}
CONFIG_FILE_TO_INCLUDE="postgresql.conf"
PATH_TO_DDL="build.edex/opt/db/ddl"
EXPECTED_PATH_TO_CONFIG="${PATH_TO_DDL}/setup"
KNOWN_CONFIG_DESTINATION="awips2/postgresql/share/sql"
# Ensure That We Have Access To The Configuration Files Before Continuing.
if [ ! -f %{_baseline_workspace}/${EXPECTED_PATH_TO_CONFIG}/${CONFIG_FILE_TO_INCLUDE} ]; then
echo "The ${CONFIG_FILE_TO_INCLUDE} PostgreSQL Configuration File Can Not Be Found."
echo "Unable To Continue ... Terminating"
exit 1
fi
# Create The "Share SQL" Directory
mkdir -p ${RPM_BUILD_ROOT}/${KNOWN_CONFIG_DESTINATION}
# Create The PostgreSQL Data Directory
mkdir -p ${RPM_BUILD_ROOT}/awips2/data
# Copy The Configuration File
cp -r %{_baseline_workspace}/${EXPECTED_PATH_TO_CONFIG}/${CONFIG_FILE_TO_INCLUDE} \
${RPM_BUILD_ROOT}/${KNOWN_CONFIG_DESTINATION}
STARTUP_SCRIPTS_TO_INCLUDE=('start_developer_postgres.sh' 'start_postgres.sh')
PATH_TO_STARTUP_SCRIPTS="rpms/awips2.core/Installer.postgresql/scripts"
STARTUP_SCRIPT_DESTINATION="awips2/postgresql/bin"
# Copy The Startup Scripts
for script in ${STARTUP_SCRIPTS_TO_INCLUDE[*]};
do
cp -r %{_baseline_workspace}/${PATH_TO_STARTUP_SCRIPTS}/${script} \
${RPM_BUILD_ROOT}/${STARTUP_SCRIPT_DESTINATION}
done
copyLegal "awips2/postgresql"
# Include the postgresql service script
mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
cp %{_baseline_workspace}/rpms/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres \
${RPM_BUILD_ROOT}/etc/init.d
%pre
if [ "${1}" = "2" ]; then
exit 0
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| Installing the AWIPS II PostgreSQL Distribution...\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m Installation Root = ${RPM_INSTALL_PREFIX}/postgresql\e[m"
%post
function printFailureMessage()
{
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;31m\| AWIPS II PostgreSQL Distribution Installation - FAILED\e[m"
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
}
echo "--------------------------------------------------------------------------------"
echo "\| Setting up AWIPS II PostgreSQL Runtime and Environment..."
echo "--------------------------------------------------------------------------------"
echo "${RPM_INSTALL_PREFIX}/postgresql/lib" >> /etc/ld.so.conf.d/awips2-postgresql-i386.conf
# Run ldconfig
/sbin/ldconfig
echo "--------------------------------------------------------------------------------"
echo "\| Updating PostgreSQL Startup Scripts"
echo "--------------------------------------------------------------------------------"
echo "--------------------------------------------------------------------------------"
echo "\| Adding Environment Variables for AWIPS II PostgreSQL"
echo "--------------------------------------------------------------------------------"
if [ "${1}" = "2" ]; then
exit 0
fi
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;32m\| AWIPS II PostgreSQL Distribution Installation - COMPLETE\e[m"
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
%preun
if [ "${1}" = "1" ]; then
exit 0
fi
if [ -f /etc/init.d/edex_postgres ]; then
/sbin/chkconfig --del edex_postgres
fi
%postun
if [ "${1}" = "1" ]; then
exit 0
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| The AWIPS II PostgreSQL Distribution Has Been Successfully Removed\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(644,awips,fxalpha,755)
%attr(755,root,root) /etc/profile.d/awips2Postgres.csh
%attr(755,root,root) /etc/profile.d/awips2Postgres.sh
%attr(755,root,root) /etc/ld.so.conf.d/awips2-postgresql-i386.conf
%attr(744,root,root) /etc/init.d/edex_postgres
%attr(700,awips,fxalpha) /awips2/data
%dir /awips2/postgresql
%docdir /awips2/postgresql/doc
%dir /awips2/postgresql/doc
/awips2/postgresql/doc/*
%dir /awips2/postgresql/include
/awips2/postgresql/include/*
%dir /awips2/postgresql/lib
/awips2/postgresql/lib/*
%docdir /awips2/postgresql/licenses
%dir /awips2/postgresql/licenses
/awips2/postgresql/licenses/*
%docdir /awips2/postgresql/man
%dir /awips2/postgresql/man
/awips2/postgresql/man/*
%dir /awips2/postgresql/share
/awips2/postgresql/share/*
%defattr(755,awips,fxalpha,755)
%dir /awips2/postgresql/bin
/awips2/postgresql/bin/*

View file

@ -1,160 +0,0 @@
#
# AWIPS II PSQL Spec File
#
%define __prelink_undo_cmd %{nil}
Name: awips2-psql
Summary: AWIPS II PSQL Distribution
Version: 8.3.4
Release: 3
Group: AWIPSII
BuildRoot: /tmp
BuildArch: i386
Prefix: /awips2/psql
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
provides: awips2-psql
requires: libtermcap >= 2.0.8-46.1
requires: libtermcap.so.2
requires: libreadline.so.4
%description
AWIPS II PSQL Distribution - Contains PSQL (PostgreSQL) V8.3.4
%prep
# Verify That The User Has Specified A BuildRoot.
if [ "${RPM_BUILD_ROOT}" = "/tmp" ]
then
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
echo "Unable To Continue ... Terminating"
exit 1
fi
mkdir -p ${RPM_BUILD_ROOT}/awips2/psql
mkdir -p ${RPM_BUILD_ROOT}/etc/profile.d
mkdir -p ${RPM_BUILD_ROOT}/etc/ld.so.conf.d
touch ${RPM_BUILD_ROOT}/etc/ld.so.conf.d/awips2-psql-i386.conf
%build
PROFILE_D_DIR="rpms/awips2.core/Installer.psql/scripts/profile.d"
cp %{_baseline_workspace}/${PROFILE_D_DIR}/* ${RPM_BUILD_ROOT}/etc/profile.d
%install
# Copies the standard Raytheon licenses into a license directory for the
# current component.
function copyLegal()
{
# $1 == Component Build Root
COMPONENT_BUILD_DIR=${1}
mkdir -p ${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
# Create a Tar file with our FOSS licenses.
tar -cjf %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
%{_baseline_workspace}/rpms/legal/FOSS_licenses/
cp %{_baseline_workspace}/rpms/legal/license.txt \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
cp "%{_baseline_workspace}/rpms/legal/Master Rights File.pdf" \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
cp %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar \
${RPM_BUILD_ROOT}/${COMPONENT_BUILD_DIR}/licenses
rm -f %{_baseline_workspace}/rpms/legal/FOSS_licenses.tar
}
cp -r %{_awipscm_share}/packages/psql/* ${RPM_BUILD_ROOT}/awips2/psql
# Remove all shared libraries that are not created by psql.
if [ -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libreadline.a ]; then
rm -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libreadline.a
fi
if [ -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libreadline.so ]; then
rm -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libreadline.so
fi
if [ -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libreadline.so.4 ]; then
rm -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libreadline.so.4
fi
if [ -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libreadline.so.4.3 ]; then
rm -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libreadline.so.4.3
fi
if [ -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libtermcap.a ]; then
rm -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libtermcap.a
fi
if [ -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libtermcap.so ]; then
rm -f ${RPM_BUILD_ROOT}/awips2/psql/lib/libtermcap.so
fi
copyLegal "awips2/psql"
%pre
if [ "${1}" = "2" ]; then
exit 0
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| Installing the AWIPS II PSQL Distribution...\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m Installation Root = ${RPM_INSTALL_PREFIX}\e[m"
%post
function printFailureMessage()
{
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;31m\| AWIPS II PSQL Distribution Installation - FAILED\e[m"
echo -e "\e[1;31m--------------------------------------------------------------------------------\e[m"
}
echo "--------------------------------------------------------------------------------"
echo "\| Setting up AWIPS II PSQL Runtime and Environment..."
echo "--------------------------------------------------------------------------------"
echo "${RPM_INSTALL_PREFIX}/lib" >> /etc/ld.so.conf.d/awips2-psql-i386.conf
# Run ldconfig
/sbin/ldconfig
echo "--------------------------------------------------------------------------------"
echo "\| Changing AWIPS II PSQL owner to awips:fxalpha"
echo "--------------------------------------------------------------------------------"
chown -R awips:fxalpha ${RPM_INSTALL_PREFIX}
if [ "${1}" = "2" ]; then
exit 0
fi
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;32m\| AWIPS II PSQL Distribution Installation - COMPLETE\e[m"
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
%preun
%postun
if [ "${1}" = "1" ]; then
exit 0
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| The AWIPS II PSQL Distribution Has Been Successfully Removed\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%attr(755,root,root) /etc/profile.d/awips2PSQL.csh
%attr(755,root,root) /etc/profile.d/awips2PSQL.sh
%attr(755,root,root) /etc/ld.so.conf.d/awips2-psql-i386.conf
%defattr(755,awips,fxalpha,755)
%dir /awips2/psql
%dir /awips2/psql/bin
/awips2/psql/bin/*
%defattr(644,awips,fxalpha,755)
%dir /awips2/psql/lib
%attr(777,awips,fxalpha) /awips2/psql/lib/libpq.so
%attr(777,awips,fxalpha) /awips2/psql/lib/libpq.so.5
%attr(755,awips,fxalpha) /awips2/psql/lib/libpq.so.5.1
%docdir /awips2/psql/licenses
%dir /awips2/psql/licenses
/awips2/psql/licenses/*

View file

@ -109,7 +109,7 @@ function buildRPM()
[ ! "${COMPONENT_DIR}" = "Installer.irt" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.java" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.ldm" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.postgresql" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.postgres" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.psql" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.python" ] &&
[ ! "${COMPONENT_DIR}" = "Installer.server" ] &&

View file

@ -221,12 +221,12 @@ function lookupRPM()
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.ldm"
return 0
fi
if [ "${1}" = "awips2-postgresql" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.postgresql"
if [ "${1}" = "awips2-postgres" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.postgres"
return 0
fi
if [ "${1}" = "awips2-psql" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.psql"
if [ "${1}" = "awips2-pgadmin3" ]; then
export RPM_SPECIFICATION="${awips2_core_dir}/Installer.pgadmin"
return 0
fi
if [ "${1}" = "awips2-tools" ]; then

View file

@ -124,14 +124,22 @@ if [ "${1}" = "-python-qpid" ]; then
#buildRPM "awips2-httpd-pypies"
#buildRPM "awips2-java"
#buildRPM "awips2-ldm"
#buildRPM "awips2-postgresql"
#buildRPM "awips2-psql"
#buildRPM "awips2-tools"
buildRPM "awips2-python-shapely"
exit 0
fi
if [ "${1}" = "-postgres" ]; then
buildRPM "awips2-postgres"
buildRPM "awips2-database-server-configuration"
buildRPM "awips2-database-standalone-configuration"
buildRPM "awips2-database"
buildRPM "awips2-maps-database"
buildRPM "awips2-pgadmin3"
exit 0
fi
if [ "${1}" = "-delta" ]; then
buildCAVE
@ -246,8 +254,8 @@ if [ "${1}" = "-full" ]; then
buildRPM "awips2-httpd-pypies"
buildRPM "awips2-java"
#buildRPM "awips2-ldm"
buildRPM "awips2-postgresql"
buildRPM "awips2-psql"
buildRPM "awips2-postgres"
buildRPM "awips2-pgadmin3"
buildRPM "awips2-tools"
buildRPM "awips2-edex-environment"
buildRPM "awips2-openfire"

View file

@ -122,6 +122,17 @@ if [ "${1}" = "-64bit" ]; then
exit 0
fi
if [ "${1}" = "-postgres" ]; then
buildRPM "awips2-postgres"
buildRPM "awips2-database-server-configuration"
buildRPM "awips2-database-standalone-configuration"
buildRPM "awips2-database"
buildRPM "awips2-maps-database"
buildRPM "awips2-pgadmin3"
exit 0
fi
if [ "${1}" = "-delta" ]; then
buildCAVE
if [ $? -ne 0 ]; then
@ -204,6 +215,8 @@ if [ "${1}" = "-full" ]; then
buildRPM "awips2-edex-environment"
buildRPM "awips2-notification"
buildRPM "awips2-python-shapely"
buildRPM "awips2-postgres"
buildRPM "awips2-pgadmin3"
exit 0
fi

View file

@ -1 +1 @@
20111012
20130305