aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorIon-Mihai Tetcu <itetcu@FreeBSD.org>2006-05-16 20:29:42 +0800
committerIon-Mihai Tetcu <itetcu@FreeBSD.org>2006-05-16 20:29:42 +0800
commit8b0082350ef0c0f2950e289db162755c7ca7cacc (patch)
tree36266c2c6e2eff62bd0bfc5f4ed37532c0151af1 /www
parent281ee3ce83593ca464778684c1a4b2f70397f994 (diff)
downloadfreebsd-ports-gnome-8b0082350ef0c0f2950e289db162755c7ca7cacc.tar.gz
freebsd-ports-gnome-8b0082350ef0c0f2950e289db162755c7ca7cacc.tar.zst
freebsd-ports-gnome-8b0082350ef0c0f2950e289db162755c7ca7cacc.zip
- Now users an rcNG script.
- Removes the (now) un-necessary pkg-message. - Moves the configuration file to ${PREFIX}/etc/tinyproxy.conf - bump PORTREVISION for above - Pass maintainership to submiter. Tinyproxy now installs a rcNG script. To enable tinyproxy at boot time, set the following in rc.conf(5): tinyproxy_enable="YES" The confiration file for tinyproxy has been moved to ${PREFIX}/etc/tinyproxy.conf. Any old configuration files will need to be migrated over to the new location. PR: ports/96720 Submitted by: Wesley Shields <wxs@csh.rit.edu> (new maintainer) Approved by: lawrance (mentor)
Diffstat (limited to 'www')
-rw-r--r--www/tinyproxy/Makefile15
-rw-r--r--www/tinyproxy/files/tinyproxy.sh14
-rw-r--r--www/tinyproxy/files/tinyproxy.sh.in26
-rw-r--r--www/tinyproxy/pkg-message4
-rw-r--r--www/tinyproxy/pkg-plist6
5 files changed, 38 insertions, 27 deletions
diff --git a/www/tinyproxy/Makefile b/www/tinyproxy/Makefile
index aa15d6486fda..c795fe45e305 100644
--- a/www/tinyproxy/Makefile
+++ b/www/tinyproxy/Makefile
@@ -7,17 +7,19 @@
PORTNAME= tinyproxy
PORTVERSION= 1.7.0
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= wxs@csh.rit.edu
COMMENT= A small, efficient HTTP proxy server
+USE_RC_SUBR= tinyproxy.sh
GNU_CONFIGURE= yes
USE_GMAKE= yes
CONFIGURE_ARGS= --bindir=${PREFIX}/sbin \
- --with-config=${PREFIX}/etc/tinyproxy/tinyproxy.conf \
+ --with-config=${PREFIX}/etc/tinyproxy.conf \
--program-transform-name=""
MAN8= tinyproxy.8
@@ -26,15 +28,16 @@ MAN8= tinyproxy.8
post-patch:
@${REINPLACE_CMD} -e 's|-O2||' ${WRKSRC}/configure
- @${REINPLACE_CMD} -e 's|/\(etc/tinyproxy/tinyproxy.conf\)|${PREFIX}/\1|' \
+ @${REINPLACE_CMD} -e 's|/etc/tinyproxy/tinyproxy.conf|${PREFIX}/etc/tinyproxy.conf|' \
${WRKSRC}/doc/tinyproxy.8
.if ${OSVERSION} < 500000
@${REINPLACE_CMD} -e 's|stdint.h|stdlib.h|' ${WRKSRC}/src/scanner.c
.endif
post-install:
- @${SED} -e "s#%PREFIX%#${PREFIX}#" ${FILESDIR}/tinyproxy.sh > ${WRKDIR}/tinyproxy.sh
- @${INSTALL_SCRIPT} ${WRKDIR}/tinyproxy.sh ${LOCALBASE}/etc/rc.d
- @${SED} -e "s#/usr/local/#${LOCALBASE}/#" ${PKGMESSAGE}
+ @if [ ! -f ${PREFIX}/etc/tinyproxy.conf ]; then \
+ ${CP} -p ${PREFIX}/etc/tinyproxy.conf-dist \
+ ${PREFIX}/etc/tinyproxy.conf ; \
+ fi
.include <bsd.port.post.mk>
diff --git a/www/tinyproxy/files/tinyproxy.sh b/www/tinyproxy/files/tinyproxy.sh
deleted file mode 100644
index ba15fe4c4e2c..000000000000
--- a/www/tinyproxy/files/tinyproxy.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-if [ $# -eq 0 -o x$1 = xstart ]; then
- if [ -x %PREFIX%/sbin/tinyproxy ]; then
- %PREFIX%/sbin/tinyproxy && echo ' tinyproxy'
- fi
-fi
-if [ x$1 = xstop ]; then
- if [ -f /var/run/tinyproxy.pid ]; then
- kill `cat /var/run/tinyproxy.pid`
- else
- # oh well
- killall tinyproxy
- fi
-fi
diff --git a/www/tinyproxy/files/tinyproxy.sh.in b/www/tinyproxy/files/tinyproxy.sh.in
new file mode 100644
index 000000000000..def2f6e858a7
--- /dev/null
+++ b/www/tinyproxy/files/tinyproxy.sh.in
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# PROVIDE: tinyproxy
+# REQUIRE: LOGIN
+
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable tinyproxy:
+# tinyproxy_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable tinyproxy
+# tinyproxy_config (path): Set to "%%PREFIX%%/etc/tinyproxy.conf" by default.
+#
+
+. %%RC_SUBR%%
+
+name="tinyproxy"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${tinyproxy_enable="NO"}
+: ${tinyproxy_config="%%PREFIX%%/etc/tinyproxy.conf"}
+
+command=%%PREFIX%%/sbin/tinyproxy
+command_args="-c $tinyproxy_config 2> /dev/null"
+
+run_rc_command "$1"
diff --git a/www/tinyproxy/pkg-message b/www/tinyproxy/pkg-message
deleted file mode 100644
index d9d64b5ee0a6..000000000000
--- a/www/tinyproxy/pkg-message
+++ /dev/null
@@ -1,4 +0,0 @@
-You may then start the server by running:
-
- /usr/local/etc/rc.d/tinyproxy.sh start
-
diff --git a/www/tinyproxy/pkg-plist b/www/tinyproxy/pkg-plist
index 157256fa9dd7..0d60bcea9692 100644
--- a/www/tinyproxy/pkg-plist
+++ b/www/tinyproxy/pkg-plist
@@ -1,5 +1,6 @@
-etc/rc.d/tinyproxy.sh
-etc/tinyproxy/tinyproxy.conf-dist
+@unexec if cmp -s %D/etc/tinyproxy.conf-dist %D/etc/tinyproxy.conf; then rm -f %D/etc/tinyproxy.conf; fi
+etc/tinyproxy.conf-dist
+@exec if [ ! -f %D/etc/tinyproxy.conf ] ; then cp -p %D/%F %B/tinyproxy.conf; fi
sbin/tinyproxy
%%DATADIR%%/HTML_VARIABLES
%%DATADIR%%/debug.html
@@ -9,4 +10,3 @@ sbin/tinyproxy
%%DATADIR%%/stats.html
%%DATADIR%%/stats.html.dist
@dirrm %%DATADIR%%
-@dirrm etc/tinyproxy