ports/70065: New port irc/bopm: Open proxy monitor and blocker, designed for use with ircds
aquatique-ports at rambler.ru
aquatique-ports at rambler.ru
Fri Aug 6 06:20:22 UTC 2004
>Number: 70065
>Category: ports
>Synopsis: New port irc/bopm: Open proxy monitor and blocker, designed for use with ircds
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Fri Aug 06 06:20:21 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Evgueni V. Gavrilov
>Release: FreeBSD 4.10-RELEASE i386
>Organization:
rusunix.org
>Environment:
System: FreeBSD rusunix.org 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Thu May 27 18:47:13 OMSST 2004 root at rusunix.org:/usr/obj/usr/src/sys/NEWMONSTER i386
>Description:
New port irc/bopm: Open proxy monitor and blocker, designed for use with ircds
>How-To-Repeat:
sh ./bopm.shar :)
>Fix:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# bopm
# bopm/files
# bopm/files/bopm.sh.sample
# bopm/Makefile
# bopm/distinfo
# bopm/pkg-deinstall
# bopm/pkg-descr
# bopm/pkg-install
# bopm/pkg-message
# bopm/pkg-plist
#
echo c - bopm
mkdir -p bopm > /dev/null 2>&1
echo c - bopm/files
mkdir -p bopm/files > /dev/null 2>&1
echo x - bopm/files/bopm.sh.sample
sed 's/^X//' >bopm/files/bopm.sh.sample << 'END-of-bopm/files/bopm.sh.sample'
X#!/bin/sh
X
XPREFIX=$(expr $0 : "\(/.*/\)etc/rc\.d/$(basename $0)\$")
X
XBOPM=${PREFIX}bin/bopm
X
Xcase "$1" in
Xstart)
X if [ -x $BOPM ]; then
X su bopm -c $BOPM -d >/dev/null 2>&1
X echo -n ' bopm'
X fi
X ;;
Xstop)
X# kill `cat ${PREFIX}/etc/ircd-hybrid-ru/ircd.pid` >/dev/null 2>&1
X killall bopm >/dev/null 2>&1
X echo -n ' bopm'
X ;;
X*)
X echo "Usage: `basename $0` {start|stop}" >&2
X ;;
Xesac
X
Xexit 0
END-of-bopm/files/bopm.sh.sample
echo x - bopm/Makefile
sed 's/^X//' >bopm/Makefile << 'END-of-bopm/Makefile'
X# New ports collection makefile for: bopm
X# Date Created: 2004.08.06
X# Whom: Evgueni V. Gavrilov <aquatique at rusunix.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME= bopm
XPORTVERSION= 3.1.2
XCATEGORIES= irc
XMASTER_SITES= http://static.blitzed.org/www.blitzed.org/bopm/files/ \
X ftp://rusunix.org/pub/FreeBSD/distfiles/
X
XMAINTAINER= aquatique-ports at rambler.ru
XCOMMENT= Open proxy monitor and blocker, designed for use with ircds
X
XUSE_REINPLACE= yes
XGNU_CONFIGURE= yes
XCONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc
X
Xpost-patch:
X @${REINPLACE_CMD} -e 's,^[[:space:]]*$$(mkinstalldirs) $$(localstatedir),,' ${WRKSRC}/Makefile.in
X @${REINPLACE_CMD} -e 's,= bopm.conf.sample,= ,' ${WRKSRC}/Makefile.in
X
Xpre-install:
X @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
X
Xpost-install:
X @${INSTALL_SCRIPT} -m 555 ${FILESDIR}/bopm.sh.sample ${PREFIX}/etc/rc.d
X @${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
END-of-bopm/Makefile
echo x - bopm/distinfo
sed 's/^X//' >bopm/distinfo << 'END-of-bopm/distinfo'
XMD5 (bopm-3.1.2.tar.gz) = ab1b7494c4242eef957b5fca61c92b18
XSIZE (bopm-3.1.2.tar.gz) = 608855
END-of-bopm/distinfo
echo x - bopm/pkg-deinstall
sed 's/^X//' >bopm/pkg-deinstall << 'END-of-bopm/pkg-deinstall'
X#! /bin/sh
X
Xask() {
X local question default answer
X
X question=$1
X default=$2
X if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
X read -p "${question} [${default}]? " answer
X fi
X echo ${answer:-${default}}
X}
X
Xyesno() {
X local question default answer
X
X question=$1
X default=$2
X while :; do
X answer=$(ask "${question}" "${default}")
X case "${answer}" in
X [Yy]*) return 0;;
X [Nn]*) return 1;;
X esac
X echo "Please answer yes or no."
X done
X}
X
Xdelete_account() {
X local u
X
X u=$1
X if yesno "Do you want me to remove user \"${u}\"" n; then
X pw userdel -n ${u}
X echo "Done."
X fi
X}
X
Xcase $2 in
X
XDEINSTALL)
X if ps -axc | grep -qw bopm; then
X if yesno "bopm is still running. Shall I stop it?" y; then
X killall bopm
X sleep 2
X else
X echo "OK ... I hope you know what you are doing."
X fi
X fi
X
X delete_account bopm
X ;;
X
Xesac
END-of-bopm/pkg-deinstall
echo x - bopm/pkg-descr
sed 's/^X//' >bopm/pkg-descr << 'END-of-bopm/pkg-descr'
X bopm is an open-source open proxy monitor, designed for use
X with hybrid-based ircds, although it can be used with slight
X modification on any server which has +c to show connects to
X opers and that supports KLINEs in order to K-LINE incoming
X connects from open proxies
X
XWWW: http://blitzed.org/bopm/
END-of-bopm/pkg-descr
echo x - bopm/pkg-install
sed 's/^X//' >bopm/pkg-install << 'END-of-bopm/pkg-install'
X#!/bin/sh
X
X# This script is a modified copy of the pkg-install script
X# from the ircd-hybrid-ru port.
X
Xif [ "x$2" != "xPRE-INSTALL" ]; then
X exit 0;
Xfi
X
X
Xif ! which -s pw ; then
X cat <<EOF
XYour system does not include the "pw" utility. You should upgrade
Xto a newer version of FreeBSD. Without "pw" this script will not
Xrun.
XEOF
X exit 1
Xfi
X
Xuid=717
Xuser=bopm
Xgid=$uid
Xgroup=$user
Xgecos="Blitzed Open Proxy Monitor"
Xshell="/bin/sh"
Xhome="/nonexistent"
X
Xecho ""
Xif pw groupshow $group 2> /dev/null ; then
X echo "You already have a group \"$group\", so I will use it."
Xelse
X if pw groupshow $gid 2> /dev/null ; then
X echo "You already have a gid \"$gid\". Please create a user \"$group\""
X echo "with a default group of \"$group\"."
X exit 1
X fi
X echo "You need a group \"$group\"."
X if which -s pw ; then
X pw groupadd $group -g $gid || exit
X echo "Done."
X else
X echo "Please create it, and try again."
X if ! pw usershow $user 2> /dev/null ; then
X echo "While you're at it, please create a user \"$user\""
X echo 'too, with a default group of "$group".'
X fi
X exit 1
X fi
Xfi
X
Xif pw usershow $user 2> /dev/null ; then
X echo "You already have a user \"$user\", so I will use it."
Xelse
X if pw usershow $uid 2> /dev/null ; then
X echo "You already have a uid \"$uid\". Please create a user \"$user\""
X echo "with a default group of \"$group\"."
X exit 1
X fi
X echo "You need a user \"$user\"."
X if which -s pw; then
X pw useradd $user -g $group -u $uid -h - -d $home \
X -s "$shell" -c "$gecos" || exit
X echo "Done."
X else
X echo "Please create it, and try again."
X exit 1
X fi
Xfi
END-of-bopm/pkg-install
echo x - bopm/pkg-message
sed 's/^X//' >bopm/pkg-message << 'END-of-bopm/pkg-message'
X
X----------------------------------------------------
X
XThis port uses now UID/GID - 717
X
Xbopm has been installed.
X
XThis port create user bopm and group bopm
X
XYou should now edit bopm.conf it to suit your needs.
X
XYou may then start the bopm by running:
X cd /usr/local/etc/rc.d/ && \
X cp bopm.sh.sample bopm.sh && \
X /usr/local/etc/rc.d/bopm.sh start
X
X----------------------------------------------------
END-of-bopm/pkg-message
echo x - bopm/pkg-plist
sed 's/^X//' >bopm/pkg-plist << 'END-of-bopm/pkg-plist'
Xbin/bopm
Xetc/bopm.conf
Xetc/rc.d/bopm.sh.sample
Xinclude/opm.h
Xinclude/opm_error.h
Xinclude/opm_types.h
Xinclude/opm_common.h
Xlib/libopm.so.0
Xlib/libopm.la
Xlib/libopm.a
X at exec mkdir -m 755 /var/log/bopm
X at exec chown bopm:bopm /var/log/bopm
X at unexec rmdir /var/log/bopm 2>/dev/null || true
END-of-bopm/pkg-plist
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list