aboutsummaryrefslogtreecommitdiff
path: root/www/interchange/files
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2005-09-21 12:19:06 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2005-09-21 12:19:06 +0000
commit9311a87bb9018d471177b1be93425e943a8e9397 (patch)
treef228130e1c52729306ee431f3c27a2de099c3b66 /www/interchange/files
parente1799dbe430809026017ec5be3153b67824edec9 (diff)
downloadports-9311a87bb9018d471177b1be93425e943a8e9397.tar.gz
ports-9311a87bb9018d471177b1be93425e943a8e9397.zip
Notes
Diffstat (limited to 'www/interchange/files')
-rw-r--r--www/interchange/files/interchange.sh78
-rw-r--r--www/interchange/files/patch-Makefile.PL31
-rw-r--r--www/interchange/files/patch-dist::src::tlink.c13
3 files changed, 46 insertions, 76 deletions
diff --git a/www/interchange/files/interchange.sh b/www/interchange/files/interchange.sh
index 449cb9e14b95..b0427cd36db8 100644
--- a/www/interchange/files/interchange.sh
+++ b/www/interchange/files/interchange.sh
@@ -1,35 +1,49 @@
#!/bin/sh
+#
+# $FreeBSD$
+#
-RUNDIR=/var/run/interchange
-LOGDIR=/var/log/interchange
-ICUSER=$(cat %%PREFIX%%/interchange/_uid)
-PIDFILE=${RUNDIR}/interchange.pid
-SOCKFILE=${RUNDIR}/interchange.sock
-
-OPTS="SocketFile=${SOCKFILE} IPCsocket=${SOCKFILE}.ipc PIDfile=${PIDFILE}"
-OPTS="${OPTS} --pidfile=${PIDFILE} --log=${LOGDIR}/error.log --rundir=${RUNDIR}"
-
-case "$1" in
-start)
- [ -d ${RUNDIR} ] || \
- (mkdir ${RUNDIR} && chown ${ICUSER}:${ICUSER} ${RUNDIR})
- [ -d ${LOGDIR} ] || \
- (mkdir ${LOGDIR} && chown ${ICUSER}:${ICUSER} ${LOGDIR})
-
- if [ -x %%PREFIX%%/bin/interchange ]; then
- su -m ${ICUSER} \
- -c "%%PREFIX%%/bin/interchange ${OPTS} >/dev/null" && \
- echo -n ' interchange'
- fi
- ;;
-stop)
- if [ -r ${PIDFILE} ]; then
- kill $(cat ${PIDFILE}) && \
- echo -n ' interchange'
- fi
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- ;;
-esac
+# PROVIDE: interchange
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable Interchange:
+# interchange_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable Interchange
+# interchange_config (str): Default config file:
+# /usr/local/interchange/interchange.cfg
+# interchange_args (str): Custom additional arguments to be passed
+# to interchange (default empty).
+#
+
+
+. /etc/rc.subr
+
+name="interchange"
+rcvar=`set_rcvar`
+
+interchange_enable=${interchange_enable:-"NO"}
+interchange_config=${interchange_config:-"/usr/local/interchange/interchange.cfg"}
+interchange_args=${interchange_args:-""}
+
+load_rc_config $name
+
+interchange_user="interch"
+pidfile="/var/run/interchange/interchange.pid"
+command="/usr/local/bin/interchange"
+command_interpreter="/usr/local/bin/perl"
+command_args="--config=${interchange_config} ${interchange_args}"
+
+stop_cmd="interchange_cmd --stop"
+restart_cmd="interchange_cmd --restart"
+reload_cmd="interchange_cmd --restart"
+
+interchange_cmd()
+{
+ su -l ${interchange_user} -c "exec env PIDfile=${pidfile} ${command} ${command_args} $1"
+}
+
+run_rc_command "$1"
diff --git a/www/interchange/files/patch-Makefile.PL b/www/interchange/files/patch-Makefile.PL
deleted file mode 100644
index 49d107ab2fa9..000000000000
--- a/www/interchange/files/patch-Makefile.PL
+++ /dev/null
@@ -1,31 +0,0 @@
---- Makefile.PL_orig Sun Aug 11 13:52:36 2002
-+++ Makefile.PL Sun Aug 11 13:57:36 2002
-@@ -789,17 +796,17 @@
- WriteMakefile(
- NAME => "Interchange",
- MAN3PODS => {
-- 'pod/ic_ecommerce.pod' => 'blib/man3/ic_ecommerce.8',
-- 'pod/ic_howto_cvs.pod' => 'blib/man3/ic_howto_cvs.8',
-- 'pod/icadvanced.pod' => 'blib/man3/icadvanced.8',
-- 'pod/iccattut.pod' => 'blib/man3/iccattut.8',
-- 'pod/icconfig.pod' => 'blib/man3/icconfig.8',
-- 'pod/icdatabase.pod' => 'blib/man3/icdatabase.8',
-- 'pod/icfaq.pod' => 'blib/man3/icfaq.8',
-- 'pod/icfoundation.pod' => 'blib/man3/icfoundation.8',
-- 'pod/ictags.pod' => 'blib/man3/ictags.8',
-- 'pod/ictemplates.pod' => 'blib/man3/ictemplates.8',
-- 'pod/icupgrade.pod' => 'blib/man3/icupgrade.8',
-+ 'pod/ic_ecommerce.pod' => 'blib/man3/ic_ecommerce.7',
-+ 'pod/ic_howto_cvs.pod' => 'blib/man3/ic_howto_cvs.7',
-+ 'pod/icadvanced.pod' => 'blib/man3/icadvanced.7',
-+ 'pod/iccattut.pod' => 'blib/man3/iccattut.7',
-+ 'pod/icconfig.pod' => 'blib/man3/icconfig.7',
-+ 'pod/icdatabase.pod' => 'blib/man3/icdatabase.7',
-+ 'pod/icfaq.pod' => 'blib/man3/icfaq.7',
-+ 'pod/icfoundation.pod' => 'blib/man3/icfoundation.7',
-+ 'pod/ictags.pod' => 'blib/man3/ictags.7',
-+ 'pod/ictemplates.pod' => 'blib/man3/ictemplates.7',
-+ 'pod/icupgrade.pod' => 'blib/man3/icupgrade.7',
- },
- DISTNAME => "interchange",
- clean => {
diff --git a/www/interchange/files/patch-dist::src::tlink.c b/www/interchange/files/patch-dist::src::tlink.c
deleted file mode 100644
index bf21a2013592..000000000000
--- a/www/interchange/files/patch-dist::src::tlink.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- dist/src/tlink.c.orig Thu Jul 4 03:03:50 2002
-+++ dist/src/tlink.c Thu Jul 4 03:04:04 2002
-@@ -36,9 +36,9 @@
- #include <sys/time.h>
- #include <sys/types.h>
- #include <sys/socket.h>
-+#include <netinet/in.h>
- #include <arpa/inet.h>
- #include <arpa/telnet.h>
--#include <netinet/in.h>
- #include <netdb.h>
- #include <sys/un.h>
- #include <unistd.h>