aboutsummaryrefslogtreecommitdiffstats
path: root/databases/postgresql90-server
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2001-02-21 05:45:15 +0800
committerolgeni <olgeni@FreeBSD.org>2001-02-21 05:45:15 +0800
commit1d136a482b986afe7d829ed37fd033a91d01f93b (patch)
tree2990fc631662b1529379d1f7d0471df0a287756d /databases/postgresql90-server
parentb373be2697bf81a0f31ba273bcf2eb5495bd3e19 (diff)
downloadfreebsd-ports-gnome-1d136a482b986afe7d829ed37fd033a91d01f93b.tar.gz
freebsd-ports-gnome-1d136a482b986afe7d829ed37fd033a91d01f93b.tar.zst
freebsd-ports-gnome-1d136a482b986afe7d829ed37fd033a91d01f93b.zip
Make the port more "package friendly".
Do not call initdb from Makefile's post-install. Users are required to manually run initdb, maybe after configuring their preferred database location in pgsql's user .profile. pkg_add used to simply replace some existing data files. Add pkg-message to tell the user about initdb. Remove 2 empty directories from pkg-plist (pgsql/include/port/freebsd, pgsql/include/port), since they are not included in "make package" anyway and cause pkg_deinstall to complain about the plist. Remove all pgsql/data contents from pkg-plist, so "make deinstall" and pkg_delete won't clobber existing databases. Minor version upgrades can now be performed by means of pkg_delete and "make install", without using pg_dump. Chown %D/pgsql/lib to root:wheel to satisfy ldconfig's recent security requirements. Change @dirrm of pgsql to "@unexec rmdir": pkg_deinstall won't complain if data still exists in that directory at deinstall time. Approved by: maintainer
Diffstat (limited to 'databases/postgresql90-server')
-rw-r--r--databases/postgresql90-server/Makefile7
-rw-r--r--databases/postgresql90-server/pkg-message12
-rw-r--r--databases/postgresql90-server/pkg-plist79
3 files changed, 17 insertions, 81 deletions
diff --git a/databases/postgresql90-server/Makefile b/databases/postgresql90-server/Makefile
index d032a04f7eae..d4f605de97e4 100644
--- a/databases/postgresql90-server/Makefile
+++ b/databases/postgresql90-server/Makefile
@@ -131,11 +131,7 @@ post-install:
fi
@ ${CHOWN} -R pgsql:pgsql ${PREFIX}/pgsql
@ ${CHOWN} root:pgsql ${PREFIX}/pgsql/lib
- @ ${ECHO} 'Initializing PostgreSQL Databases - this may take a few minutes...'
@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/pgsql/lib
-# '-' so we don't fail to create packagelist at this stage,
-# when we already have everything installed on top of previous version
- -@ su -l pgsql -c 'PATH=${PREFIX}/pgsql/bin:${PATH} ${PREFIX}/pgsql/bin/initdb --pglib=${PREFIX}/pgsql/lib --pgdata=${PREFIX}/pgsql/data'
@ ${SED} -e "s=!!PREFIX!!=${PREFIX}=g" < ${FILESDIR}/pgsql.sh.tmpl \
> ${PREFIX}/etc/rc.d/pgsql.sh
@ ${CHMOD} 554 ${PREFIX}/etc/rc.d/pgsql.sh
@@ -194,6 +190,9 @@ post-install:
@ strip ${PREFIX}/pgsql/bin/${file}
.endfor
.endif
+ @ ${RMDIR} ${PREFIX}/pgsql/include/port/freebsd
+ @ ${RMDIR} ${PREFIX}/pgsql/include/port
+ @ ${CAT} ${PKGMESSAGE}
post-clean:
@ ${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc
diff --git a/databases/postgresql90-server/pkg-message b/databases/postgresql90-server/pkg-message
new file mode 100644
index 000000000000..88cc50d642e6
--- /dev/null
+++ b/databases/postgresql90-server/pkg-message
@@ -0,0 +1,12 @@
+==========================================
+To initialize the database, you should run
+initdb as the "pgsql" user.
+
+Example:
+
+ su -l pgsql -c initdb
+
+You can then start PostgreSQL by running:
+
+ /usr/local/etc/rc.d/pgsql.sh start
+==========================================
diff --git a/databases/postgresql90-server/pkg-plist b/databases/postgresql90-server/pkg-plist
index 9992da1174ae..107fac4e503b 100644
--- a/databases/postgresql90-server/pkg-plist
+++ b/databases/postgresql90-server/pkg-plist
@@ -22,76 +22,6 @@ pgsql/bin/postgres
pgsql/bin/postmaster
pgsql/bin/psql
pgsql/bin/vacuumdb
-pgsql/data/PG_VERSION
-pgsql/data/base/template1/PG_VERSION
-pgsql/data/base/template1/pg_aggregate
-pgsql/data/base/template1/pg_aggregate_name_type_index
-pgsql/data/base/template1/pg_am
-pgsql/data/base/template1/pg_am_name_index
-pgsql/data/base/template1/pg_amop
-pgsql/data/base/template1/pg_amop_opid_index
-pgsql/data/base/template1/pg_amop_strategy_index
-pgsql/data/base/template1/pg_amproc
-pgsql/data/base/template1/pg_attrdef
-pgsql/data/base/template1/pg_attrdef_adrelid_index
-pgsql/data/base/template1/pg_attribute
-pgsql/data/base/template1/pg_attribute_relid_attnam_index
-pgsql/data/base/template1/pg_attribute_relid_attnum_index
-pgsql/data/base/template1/pg_class
-pgsql/data/base/template1/pg_class_oid_index
-pgsql/data/base/template1/pg_class_relname_index
-pgsql/data/base/template1/pg_description
-pgsql/data/base/template1/pg_description_objoid_index
-pgsql/data/base/template1/pg_index
-pgsql/data/base/template1/pg_index_indexrelid_index
-pgsql/data/base/template1/pg_indexes
-pgsql/data/base/template1/pg_inheritproc
-pgsql/data/base/template1/pg_inherits
-pgsql/data/base/template1/pg_inherits_relid_seqno_index
-pgsql/data/base/template1/pg_ipl
-pgsql/data/base/template1/pg_language
-pgsql/data/base/template1/pg_language_name_index
-pgsql/data/base/template1/pg_language_oid_index
-pgsql/data/base/template1/pg_listener
-pgsql/data/base/template1/pg_listener_relname_pid_index
-pgsql/data/base/template1/pg_opclass
-pgsql/data/base/template1/pg_opclass_deftype_index
-pgsql/data/base/template1/pg_opclass_name_index
-pgsql/data/base/template1/pg_operator
-pgsql/data/base/template1/pg_operator_oid_index
-pgsql/data/base/template1/pg_operator_oprname_l_r_k_index
-pgsql/data/base/template1/pg_proc
-pgsql/data/base/template1/pg_proc_oid_index
-pgsql/data/base/template1/pg_proc_proname_narg_type_index
-pgsql/data/base/template1/pg_relcheck
-pgsql/data/base/template1/pg_relcheck_rcrelid_index
-pgsql/data/base/template1/pg_rewrite
-pgsql/data/base/template1/pg_rewrite_oid_index
-pgsql/data/base/template1/pg_rewrite_rulename_index
-pgsql/data/base/template1/pg_rules
-pgsql/data/base/template1/pg_statistic
-pgsql/data/base/template1/pg_statistic_relid_att_index
-pgsql/data/base/template1/pg_tables
-pgsql/data/base/template1/pg_trigger
-pgsql/data/base/template1/pg_trigger_tgconstrname_index
-pgsql/data/base/template1/pg_trigger_tgconstrrelid_index
-pgsql/data/base/template1/pg_trigger_tgrelid_index
-pgsql/data/base/template1/pg_type
-pgsql/data/base/template1/pg_type_oid_index
-pgsql/data/base/template1/pg_type_typname_index
-pgsql/data/base/template1/pg_user
-pgsql/data/base/template1/pg_views
-pgsql/data/pg_control
-pgsql/data/pg_database
-pgsql/data/pg_geqo.sample
-pgsql/data/pg_group
-pgsql/data/pg_group_name_index
-pgsql/data/pg_group_sysid_index
-pgsql/data/pg_hba.conf
-pgsql/data/pg_log
-pgsql/data/pg_shadow
-pgsql/data/pg_variable
-pgsql/data/postmaster.opts.default
pgsql/include/access/attnum.h
pgsql/include/c.h
pgsql/include/commands/trigger.h
@@ -123,6 +53,7 @@ pgsql/include/utils/elog.h
pgsql/include/utils/geo_decls.h
pgsql/include/utils/mcxt.h
pgsql/include/utils/palloc.h
+@exec chown root:wheel %D/pgsql/lib
pgsql/lib/global1.bki.source
pgsql/lib/global1.description
pgsql/lib/libecpg.a
@@ -147,22 +78,16 @@ pgsql/lib/plpgsql.so
pgsql/lib/postmaster.opts.default.sample
pgsql/post-install-notes
@dirrm pgsql/bin
-@dirrm pgsql/data/base/template1
-@dirrm pgsql/data/base
-@dirrm pgsql/data/pg_xlog
-@dirrm pgsql/data
@dirrm pgsql/include/access
@dirrm pgsql/include/commands
@dirrm pgsql/include/executor
@dirrm pgsql/include/lib
@dirrm pgsql/include/libpq
@dirrm pgsql/include/libpq++
-@dirrm pgsql/include/port/freebsd
-@dirrm pgsql/include/port
@dirrm pgsql/include/utils
@dirrm pgsql/include
@dirrm pgsql/lib
@dirrm pgsql/man/man1
@dirrm pgsql/man/manl
@dirrm pgsql/man
-@dirrm pgsql
+@unexec rmdir %D/pgsql 2>/dev/null || true