diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2009-05-10 22:25:34 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2009-05-10 22:25:34 +0000 |
commit | ee6b29827d2511dae2637e643ea267b0f2ef9569 (patch) | |
tree | 44f5bdfa5adb0488fab4f3f39e7b833e27a11872 /www/videocache | |
parent | 32b8b31484f60ac549019bdc3b329575be946f3e (diff) | |
download | ports-ee6b29827d2511dae2637e643ea267b0f2ef9569.tar.gz ports-ee6b29827d2511dae2637e643ea267b0f2ef9569.zip |
Notes
Diffstat (limited to 'www/videocache')
-rw-r--r-- | www/videocache/Makefile | 54 | ||||
-rw-r--r-- | www/videocache/distinfo | 3 | ||||
-rw-r--r-- | www/videocache/files/pkg-message.in | 3 | ||||
-rw-r--r-- | www/videocache/files/squid.conf.example | 32 | ||||
-rw-r--r-- | www/videocache/pkg-descr | 7 | ||||
-rw-r--r-- | www/videocache/pkg-plist | 11 |
6 files changed, 110 insertions, 0 deletions
diff --git a/www/videocache/Makefile b/www/videocache/Makefile new file mode 100644 index 000000000000..c59c75930f2f --- /dev/null +++ b/www/videocache/Makefile @@ -0,0 +1,54 @@ +# New ports collection makefile for: videocache +# Date created: 2009-04-30 +# Whom: Murilo Opsfelder <mopsfelder@gmail.com> +# +# $FreeBSD$ +# + +PORTNAME= videocache +PORTVERSION= 1.9.1 +CATEGORIES= www +MASTER_SITES= http://cachevideos.com/sites/default/files/pub/videocache/ + +MAINTAINER= mopsfelder@gmail.com +COMMENT= A Squid URL rewriter for bandwidth optimization + +RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid \ + ${PYTHON_SITELIBDIR}/urlgrabber/grabber.py:${PORTSDIR}/www/py-urlgrabber \ + ${PYTHON_SITELIBDIR}/iniparse/ini.py:${PORTSDIR}/devel/py-iniparse + +NO_BUILD= yes +USE_PYTHON= yes + +MAN8= videocache.8.gz +PORTDOCS= CHANGELOG COPYING Readme +PORTEXAMPLES= squid.conf +SUB_FILES= pkg-message + +.include <bsd.port.pre.mk> + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/update-vc ${PREFIX}/bin + ${INSTALL_MAN} ${WRKSRC}/videocache.8.gz ${MAN1PREFIX}/man/man8 + ${INSTALL_DATA} ${WRKSRC}/videocache-sysconfig.conf ${PREFIX}/etc/videocache.conf.default + @[ -f ${PREFIX}/etc/videocache.conf ] || \ + ${CP} -v ${PREFIX}/etc/videocache.conf.default ${PREFIX}/etc/videocache.conf + ${MKDIR} ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/videocache/*.py ${DATADIR} +.if !defined(NOPORTEXAMPLES) + ${MKDIR} ${EXAMPLESDIR} + ${INSTALL_DATA} ${FILESDIR}/squid.conf.example ${EXAMPLESDIR}/squid.conf +.endif +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} +. for doc in ${PORTDOCS} + ${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR} +. endfor +.endif + +post-install: +.if !defined(NOPORTEXAMPLES) + ${CAT} ${PKGMESSAGE} +.endif + +.include <bsd.port.post.mk> diff --git a/www/videocache/distinfo b/www/videocache/distinfo new file mode 100644 index 000000000000..37b2e6f68ca8 --- /dev/null +++ b/www/videocache/distinfo @@ -0,0 +1,3 @@ +MD5 (videocache-1.9.1.tar.gz) = 0dac8dd20d67c252e1da13e1e9ad5cd5 +SHA256 (videocache-1.9.1.tar.gz) = b814c6dec236c842dda1258be142556874ca4c33247a83e11609bfa6bb10cf8b +SIZE (videocache-1.9.1.tar.gz) = 52631 diff --git a/www/videocache/files/pkg-message.in b/www/videocache/files/pkg-message.in new file mode 100644 index 000000000000..391fca09d838 --- /dev/null +++ b/www/videocache/files/pkg-message.in @@ -0,0 +1,3 @@ +See the following sample file to configure your ACL's on squid.conf: + + %%EXAMPLESDIR%%/squid.conf diff --git a/www/videocache/files/squid.conf.example b/www/videocache/files/squid.conf.example new file mode 100644 index 000000000000..163ac52ed6e8 --- /dev/null +++ b/www/videocache/files/squid.conf.example @@ -0,0 +1,32 @@ +============================================================================== + +Add the following sample lines to your squid.conf: + +# --BEGIN-- videocache config for squid +url_rewrite_program %%PREFIX%%/bin/python %%DATADIR%%/videocache/videocache.py +url_rewrite_children 7 +acl videocache_allow_url url_regex -i \.youtube\.com\/get_video\? +acl videocache_allow_url url_regex -i \.googlevideo\.com\/videoplayback \.googlevideo\.com\/videoplay \.googlevideo\.com\/get_video\? +acl videocache_allow_url url_regex -i \.google\.com\/videoplayback \.google\.com\/videoplay \.google\.com\/get_video\? +acl videocache_allow_url url_regex -i \.google\.[a-z][a-z]\/videoplayback \.google\.[a-z][a-z]\/videoplay \.google\.[a-z][a-z]\/get_video\? +acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/videoplayback\? +acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/videoplay\? +acl videocache_allow_url url_regex -i (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/get_video\? +acl videocache_allow_url url_regex -i proxy[a-z0-9\-][a-z0-9][a-z0-9][a-z0-9]?\.dailymotion\.com\/ +acl videocache_allow_url url_regex -i vid\.akm\.dailymotion\.com\/ +acl videocache_allow_url url_regex -i [a-z0-9][0-9a-z][0-9a-z]?[0-9a-z]?[0-9a-z]?\.xtube\.com\/(.*)flv +acl videocache_allow_url url_regex -i bitcast\.vimeo\.com\/vimeo\/videos\/ +acl videocache_allow_url url_regex -i va\.wrzuta\.pl\/wa[0-9][0-9][0-9][0-9]? +acl videocache_allow_url url_regex -i \.files\.youporn\.com\/(.*)\/flv\/ +acl videocache_allow_url url_regex -i \.msn\.com\.edgesuite\.net\/(.*)\.flv +acl videocache_allow_url url_regex -i media[a-z0-9]?[a-z0-9]?[a-z0-9]?\.tube8\.com\/ mobile[a-z0-9]?[a-z0-9]?[a-z0-9]?\.ta-z0-9]?[a-z0-9]?\.blip\.tv\/(.*)\.(flv|avi|mov|mp3|m4v|mp4|wmv|rm|ram) +acl videocache_allow_url url_regex -i video\.break\.com\/(.*)\.(flv|mp4) +acl videocache_allow_dom dstdomain .mccont.com dl.redtube.com .cdn.dailymotion.com +acl videocache_deny_url url_regex -i http:\/\/[a-z][a-z]\.youtube\.com http:\/\/www\.youtube\.com +url_rewrite_access deny videocache_deny_url +url_rewrite_access allow videocache_allow_url +url_rewrite_access allow videocache_allow_dom +redirector_bypass on +# --END-- videocache config for squid + +============================================================================== diff --git a/www/videocache/pkg-descr b/www/videocache/pkg-descr new file mode 100644 index 000000000000..3d63e8ce932c --- /dev/null +++ b/www/videocache/pkg-descr @@ -0,0 +1,7 @@ +Videocache is a Squid URL rewriter plugin written in Python +for bandwidth optimization while browsing famous video +sharing portals/websites like Youtube, Metacafe etc. +It helps you save bandwidth when a particular video is +requested more than once from the same network/machine. + +WWW: http://www.cachevideos.com/ diff --git a/www/videocache/pkg-plist b/www/videocache/pkg-plist new file mode 100644 index 000000000000..f350dc53d07b --- /dev/null +++ b/www/videocache/pkg-plist @@ -0,0 +1,11 @@ +@comment $FreeBSD$ +bin/update-vc +@unexec if cmp -s %D/etc/videocache.conf %D/etc/videocache.conf.default; then rm -f %D/etc/videocache.conf; fi +etc/videocache.conf.default +@exec [ -f %B/videocache.conf ] || cp %B/%f %B/videocache.conf +%%DATADIR%%/Errors.py +%%DATADIR%%/__init__.py +%%DATADIR%%/config.py +%%DATADIR%%/parser.py +%%DATADIR%%/videocache.py +@dirrm %%DATADIR%% |