- clean up the Makefile

- install apc-upsd.conf into ${PREFIX}/lib/apc-upsd
- fake
This commit is contained in:
kevlo 2000-04-20 02:23:33 +00:00
parent 1c84ff3535
commit fd6aa42d30
4 changed files with 98 additions and 11 deletions

View File

@ -2,14 +2,13 @@
# Date created: 28 Dec 1999
# Whom: Kevin Lo <kevlo@openbsd.org>
#
# $OpenBSD: Makefile,v 1.6 2000/04/09 17:38:15 espie Exp $
# $OpenBSD: Makefile,v 1.7 2000/04/20 02:23:33 kevlo Exp $
#
DISTNAME= apc-upsd
PKGNAME= apc-upsd
CATEGORIES= sysutils
NEED_VERSION= 1.191
FAKE=No
MASTER_SITES= http://www.knienieder.com/software/
MAINTAINER= kevlo@openbsd.org
@ -21,18 +20,17 @@ PERMIT_DISTFILES_FTP= Yes
EXTRACT_SUFX= .tgz
FAKE= Yes
WRKDIST= ${WRKDIR}/${PKGNAME}/src
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/apc-upsd ${PREFIX}/sbin
post-install:
@mkdir -p ${PREFIX}/share/doc/apc-upsd
${INSTALL_DATA_DIR} ${PREFIX}/lib/apc-upsd
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/apc-upsd
${INSTALL_DATA} ${WRKSRC}/../doc/smart-protocol ${PREFIX}/share/doc/apc-upsd
if [ ! -f /etc/apc-upsd.conf ] ; then \
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \
${WRKSRC}/apc-upsd.conf /etc/apc-upsd.conf; \
fi
${INSTALL_DATA} ${WRKSRC}/apc-upsd.conf ${PREFIX}/lib/apc-upsd
.include <bsd.port.mk>

View File

@ -0,0 +1,25 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1 2000/04/20 02:23:39 kevlo Exp $
#
# apc-upsd de-installation
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
APC_UPSD=/etc/apc-upsd.conf
if [ -e ${APC_UPSD} ]; then
echo
echo "+---------------"
echo "| To completely deinstall the $1 package you need to perform"
echo "| this step as root:"
echo "|"
echo "| rm -f ${APC_UPSD}"
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."
echo "+---------------"
echo
fi
exit 0

View File

@ -0,0 +1,65 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2000/04/20 02:23:39 kevlo Exp $
#
# Pre/post-installation setup of apc-upsd
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
APC_UPSD=/etc/apc-upsd.conf
# Function: tell the user what s/he needs to do to use the port just installed
#
do_notice()
{
echo
echo "+---------------"
echo "| The file ${APC_UPSD} exists on your system. It has"
echo "| NOT been updated. Please look at the file "
echo "| ${PREFIX}/lib/apc-upsd/apc-upsd.conf"
echo "| and add any desired (but missing) entries into your"
echo "| current ${APC_UPSD}"
}
# Function: install the screenrc where it is supposed to be.
#
do_install()
{
cp ${PREFIX}/lib/apc-upsd/apc-upsd.conf /etc
echo
echo "+---------------"
echo "| The file ${APC_UPSD} has been created on your system."
echo "| You may want to verify/edit its contents"
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 [ -e ${APC_UPSD} ]; 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,6 +1,5 @@
lib/apc-upsd/apc-upsd.conf
sbin/apc-upsd
share/doc/apc-upsd/smart-protocol
@dirrm lib/apc-upsd
@dirrm share/doc/apc-upsd
@cwd /etc
@cwd /etc
apc-upsd.conf