Use INSTALL/DEINSTALL.

This commit is contained in:
form 2000-05-17 04:23:39 +00:00
parent f8b603180f
commit 51d1bc1b59
4 changed files with 95 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.17 2000/03/25 15:39:54 kevlo Exp $
# $OpenBSD: Makefile,v 1.18 2000/05/17 04:23:39 form Exp $
DISTNAME= joe2.8
PKGNAME= joe-2.8
@ -34,12 +34,5 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/jpicorc ${PREFIX}/lib/joe
${INSTALL_DATA} ${WRKSRC}/jstarrc ${PREFIX}/lib/joe
${INSTALL_DATA} ${WRKSRC}/rjoerc ${PREFIX}/lib/joe
@if [ ! -d /etc/joe ]; then \
echo "***"; \
echo "*** Finished installing joe."; \
echo "*** Default configuration files stored in ${PREFIX}/lib/joe."; \
echo "*** If you wish to change joe configuration, copy these"; \
echo "*** files to /etc/joe and edit them."; \
fi
.include <bsd.port.mk>

24
editors/joe/pkg/DEINSTALL Normal file
View File

@ -0,0 +1,24 @@
# $OpenBSD: DEINSTALL,v 1.1 2000/05/17 04:23:39 form Exp $
#
# joe de-installation
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_DIR=/etc/joe
if [ -d ${CONFIG_DIR} ]; then
echo
echo "+---------------"
echo "| To completely deinstall the $1 package you need to perform"
echo "| this step as root:"
echo "|"
echo "| rm -rf ${CONFIG_DIR}"
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."
echo "+---------------"
echo
fi
exit 0

69
editors/joe/pkg/INSTALL Normal file
View File

@ -0,0 +1,69 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2000/05/17 04:23:39 form Exp $
#
# Pre/post-installation setup of joe
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
CONFIG_DIR=/etc/joe
SAMPLE_CONFIG_DIR=${PREFIX}/lib/joe
# Function: tell the user what s/he needs to do to use the port just installed
#
do_notice()
{
echo
echo "+---------------"
echo "| The existing $1 configuration files in ${CONFIG_DIR},"
echo "| have NOT been changed. You may want to compare them to the"
echo "| current sample files in ${SAMPLE_CONFIG_DIR},"
echo "| and update your configuration as needed."
echo "+---------------"
echo
}
# Function: install default config files from the samples
#
do_install()
{
install -o root -g wheel -m 755 ${CONFIG_DIR}
install -o root -g wheel -m 644 ${SAMPLE_CONFIG_DIR}/* ${CONFIG_DIR}
echo
echo "+---------------"
echo "| The $1 configuration files have been installed into"
echo "| $CONFIG_DIR}. Please view these files and change"
echo "| the configuration to meet your needs."
echo "+---------------"
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)
: nothing to pre-install for this port
;;
POST-INSTALL)
if [ -d ${CONFIG_DIR} ]; then
do_notice $1
else
do_install $1
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0

View File

@ -1,3 +1,4 @@
@comment $OpenBSD: PLIST,v 1.6 2000/05/17 04:23:39 form Exp $
bin/jmacs
bin/joe
bin/jstar
@ -10,5 +11,3 @@ lib/joe/rjoerc
lib/joe/jpicorc
man/man1/joe.1
@dirrm lib/joe
@exec if [ ! -d /etc/joe ]; then echo "***"; echo "*** Finished installing joe."; echo "*** Default configuration files stored in %D/lib/joe."; echo "*** If you wish to change joe configuration, copy these"; echo "*** files to /etc/joe and edit them."; fi
@unexec if [ -d /etc/joe ]; then echo "***"; echo "*** Finished uninstalling joe."; echo "*** Configuration files stored in /etc/joe have not been removed."; echo "*** You may wish to remove them manually."; fi