From ad51f62081c086e5eaa22516dae348856ac0a2e3 Mon Sep 17 00:00:00 2001 From: naddy Date: Thu, 20 Sep 2001 19:23:32 +0000 Subject: [PATCH] * Use variables instead of hardcoded prefixes. * Take care to set a sane PATH. * Add set -e * Copy example files into ${PREFIX}/share/examples/PORTNAME. * Replace PKGNAME with P_NAME in INSTALL/DEINSTALL scripts, unclear since it already exists in the Makefile with a different value. * Change output of INSTALL/DEINSTALL to be more like other scripts found in the tree(suggested by heko@). From maintainer Nils Nordman . --- devel/gconf/Makefile | 8 ++-- devel/gconf/pkg/DEINSTALL | 27 ++++++----- devel/gconf/pkg/INSTALL | 98 +++++++++------------------------------ devel/gconf/pkg/PLIST | 14 +++--- 4 files changed, 47 insertions(+), 100 deletions(-) diff --git a/devel/gconf/Makefile b/devel/gconf/Makefile index 88f50a7a6fa..6f0b2f39924 100644 --- a/devel/gconf/Makefile +++ b/devel/gconf/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.5 2001/09/20 18:39:12 naddy Exp $ +# $OpenBSD: Makefile,v 1.6 2001/09/20 19:23:32 naddy Exp $ COMMENT= "configuration database system written for GNOME" V= 1.0.1 @@ -41,8 +41,8 @@ CONFIGURE_ARGS+= --enable-db3 .endif post-install: - ${INSTALL_DATA_DIR} ${PREFIX}/share/gconf; \ - cp -r ${PREFIX}/../../etc/* ${PREFIX}/share/gconf; \ - mv ${PREFIX}/share/gconf/gconf/1/path.example ${PREFIX}/share/gconf/gconf/1/path + @${INSTALL_DATA_DIR} ${PREFIX}/share/examples/gconf; \ + cp -rp ${WRKINST}/${SYSCONFDIR}/* ${PREFIX}/share/examples/gconf; \ + mv ${PREFIX}/share/examples/gconf/gconf/1/path.example ${PREFIX}/share/examples/gconf/gconf/1/path .include diff --git a/devel/gconf/pkg/DEINSTALL b/devel/gconf/pkg/DEINSTALL index 6a315a91825..e89034f9346 100644 --- a/devel/gconf/pkg/DEINSTALL +++ b/devel/gconf/pkg/DEINSTALL @@ -1,24 +1,27 @@ #!/bin/sh # -# $OpenBSD: DEINSTALL,v 1.1.1.1 2001/09/13 20:52:08 todd Exp $ +# $OpenBSD: DEINSTALL,v 1.2 2001/09/20 19:23:32 naddy Exp $ # +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin + echo - echo "*=================[ $1" - echo "* To really remove $1 from your system you should also" - echo "* remove the configuration files from the /etc directory." - echo "* If you are planning on installing $1 again in the future" - echo "* you can leave it as it is." - echo "*" - echo "* FYI, the following configuration files belongs to this package:" - echo "*" + echo "+--------------- $1" + echo "| To really remove $1 from your system you should also" + echo "| remove the configuration files from the ${SYSCONFDIR} directory." + echo "| If you are planning on installing $1 again in the future" + echo "| you can leave it as it is." + echo "|" + echo "| FYI, the following configuration files belongs to this package:" + echo "|" for f in \ gconf/1/path \ gconf/schemas/desktop.schemas do - echo "* /etc/$f" + echo "| ${SYSCONFDIR}/$f" done - echo "*================= $1 ]" + echo "+--------------- $1" echo -exit 0 \ No newline at end of file +exit 0 diff --git a/devel/gconf/pkg/INSTALL b/devel/gconf/pkg/INSTALL index 2e100fd506c..ab406303ad9 100644 --- a/devel/gconf/pkg/INSTALL +++ b/devel/gconf/pkg/INSTALL @@ -1,19 +1,22 @@ #!/bin/sh # -# $OpenBSD: INSTALL,v 1.1.1.1 2001/09/13 20:52:08 todd Exp $ +# $OpenBSD: INSTALL,v 1.2 2001/09/20 19:23:32 naddy Exp $ +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin PREFIX=${PKG_PREFIX:-/usr/local} -PKGNAME=gconf -DEST_PFX=/etc -SOURCE_PFX=${PREFIX}/share/${PKGNAME} +P_NAME=gconf +DEST_PFX=${SYSCONFDIR} +SOURCE_PFX=${PREFIX}/share/examples/${P_NAME} do_post() { echo - echo "*=================[ ${PKGNAME}" + echo "+--------------- ${P_NAME}" + + install -d ${DEST_PFX}/gconf/1 + install -d ${DEST_PFX}/gconf/schemas - install -d /etc/gconf/1 - install -d /etc/gconf/schemas # install or take note of existing config files for f in \ gconf/1/path \ @@ -23,7 +26,7 @@ do_post() { OLD_CONFS="${OLD_CONFS} $f" else if ! install -m 644 ${SOURCE_PFX}/$f ${DEST_PFX}/$f; then - echo "* ERROR: The following file could not be installed, exiting: ${DEST_PFX}/$f" + echo "| ERROR: The following file could not be installed, exiting: ${DEST_PFX}/$f" exit 1 fi NEW_CONFS="${NEW_CONFS} $f" @@ -32,85 +35,26 @@ do_post() { # print status report if [ -n "${NEW_CONFS}" ]; then - echo "* The following NEW configuration files have been installed:" - echo "*" + echo "| The following NEW configuration files have been installed:" + echo "|" for f in ${NEW_CONFS}; do - echo "* ${DEST_PFX}/$f" + echo "| ${DEST_PFX}/$f" done fi if [ -n "${OLD_CONFS}" ]; then if [ -n "${NEW_CONFS}" ]; then - echo "*" + echo "|" fi - echo "* The following OLD configuration files was found and have NOT been overwritten:" - echo "* You should however manually compare it to it's equivalent in ${SOURCE_PFX}" - echo "* and update your configuration if needed." - echo "*" + echo "| The following OLD configuration files was found and have NOT been overwritten:" + echo "| You should however manually compare it to it's equivalent in ${SOURCE_PFX}" + echo "| and update your configuration if needed." + echo "|" for f in ${OLD_CONFS}; do - echo "* ${DEST_PFX}/$f" + echo "| ${DEST_PFX}/$f" done fi - echo "*================= ${PKGNAME} ]" - echo -} - -# verify proper execution -# -if [ $# -ne 2 ]; then - echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 - exit 1 -fi - -# Verify/process the command -# -case $2 in - PRE-INSTALL) - ;; - POST-INSTALL) - do_post - ;; - *) - echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 - exit 1 - ;; -esac - -exit 0 - - - - -#!/bin/sh -# -# $OpenBSD: INSTALL,v 1.1.1.1 2001/09/13 20:52:08 todd Exp $ -# - -PREFIX=${PKG_PREFIX:-/usr/local} - -# $1 real file -# $2 example file -# $3 real path -install_conf() { - if [ -f $1 ]; then - echo "| Your existing configuration file $1 has not been modified." - echo "| You should however compare it to it's equivalent in ${PREFIX}/share/gconf" - echo "| and update it if neccessary." - echo "|" - else - install -d $3 - install -m 644 $2 $1 - echo "| Installed new configfile $1" - fi -} - -do_post() { - echo - echo "+----------------" - install_conf "/etc/gconf/1/path" "${PREFIX}/share/gconf/1/path.example" "/etc/gconf/1" - install_conf "/etc/gconf/schemas/desktop.schemas" "${PREFIX}/share/gconf/schemas/desktop.schemas" \ - "/etc/gconf/schemas" - echo "+----------------" + echo "+--------------- ${P_NAME}" echo } diff --git a/devel/gconf/pkg/PLIST b/devel/gconf/pkg/PLIST index bbfff3a1e43..df4fc0dc30d 100644 --- a/devel/gconf/pkg/PLIST +++ b/devel/gconf/pkg/PLIST @@ -1,4 +1,4 @@ -@comment $OpenBSD: PLIST,v 1.2 2001/09/18 14:22:14 naddy Exp $ +@comment $OpenBSD: PLIST,v 1.3 2001/09/20 19:23:32 naddy Exp $ bin/gconf-config bin/gconf-config-1 bin/gconfd-1 @@ -22,8 +22,8 @@ lib/libgconf-gtk-1.la lib/pkgconfig/gconf.pc lib/pkgconfig/gconfgtk.pc share/aclocal/gconf-1.m4 -share/gconf/gconf/1/path -share/gconf/gconf/schemas/desktop.schemas +share/examples/gconf/gconf/1/path +share/examples/gconf/gconf/schemas/desktop.schemas share/locale/az/LC_MESSAGES/GConf.mo share/locale/ca/LC_MESSAGES/GConf.mo share/locale/cs/LC_MESSAGES/GConf.mo @@ -50,10 +50,10 @@ share/locale/uk/LC_MESSAGES/GConf.mo share/locale/zh_CN.GB2312/LC_MESSAGES/GConf.mo share/oaf/gconfd-1.oafinfo %%SHARED%% -@dirrm share/gconf/gconf/1 -@dirrm share/gconf/gconf/schemas -@dirrm share/gconf/gconf -@dirrm share/gconf +@dirrm share/examples/gconf/gconf/1 +@dirrm share/examples/gconf/gconf/schemas +@dirrm share/examples/gconf/gconf +@dirrm share/examples/gconf @dirrm lib/GConf/1 @dirrm lib/GConf @dirrm include/gconf/1/gconf