summaryrefslogtreecommitdiff
path: root/irc
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2004-08-05 11:00:30 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2004-08-05 11:00:30 +0000
commit9dd818ed0cd4bc116cd4a39e129c7edf05cad12f (patch)
tree3a19a475ab807f02d002f4cd6dfd21741228f867 /irc
parentDo not apply patches for the latest gcc-3.4.2 to FreeBSD-4.x (diff)
fix install with BATCH=1 (for pointyhat)
maintainer timed out - 2 weeks PR: ports/69335 Submitted by: Andrej Zverev <az@inec.ru>
Notes
Notes: svn path=/head/; revision=115456
Diffstat (limited to 'irc')
-rw-r--r--irc/hybserv/Makefile10
-rw-r--r--irc/hybserv/pkg-install110
-rw-r--r--irc/hybserv/pkg-plist1
3 files changed, 31 insertions, 90 deletions
diff --git a/irc/hybserv/Makefile b/irc/hybserv/Makefile
index 80e6a731ac2e..0bdaae1f1c1f 100644
--- a/irc/hybserv/Makefile
+++ b/irc/hybserv/Makefile
@@ -19,18 +19,8 @@ GNU_CONFIGURE= yes
WRKSRC= ${WRKDIR}/hybserv
-.if !defined(PACKAGE_BUILDING) && !defined(BATCH)
-IS_INTERACTIVE= yes
-.endif
-
-BROKEN= "Does not install"
-EXPIRATION_DATE=2004-08-20
-DEPRECATED= ${BROKEN}
-
pre-install:
-.if !defined(PACKAGE_BUILDING) && !defined(BATCH)
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-.endif
post-install:
@${SED} -e "s#%PREFIX%#${PREFIX}#" ${FILESDIR}/hybserv.sh \
diff --git a/irc/hybserv/pkg-install b/irc/hybserv/pkg-install
index a40c5cd66a57..f44897ccd6cf 100644
--- a/irc/hybserv/pkg-install
+++ b/irc/hybserv/pkg-install
@@ -1,91 +1,41 @@
#!/bin/sh
-# This script is a slightly modified copy of the pkg-install script from the
-# original ircd-hybrid port, by desmo@bandwidth.org.
-
if [ "x$2" != "xPRE-INSTALL" ]; then
- exit 0;
-fi
-
-ask() {
- local question default answer
-
- question=$1
- default=$2
- if [ -z "${PACKAGE_BUILDING}" ]; then
- read -p "${question} [${default}]? " answer
- fi
- if [ x${answer} = x ]; then
- answer=${default}
- fi
- echo ${answer}
-}
-
-yesno() {
- local dflt question answer
-
- question=$1
- dflt=$2
- while :; do
- answer=$(ask "${question}" "${dflt}")
- case "${answer}" in
- [Yy]*) return 0;;
- [Nn]*) return 1;;
- esac
- echo "Please answer yes or no."
- done
-}
-
-if which -s pw ; then
- :
-else
- cat <<EOF
-Your system does not include the "pw" utility. You should upgrade
-to a newer version of FreeBSD. Without "pw" this script will not
-run.
-EOF
- exit 1
+ exit 0;
fi
-echo ""
-if pw groupshow hybserv 2> /dev/null ; then
- echo "You already have a group \"hybserv\", so I will use it."
-else
- if pw groupshow 73 2> /dev/null ; then
- echo "You already have a gid \"73\". Please create a user \"hybserv\""
- echo "with a default group of \"hybserv\"."
- exit 1
- fi
- echo "You need a group \"hybserv\"."
- if which -s pw && yesno "Would you like me to create it" y; then
- pw groupadd hybserv -g 73 || exit
- echo "Done."
+ USER=hybserv
+ GROUP=${USER}
+ UID=73
+ GID=${UID}
+ HOME_DIR="/nonexist"
+ if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
else
- echo "Please create it, and try again."
- if ! pw usershow hybserv 2> /dev/null ; then
- echo "While you're at it, please create a user \"hybserv\""
- echo 'too, with a default group of "hybserv".'
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
fi
- exit 1
fi
-fi
-if pw usershow hybserv 2> /dev/null ; then
- echo "You already have a user \"hybserv\", so I will use it."
-else
- if pw usershow 73 2> /dev/null ; then
- echo "You already have a uid \"73\". Please create a user \"irc
-d\""
- echo "with a default group of \"hybserv\"."
- exit 1
- fi
- echo "You need a user \"hybserv\"."
- if which -s pw && yesno "Would you like me to create it" y; then
- pw useradd hybserv -g hybserv -u 73 -h - -d /nonexistent \
- -s /nonexistent -c "IRC Daemon" || exit
- echo "Done."
+ if pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ if pw usermod ${USER} -d ${HOME_DIR}
+ then
+ echo "Changed home directory of \"${USER}\" to \"${HOME_DIR}\""
+ else
+ echo "Changing home directory of \"${USER}\" to \"${HOME_DIR}\" failed..."
+ exit 1
+ fi
else
- echo "Please create it, and try again."
- exit 1
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d ${HOME_DIR} -s /sbin/nologin -c "HybServ Daemon"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
fi
-fi
diff --git a/irc/hybserv/pkg-plist b/irc/hybserv/pkg-plist
index 3068a18a0ce0..26740ea0ed76 100644
--- a/irc/hybserv/pkg-plist
+++ b/irc/hybserv/pkg-plist
@@ -1,3 +1,4 @@
+etc/rc.d/hybserv.sh
hybserv/hybserv
hybserv/cleandb
hybserv/encryptconf