aboutsummaryrefslogtreecommitdiff
path: root/net/gatekeeper
diff options
context:
space:
mode:
Diffstat (limited to 'net/gatekeeper')
-rw-r--r--net/gatekeeper/Makefile58
-rw-r--r--net/gatekeeper/distinfo4
-rw-r--r--net/gatekeeper/files/gnugk.sh.sample41
-rw-r--r--net/gatekeeper/files/patch-Makefile.in20
-rw-r--r--net/gatekeeper/files/patch-makefile19
-rw-r--r--net/gatekeeper/files/patch-singleton.h15
-rw-r--r--net/gatekeeper/pkg-deinstall41
-rw-r--r--net/gatekeeper/pkg-install91
-rw-r--r--net/gatekeeper/pkg-plist19
9 files changed, 265 insertions, 43 deletions
diff --git a/net/gatekeeper/Makefile b/net/gatekeeper/Makefile
index 4207e017f065..4359c25f38c8 100644
--- a/net/gatekeeper/Makefile
+++ b/net/gatekeeper/Makefile
@@ -6,20 +6,23 @@
#
PORTNAME= gatekeeper
-PORTVERSION= 2.0.5
+PORTVERSION= 2.2.2
PORTREVISION= 3
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
-MASTER_SITE_SUBDIR= openh323gk
-DISTNAME= gk-${PORTVERSION}
-EXTRACT_SUFX= .tgz
+MASTER_SITE_SUBDIR= openh323gk
+DISTNAME= gnugk-${PORTVERSION}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= Joerg.Pulz@frm2.tum.de
COMMENT= GnuGK is GPL Gate Keeper for OhPhone, GnomeMeeting, NetMeeting and H323
BUILD_DEPENDS= ${NONEXISTENT}:${PORTSDIR}/net/openh323:build
-WRKSRC= ${WRKDIR}/openh323gk
+USE_RC_SUBR= yes
+RC_DIR= ${PREFIX}/etc/rc.d
+
+USE_AUTOCONF_VER= 259
+CONFIGURE_ENV= ${MAKE_ENV}
NOCLEANDEPENDS= yes
@@ -31,8 +34,49 @@ MAKE_ENV= PWLIBDIR=${WRKDIRPREFIX}${.CURDIR}/../../devel/pwlib/work/pwlib \
THE_MACHTYPE= ${ARCH:S/i386/x86/}
MAKE_ARGS= OSTYPE=${OPSYS} MACHTYPE=${THE_MACHTYPE} OSRELEASE=${OSVERSION} CPLUS=${CXX} HAS_RADACCT=1
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 500000
+CONFIGURE_ARGS+= --enable-radius
+.else
+CONFIGURE_ARGS+= --disable-radius
+.endif
+
+#.if defined(WITH_MYSQL)
+#USE_MYSQL= 41
+#CONFIGURE_ARGS+= --enable-mysql \
+# --with-mysql-dir=${LOCALBASE}
+#.else
+CONFIGURE_ARGS+= --disable-mysql
+#.endif
+
+#.if defined(WITH_PGSQL)
+#USE_PGSQL= yes
+#CONFIGURE_ARGS+= --enable-pgsql \
+# --with-pgsql-dir=${LOCALBASE}
+#.else
+CONFIGURE_ARGS+= --disable-pgsql
+#.endif
+
+pre-install:
+ @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \
+ -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
+ ${FILESDIR}/gnugk.sh.sample > ${WRKDIR}/gnugk.sh
+
+pre-su-install:
+ @${SETENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/obj_${OPSYS}_${THE_MACHTYPE}_r/gnugk ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/obj_${OPSYS}_${THE_MACHTYPE}_r/addpasswd ${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/etc/complete.ini ${PREFIX}/etc/gnugk.ini.default
+ @${MKDIR} ${EXAMPLESDIR}
+ @${CP} -Rp ${WRKSRC}/etc/*.ini ${EXAMPLESDIR}
+
+post-install:
+ ${INSTALL_SCRIPT} ${WRKDIR}/gnugk.sh ${RC_DIR}
+ @${SETENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/net/gatekeeper/distinfo b/net/gatekeeper/distinfo
index 6008eb404c42..dd176217f952 100644
--- a/net/gatekeeper/distinfo
+++ b/net/gatekeeper/distinfo
@@ -1,2 +1,2 @@
-MD5 (gk-2.0.5.tgz) = e719a6b59de76417ff31bf6c0da2212f
-SIZE (gk-2.0.5.tgz) = 319926
+MD5 (gnugk-2.2.2.tar.gz) = 689d1239273d21daba5746fd128d3184
+SIZE (gnugk-2.2.2.tar.gz) = 562982
diff --git a/net/gatekeeper/files/gnugk.sh.sample b/net/gatekeeper/files/gnugk.sh.sample
new file mode 100644
index 000000000000..80cec7929650
--- /dev/null
+++ b/net/gatekeeper/files/gnugk.sh.sample
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: gnugk
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+#
+# Add to /etc/rc.conf to enable gnugk:
+# gnugk_enable="YES"
+#
+# Additional options for /etc/rc.conf
+# gnugk_user="the user that should run gnugk" (def: gnugk)
+# gnugk_config"path to the config file to use" (def: /usr/local/etc/gnugk.ini)
+# gnugk_logfile="path to the logfile to log to" (def: /var/log/gnugk/gnugk.log)
+# gnugk_pidfile="path to the pidfile to use" (def: /var/run/gnugk/gnugk.pid)
+# gnugk_flags="additional flags you need" (def: -t)
+
+. %%RC_SUBR%%
+
+name="gnugk"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/${name}"
+extra_commands="reload"
+
+load_rc_config $name
+
+gnugk_user=${gnugk_user:-${name}}
+gnugk_config=${gnugk_config:-"%%PREFIX%%/etc/${name}.ini"}
+gnugk_logfile=${gnugk_logfile:-"/var/log/${name}/${name}.log"}
+gnugk_pidfile=${gnugk_pidfile:-"/var/run/${name}/${name}.pid"}
+
+# use some defaults if no flags are specified in /etc/rc.conf
+gnugk_flags=${gnugk_flags:-"-t"}
+
+required_files=${gnugk_conf}
+pidfile=${gnugk_pidfile}
+command_args="-u ${gnugk_user} -c ${gnugk_config} -o ${gnugk_logfile} --pid ${pidfile} >/dev/null &"
+
+run_rc_command "$1"
diff --git a/net/gatekeeper/files/patch-Makefile.in b/net/gatekeeper/files/patch-Makefile.in
new file mode 100644
index 000000000000..e46dc82e2ae2
--- /dev/null
+++ b/net/gatekeeper/files/patch-Makefile.in
@@ -0,0 +1,20 @@
+--- Makefile.in.orig Mon Jun 20 14:16:12 2005
++++ Makefile.in Mon Jun 20 14:17:08 2005
+@@ -76,7 +76,7 @@
+ LD_RUN_LIST += $(PWLIBDIR)/lib $(OPENH323DIR)/lib
+
+ # compiler/linker flags set by configure script
+-STDCCFLAGS += @STDCCFLAGS@
++STDCCFLAGS += @STDCCFLAGS@ -DPASN_LEANANDMEAN=1
+ LDFLAGS += @LDFLAGS@
+ ENDLDLIBS += @ENDLDLIBS@
+ ENDLDFLAGS += @ENDLDFLAGS@
+@@ -111,7 +111,7 @@
+
+ # extra targets
+ addpasswd: $(OBJDIR)/addpasswd.o
+- $(CXX) -o $(OBJDIR)/addpasswd $(CFLAGS) $(OBJDIR)/addpasswd.o $(LDFLAGS) -l$(PTLIB_BASE)$(LIB_TYPE) $(ENDLDLIBS) $(ENDLDFLAGS)
++ $(CXX) -o $(OBJDIR)/addpasswd $(CFLAGS) $(OBJDIR)/addpasswd.o $(LDFLAGS) -l$(PTLIB_BASE)$(LIB_TYPE)_s $(ENDLDLIBS) $(ENDLDFLAGS)
+
+ doc:
+ $(MAKE) -C docs/manual html
diff --git a/net/gatekeeper/files/patch-makefile b/net/gatekeeper/files/patch-makefile
deleted file mode 100644
index c0271eefd306..000000000000
--- a/net/gatekeeper/files/patch-makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-*** Makefile.orig Thu Aug 28 08:22:41 2003
---- Makefile Thu Aug 28 08:22:54 2003
-*************** endif
-*** 187,193 ****
-
- # extra targets
- addpasswd: $(OBJDIR)/addpasswd.o
-! $(CXX) -o $(OBJDIR)/addpasswd $(CFLAGS) $(OBJDIR)/addpasswd.o $(LDFLAGS) -l$(PTLIB_BASE)$(LIB_TYPE) $(ENDLDLIBS) $(ENDLDFLAGS)
-
- doc: docs/manual.sgml
- cd docs; sgml2html manual.sgml; \
---- 187,193 ----
-
- # extra targets
- addpasswd: $(OBJDIR)/addpasswd.o
-! $(CXX) -o $(OBJDIR)/addpasswd $(CFLAGS) $(OBJDIR)/addpasswd.o $(LDFLAGS) -l$(PTLIB_BASE)$(LIB_TYPE)_s $(ENDLDLIBS) $(ENDLDFLAGS)
-
- doc: docs/manual.sgml
- cd docs; sgml2html manual.sgml; \
diff --git a/net/gatekeeper/files/patch-singleton.h b/net/gatekeeper/files/patch-singleton.h
deleted file mode 100644
index 8fad1552cb4b..000000000000
--- a/net/gatekeeper/files/patch-singleton.h
+++ /dev/null
@@ -1,15 +0,0 @@
---- singleton.h.orig Thu Oct 7 19:42:31 2004
-+++ singleton.h Thu Oct 7 19:42:49 2004
-@@ -87,12 +87,7 @@
- Singleton();
- ~Singleton();
-
--#ifdef WIN32
- public:
--#else
-- private:
-- friend T *InstanceOf<T>();
--#endif
- static SingletonBase *m_Instance;
- static PMutex m_CreationLock;
- };
diff --git a/net/gatekeeper/pkg-deinstall b/net/gatekeeper/pkg-deinstall
new file mode 100644
index 000000000000..9d8a5ce54bc4
--- /dev/null
+++ b/net/gatekeeper/pkg-deinstall
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PATH=/bin:/usr/bin:/usr/sbin
+
+gnugk_config=${PKG_PREFIX:-"/usr/local"}/etc/gnugk.ini
+gnugk_logdir="/var/log/gnugk"
+gnugk_piddir="/var/run/gnugk"
+
+case $2 in
+DEINSTALL)
+ cmp -s -z ${gnugk_config} ${gnugk_config}.default && rm ${gnugk_config}
+ rmdir ${gnugk_logdir} 2>/dev/null
+ rmdir ${gnugk_piddir} 2>/dev/null
+ ;;
+POST-DEINSTALL)
+ echo "===> post-deinstallation information for $1"
+ echo ""
+ echo " Please note that gatekeeper was not completely removed"
+ echo " from this system:"
+ echo ""
+ echo " Any gatekeeper related user accounts were kept."
+ if [ -f ${gnugk_config} \
+ -o -d ${gnugk_logdir} \
+ -o -d ${gnugk_piddir} ] ; then
+ echo ""
+ echo " Additionally, the log directory as well as any"
+ echo " modified configuration files were preserved"
+ echo " too, in case you want to install an updated version"
+ echo " of gatekeeper. You need to remove them manually if"
+ echo " you do not want to use it any longer."
+ fi
+ echo ""
+ ;;
+*)
+ exit 64
+ ;;
+esac
+exit 0
diff --git a/net/gatekeeper/pkg-install b/net/gatekeeper/pkg-install
new file mode 100644
index 000000000000..aea34263e80a
--- /dev/null
+++ b/net/gatekeeper/pkg-install
@@ -0,0 +1,91 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PATH=/bin:/usr/bin:/usr/sbin
+
+pkgname=$1
+gnugk_user=gnugk
+gnugk_group=gnugk
+gnugk_config=${PKG_PREFIX:-"/usr/local"}/etc/gnugk.ini
+gnugk_logdir="/var/log/gnugk"
+gnugk_piddir="/var/run/gnugk"
+
+if [ -x /usr/sbin/nologin ]; then
+ nologin=/usr/sbin/nologin
+else
+ nologin=/sbin/nologin
+fi
+
+case $2 in
+PRE-INSTALL)
+ echo "===> Pre-installation configuration for ${pkgname}"
+ if ! pw groupshow ${gnugk_group} -q >/dev/null ; then
+ echo "There is no group '${gnugk_group}' on this system, so I will try to create it:"
+ if ! pw groupadd ${gnugk_group} -q -h - ; then
+ echo "Failed to create group \"${gnugk_group}\"!" >&2
+ echo "Please create it manually." >&2
+ exit 1
+ else
+ echo "Group '${gnugk_group}' created successfully:"
+ fi
+ else
+ echo "I will use the existing group '${gnugk_group}':"
+ fi
+ pw groupshow ${gnugk_group}
+
+ if ! pw usershow ${gnugk_user} -q >/dev/null ; then
+ echo "There is no account '${gnugk_user}' on this system, so I will try to create it:"
+ if ! pw useradd -q -n ${gnugk_user} \
+ -g ${gnugk_group} -d/nonexistent \
+ -c "GNU Gatekeeper pseudo user" \
+ -s "${nologin}" -h - ; then
+ echo "Failed to create user '${gnugk_user}'!" >&2
+ echo "Please create it manually." >&2
+ exit 1
+ else
+ echo "User '${gnugk_user}' created successfully:"
+ fi
+ else
+ echo "I will use the existing user '${gnugk_user}':"
+ fi
+ pw usershow ${gnugk_user}
+
+ for dir in ${gnugk_logdir} ${gnugk_piddir}; do
+ if [ ! -d ${dir} ]; then
+ echo "Creating ${dir}..."
+ install -d -o ${gnugk_user} -g ${gnugk_group} \
+ -m 0750 ${dir}
+ fi
+ done
+ ;;
+POST-INSTALL)
+ if [ ! -f ${gnugk_config} \
+ -a -f ${gnugk_config}.default ]; then
+ echo "Creating ${gnugk_config} from default..."
+ install -c -o root -g ${gnugk_group} -m 0640 \
+ ${gnugk_config}.default \
+ ${gnugk_config}
+ fi
+
+ echo "===> Post-installation informations for ${pkgname}"
+ echo ""
+ echo " o A sample configuration file for this package is installed"
+ echo " as ${gnugk_config}."
+ echo " More example configurations can be found in"
+ echo " ${PKG_PREFIX}/share/examples/gatekeeper."
+ echo ""
+ echo " o A log directory has been created in ${gnugk_logdir}."
+ echo ""
+ echo " To enable gatekeeper, set gnugk_enable=yes in either"
+ echo " /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/gnugk"
+ echo " See ${PKG_PREFIX}/etc/rc.d/gnugk.sh for more"
+ echo " configuration options."
+ echo ""
+ ;;
+*)
+ exit 64
+ ;;
+esac
+exit 0
diff --git a/net/gatekeeper/pkg-plist b/net/gatekeeper/pkg-plist
index 2e7e1904a073..b9efe7fc8886 100644
--- a/net/gatekeeper/pkg-plist
+++ b/net/gatekeeper/pkg-plist
@@ -1,2 +1,21 @@
+@unexec %D/etc/rc.d/gnugk.sh forcestop 2>/dev/null || true
bin/gnugk
bin/addpasswd
+etc/rc.d/gnugk.sh
+etc/gnugk.ini.default
+share/examples/gatekeeper/child.ini
+share/examples/gatekeeper/clirw.ini
+share/examples/gatekeeper/complete.ini
+share/examples/gatekeeper/fileacct.ini
+share/examples/gatekeeper/mysql.ini
+share/examples/gatekeeper/neighbor.ini
+share/examples/gatekeeper/proxy.ini
+share/examples/gatekeeper/radacct.ini
+share/examples/gatekeeper/radaliasauth.ini
+share/examples/gatekeeper/radauth.ini
+share/examples/gatekeeper/routed.ini
+share/examples/gatekeeper/rrqauth.ini
+share/examples/gatekeeper/sql.ini
+share/examples/gatekeeper/status.ini
+share/examples/gatekeeper/vqueue.ini
+@dirrm share/examples/gatekeeper