Date: Mon, 13 Aug 2007 10:20:12 +0200 (CEST) From: Blaz Zupan <blaz@si.FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: steve@energistic.com Subject: ports/115459: Update for net/mediaproxy port Message-ID: <20070813082012.6C203307841@gold.inlimbo.org> Resent-Message-ID: <200708130840.l7D8e2vw040223@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 115459 >Category: ports >Synopsis: Update for net/mediaproxy port >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: Mon Aug 13 08:40:01 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Blaz Zupan >Release: FreeBSD 6.2-STABLE i386 >Organization: >Environment: System: FreeBSD gold.inlimbo.org 6.2-STABLE FreeBSD 6.2-STABLE #7: Sun Aug 12 20:15:44 CEST 2007 blaz@gold.inlimbo.org:/usr/obj/usr/src/sys/GOLD i386 >Description: The net/mediaproxy is broken in multiple ways: 1. The proxy dispatcher does not start if py-MySQLdb is not installed, but the port has no dependency on py-MySQLdb. 2. The proxy dispatcher does not start if pyrad (Python RADIUS) is not installed, but there is no FreeBSD port of it and no dependency on it in the port. 3. The port does not deinstall cleanly, because Python generates compiled files when you startup mediaproxy and the compiled files are not included in the pkg-plist. The attached patch fixes those problems. I have removed the accounting option, because the dependency on MySQL seems to be hardcoded in mediaproxy. The patch includes a dependency on pyrad, I will submit a port of pyrad in a separate PR. >How-To-Repeat: >Fix: diff -urN mediaproxy.orig/Makefile mediaproxy/Makefile --- mediaproxy.orig/Makefile 2007-06-01 09:27:12.000000000 +0200 +++ mediaproxy/Makefile 2007-08-13 09:57:47.000000000 +0200 @@ -6,7 +6,7 @@ PORTNAME= mediaproxy PORTVERSION= 1.8.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= http://mediaproxy.ag-projects.com/ \ http://mediaproxy.ag-projects.com/old/ @@ -15,22 +15,17 @@ MAINTAINER= steve@energistic.com COMMENT= A far-end NAT traversal solution for SER/OpenSER -USE_RC_SUBR= mediaproxy.sh - -WRKSRC= ${WRKDIR}/${PORTNAME} +RUN_DEPENDS= ${LOCALBASE}/lib/${PYTHON_VERSION}/site-packages/MySQLdb/__init__.py:${PORTSDIR}/databases/py-MySQLdb +RUN_DEPENDS+= ${LOCALBASE}/lib/${PYTHON_VERSION}/site-packages/pyrad/__init__.py:${PORTSDIR}/net/pyrad +USE_RC_SUBR= mediaproxy proxydispatcher USE_PYTHON= 2.3+ -OPTIONS= ACCOUNTING "ACCOUNTING support (Requires MySQL)" off - -.include <bsd.port.pre.mk> - -.if defined(WITH_ACCOUNTING) -USE_MYSQL= yes -.endif +post-extract: + ${MV} ${WRKDIR}/${PORTNAME} ${WRKSRC} post-install: ${CP} -pRP ${WRKSRC}/ ${PREFIX}/mediaproxy ${CHOWN} -R 0:0 ${PREFIX}/mediaproxy -.include <bsd.port.post.mk> +.include <bsd.port.mk> diff -urN mediaproxy.orig/files/mediaproxy.in mediaproxy/files/mediaproxy.in --- mediaproxy.orig/files/mediaproxy.in 1970-01-01 01:00:00.000000000 +0100 +++ mediaproxy/files/mediaproxy.in 2007-08-13 09:56:21.000000000 +0200 @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: mediaproxy +# BEFORE: proxydispatcher openser ser +# +prefix=%%PREFIX%% + +# Add the following lines to /etc/rc.conf to enable mediaproxy: +# +# mediaproxy_enable="YES" + +. %%RC_SUBR%% + +name="mediaproxy" +rcvar=`set_rcvar` +command="${prefix}/bin/python" +command_args="${prefix}/mediaproxy/mediaproxy.py" +pidfile=${mediaproxy_pidfile:-"/var/run/mediaproxy.pid"} +sig_stop="KILL" + +load_rc_config $name + +: ${mediaproxy_enable="NO"} + +stop_postcmd=stop_postcmd + +stop_postcmd() +{ + rm -f $pidfile +} + +run_rc_command "$1" diff -urN mediaproxy.orig/files/mediaproxy.sh.in mediaproxy/files/mediaproxy.sh.in --- mediaproxy.orig/files/mediaproxy.sh.in 2006-09-28 00:05:43.000000000 +0200 +++ mediaproxy/files/mediaproxy.sh.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,86 +0,0 @@ -#!/bin/sh -# -# mediaproxy starts and stops the SER MediaProxy server - -# PROVIDE: mediaproxy - -# Add the following line to /etc/rc.conf to enable mysql: -# mediaproxy_enable (bool): Set to "NO" by default. -# Set it to "YES" to enable mediaproxy. - -. /etc/rc.subr - -name="mediaproxy" -rcvar=`set_rcvar` - -load_rc_config $name - -: ${mediaproxy_enable="NO"} - -INSTALL_DIR="%%PREFIX%%" -RUNTIME_DIR="/var/run" - -PROXY="$INSTALL_DIR/mediaproxy/mediaproxy.py" -DISPATCHER="$INSTALL_DIR/mediaproxy/proxydispatcher.py" -PROXY_PID="$RUNTIME_DIR/mediaproxy.pid" -DISPATCHER_PID="$RUNTIME_DIR/proxydispatcher.pid" - -# Options for mediaproxy and dispatcher. Do not include --pid <pidfile> -# --pid <pidfile> will be added automatically if needed. -PROXY_OPTIONS="" -DISPATCHER_OPTIONS="" - -NAME="mediaproxy" -DESC="SER MediaProxy server" - -echo $PROXY -test -f $PROXY || exit 0 -test -f $DISPATCHER || exit 0 - -if [ "$PROXY_PID" != "/var/run/mediaproxy.pid" ]; then - PROXY_OPTIONS="--pid $PROXY_PID $PROXY_OPTIONS" -fi -if [ "$DISPATCHER_PID" != "/var/run/proxydispatcher.pid" ]; then - DISPATCHER_OPTIONS="--pid $DISPATCHER_PID $DISPATCHER_OPTIONS" -fi - -start() { - if [ $mediaproxy_enable = "YES" ]; then - echo -n "Starting $DESC: $NAME" - $PROXY $PROXY_OPTIONS - $DISPATCHER $DISPATCHER_OPTIONS - echo "." - fi -} - -stop () { - echo -n "Stopping $DESC: $NAME" - if [ -f $PROXY_PID ]; then - kill `cat $PROXY_PID` - fi - if [ -f $DISPATCHER_PID ]; then - kill `cat $DISPATCHER_PID` - fi - echo "." -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|force-reload) - stop - #sleep 1 - start - ;; - *) - echo "Usage: ${INSTALL_DIR}/etc/rc.d/$NAME {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 - diff -urN mediaproxy.orig/files/proxydispatcher.in mediaproxy/files/proxydispatcher.in --- mediaproxy.orig/files/proxydispatcher.in 1970-01-01 01:00:00.000000000 +0100 +++ mediaproxy/files/proxydispatcher.in 2007-08-13 09:56:21.000000000 +0200 @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: proxydispatcher +# BEFORE: openser ser +# +prefix=%%PREFIX%% + +# Add the following lines to /etc/rc.conf to enable proxydispatcher: +# +# proxydispatcher_enable="YES" + +. %%RC_SUBR%% + +name="proxydispatcher" +rcvar=`set_rcvar` +command="${prefix}/bin/python" +command_args="${prefix}/mediaproxy/proxydispatcher.py" +pidfile=${proxydispatcher_pidfile:-"/var/run/proxydispatcher.pid"} +sig_stop="KILL" + +load_rc_config $name + +: ${proxydispatcher_enable="NO"} + +stop_postcmd=stop_postcmd + +stop_postcmd() +{ + rm -f $pidfile +} + +run_rc_command "$1" diff -urN mediaproxy.orig/pkg-plist mediaproxy/pkg-plist --- mediaproxy.orig/pkg-plist 2007-06-01 09:27:12.000000000 +0200 +++ mediaproxy/pkg-plist 2007-08-13 10:07:52.000000000 +0200 @@ -195,6 +195,9 @@ mediaproxy/web/images/40/zoep.png mediaproxy/web/images/40/zyxel-p2000.png mediaproxy/web/media_sessions.phtml +@unexec rm -f %D/mediaproxy/modules/external/DNS/*.pyc +@unexec rm -f %D/mediaproxy/modules/external/*.pyc +@unexec rm -f %D/mediaproxy/modules/*.pyc @dirrm mediaproxy/web/images/40 @dirrm mediaproxy/web/images/35 @dirrm mediaproxy/web/images/30 >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070813082012.6C203307841>