1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-04 06:15:24 +00:00
freebsd-ports/net/nph/pkg-install
Ion-Mihai Tetcu 1c040a8265 New PH Client and API Library
nph offers the following features:
  Complete PH API
    - your applications will never need to talk directly to the PH server
  Solid API design
    - designed to prevent memory or file descriptor leaks for applications
      which use asynchronous event timers
  Interactively usable PH client
    - the nph client supports readline command editting, history, and completion

The PH protocol is described in RFC 2378

WWW: http://www.feep.net/nph/

PR:		ports/97209
Submitted by:	Jim Pirzyk <pirzyk@freebsd.org>
2006-06-25 14:04:27 +00:00

58 lines
1.6 KiB
Bash

#!/bin/sh
PKG_PREFIX=${PKG_PREFIX:-/usr/local}
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
case $2 in
POST-INSTALL)
grep csnet-ns /etc/services > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "adding csnet-ns to /etc/services..."
cp /etc/services /etc/services.pre.$1
echo "csnet-ns 105/tcp ns # PH" >> /etc/services
fi
if [ ! -d "${PKG_PREFIX}/etc" ]; then
echo "creating directory ${PKG_PREFIX}/etc...";
mkdir -p "${PKG_PREFIX}/etc";
fi
PH_SERVER=`hostname | awk -F. '(NF > 1) { printf "ns.%s.%s\n", $(NF - 1), $NF; }'`;
if [ -z "${PH_SERVER}" ]; then
if [ -x /usr/sbin/nslookup ]; then
NSLOOKUP=/usr/sbin/nslookup;
elif [ -x /usr/bin/nslookup ]; then
NSLOOKUP=/usr/bin/nslookup;
fi
if [ -n "${NSLOOKUP}" ]; then
PH_SERVER=`hostname | xargs ${NSLOOKUP} | awk '/^Name:/ { print $2; exit; }' | awk -F. '{ printf("ns.%s.%s\n", $(NF - 1), $NF); }'`;
fi
fi
if [ -n "${PH_SERVER}" ]; then
echo "${PH_SERVER}" > ${PKG_PREFIX}/etc/ph_server.sample;
elif [ ! -f "${PKG_PREFIX}/etc/ph_server" ]; then
echo "WARNING: cannot determine PH server name - you must create ${PKG_PREFIX}/etc/ph_server manually";
fi
if [ ! -f "${PKG_PREFIX}/etc/ph_server" ]; then
echo "creating default ${PKG_PREFIX}/etc/ph_server file...";
cp ${PKG_PREFIX}/etc/ph_server.sample ${PKG_PREFIX}/etc/ph_server;
fi
if [ ! -f "${PKG_PREFIX}/etc/nphrc" ]; then
echo "installing default ${PKG_PREFIX}/etc/nphrc file...";
cp ${PKG_PREFIX}/etc/nphrc.sample ${PKG_PREFIX}/etc/nphrc;
fi
;;
esac
exit 0