make the port install and de-install properly in a package situation.
This commit is contained in:
parent
599297bb82
commit
144878d5ff
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.5 1999/05/25 05:23:12 brad Exp $
|
||||
# $OpenBSD: Makefile,v 1.6 1999/05/25 14:39:42 brad Exp $
|
||||
|
||||
DISTNAME= netatalk-1.4b2
|
||||
CATEGORIES= net
|
||||
@ -28,12 +28,8 @@ pre-configure:
|
||||
@${RM} -f ${WRKSRC}/sys/netatalk/*.h
|
||||
|
||||
post-install:
|
||||
@if [ ! -a X"/etc/netatalk/AppleVolumes.system" ]; then \
|
||||
@${CP} ${WRKSRC}/config/AppleVolumes.system /etc/netatalk; \
|
||||
fi
|
||||
@if [ ! -a X"/etc/netatalk/AppleVolumes.default" ]; then \
|
||||
@${CP} ${WRKSRC}/config/AppleVolumes.default /etc/netatalk; \
|
||||
fi
|
||||
@chmod 750 /etc/netatalk
|
||||
@${CP} ${WRKSRC}/config/AppleVolumes.system ${PREFIX}/lib/netatalk
|
||||
@${CP} ${WRKSRC}/config/AppleVolumes.default ${PREFIX}/lib/netatalk
|
||||
@PKG_PREFIX="${PREFIX}" ${SH} ${PKGDIR}/INSTALL ${DISTNAME} POST-INSTALL
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,7 +1,8 @@
|
||||
# OpenBSD specific defines, passed to subdirectories.
|
||||
DEFS= -DBSD4_4
|
||||
INSTALL= install
|
||||
INSTALL= install
|
||||
ADDLIBS=
|
||||
DATADIR= ${DESTDIR}/lib/netatalk
|
||||
|
||||
ALL= ../../libatalk ../../include ../../bin ../../etc ../../man
|
||||
|
||||
@ -19,7 +20,7 @@ ${ALL}: FRC
|
||||
FRC:
|
||||
|
||||
install :
|
||||
-mkdir ${DESTDIR} ${SBINDIR} ${BINDIR} ${ETCDIR} ${LIBDIR}
|
||||
-mkdir -p ${DESTDIR} ${SBINDIR} ${BINDIR} ${LIBDIR} ${DATADIR}
|
||||
for i in ${ALL}; \
|
||||
do (cd $$i; ${MAKE} ${MFLAGS} CC="${CC}" \
|
||||
ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${CFLAGS}" \
|
||||
@ -28,19 +29,12 @@ install :
|
||||
AFSDIR="${AFSDIR}" KRBDIR="${KRBDIR}" \
|
||||
INSTALL="${INSTALL}" $@); \
|
||||
done
|
||||
rm -f ${ETCDIR}/rc.atalk
|
||||
rm -f ${DATADIR}/rc.atalk
|
||||
sed -e s@:DESTDIR:@${DESTDIR}@ -e s@:SBINDIR:@${SBINDIR}@ \
|
||||
-e s@:BINDIR:@${BINDIR}@ -e s@:RESDIR:@${RESDIR}@ \
|
||||
-e s@:ETCDIR:@${ETCDIR}@ -e s@:LIBDIR:@${LIBDIR}@ \
|
||||
-e s@:INCDIR:@${INCDIR}@ \
|
||||
< ../../rc.atalk.bsd > ${ETCDIR}/rc.atalk
|
||||
@echo
|
||||
@echo "Install is done. Don't forget to call /etc/netatalk/rc.atalk"
|
||||
@echo "in /etc/rc.local. Example:-"
|
||||
@echo "# Netatalk stuff"
|
||||
@echo ". /etc/netatalk/rc.atalk"
|
||||
@echo "See README and README.FREEBSD for more"
|
||||
@echo "information."
|
||||
< ../../rc.atalk.bsd > ${DATADIR}/rc.atalk
|
||||
|
||||
clean :
|
||||
for i in ${ALL}; \
|
||||
|
24
net/netatalk/pkg/DEINSTALL
Normal file
24
net/netatalk/pkg/DEINSTALL
Normal file
@ -0,0 +1,24 @@
|
||||
# $OpenBSD: DEINSTALL,v 1.1 1999/05/25 14:39:43 brad Exp $
|
||||
#
|
||||
# netatalk de-installation
|
||||
|
||||
set -e
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
PREFIX=${PKG_PREFIX:-/usr/local}
|
||||
CONFIG_DIR=/etc/netatalk
|
||||
|
||||
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
|
70
net/netatalk/pkg/INSTALL
Normal file
70
net/netatalk/pkg/INSTALL
Normal file
@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
# $OpenBSD: INSTALL,v 1.1 1999/05/25 14:39:43 brad Exp $
|
||||
#
|
||||
# Pre/post-installation setup of netatalk
|
||||
|
||||
# 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/netatalk
|
||||
|
||||
mkdir -p ${CONFIG_DIR}
|
||||
chmod 750 ${CONFIG_DIR}
|
||||
|
||||
# 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, ${PREFIX}/lib/netatalk,"
|
||||
echo "| and update your configuration as needed."
|
||||
echo "+---------------"
|
||||
echo
|
||||
}
|
||||
|
||||
# Function: install the netatalk configuration files from the samples
|
||||
#
|
||||
do_install()
|
||||
{
|
||||
cp ${PREFIX}/lib/netatalk/* ${CONFIG_DIR}
|
||||
echo
|
||||
echo "+---------------"
|
||||
echo "| The $1 configuration files in ${CONFIG_DIR},"
|
||||
echo "| have been installed. 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 [ -f $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
|
@ -35,6 +35,9 @@ include/netatalk/endian.h
|
||||
include/netatalk/phase2.h
|
||||
lib/libatalk.a
|
||||
lib/libatalk_p.a
|
||||
lib/netatalk/AppleVolumes.system
|
||||
lib/netatalk/AppleVolumes.default
|
||||
lib/netatalk/rc.atalk
|
||||
libexec/afpd
|
||||
libexec/atalkd
|
||||
libexec/etc2ps
|
||||
@ -86,8 +89,5 @@ share/filters/tfwpaprev
|
||||
share/pagecount.ps
|
||||
@dirrm include/atalk
|
||||
@dirrm include/netatalk
|
||||
@dirrm lib/netatalk
|
||||
@dirrm share/filters
|
||||
@unexec echo ""
|
||||
@unexec echo "** remove the directory /etc/netatalk (and its contents)"
|
||||
@unexec echo "** to completely delete this package"
|
||||
@unexec echo ""
|
||||
|
Loading…
Reference in New Issue
Block a user