summaryrefslogtreecommitdiff
path: root/community/ziproxy
diff options
context:
space:
mode:
Diffstat (limited to 'community/ziproxy')
-rw-r--r--community/ziproxy/PKGBUILD60
-rw-r--r--community/ziproxy/build-fix.patch23
-rw-r--r--community/ziproxy/ziproxy.install11
-rw-r--r--community/ziproxy/ziproxy.logrotate13
-rw-r--r--community/ziproxy/ziproxy.xinetd14
5 files changed, 121 insertions, 0 deletions
diff --git a/community/ziproxy/PKGBUILD b/community/ziproxy/PKGBUILD
new file mode 100644
index 000000000..a9003f6dc
--- /dev/null
+++ b/community/ziproxy/PKGBUILD
@@ -0,0 +1,60 @@
+# $Id: PKGBUILD 102371 2013-12-09 14:56:17Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Yejun Yang yejunx AT gmail DOT com
+
+pkgname=ziproxy
+pkgver=3.3.0
+pkgrel=4
+pkgdesc="forwarding, non-caching, compressing HTTP proxy server"
+arch=('i686' 'x86_64')
+url="http://ziproxy.sourceforge.net/"
+license=('GPL2')
+depends=('giflib' 'libpng' 'libjpeg' 'zlib' 'jasper' 'libsasl')
+backup=(etc/ziproxy/ziproxy.conf
+ etc/ziproxy/bo_exception.list
+ etc/ziproxy/http.passwd
+ etc/ziproxy/noprocess.list
+ etc/ziproxy/replace.list
+ etc/xinetd.d/ziproxy
+ var/lib/ziproxy/error/400.html
+ var/lib/ziproxy/error/404.html
+ var/lib/ziproxy/error/407.html
+ var/lib/ziproxy/error/408.html
+ var/lib/ziproxy/error/409.html
+ var/lib/ziproxy/error/500.html
+ var/lib/ziproxy/error/503.html)
+install=ziproxy.install
+source=(http://downloads.sourceforge.net/project/ziproxy/ziproxy/ziproxy-$pkgver/ziproxy-$pkgver.tar.bz2
+ ziproxy.logrotate
+ ziproxy.xinetd
+ build-fix.patch)
+md5sums=('a8fda01591d455bb23c64c9c5ed3980d'
+ 'feb35264391c790cedd5e995182b5ff5'
+ '3d2f9208b5ab6738c136049e1fd2e433'
+ '0eb798863234ee0e9066812ef2a73539')
+
+prepare() {
+ cd $srcdir/$pkgname-$pkgver
+ patch -p1 <$srcdir/build-fix.patch
+}
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+ [ -f Makefile ] || ./configure --prefix=/usr --with-jasper
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install
+
+ install -d $pkgdir/var/lib/ziproxy/error
+ install -d $pkgdir/etc/conf.d
+
+ sed -i 's#var/ziproxy#var/lib/ziproxy#' etc/ziproxy/ziproxy.conf
+ cp -a etc/ziproxy $pkgdir/etc/ziproxy
+ install -m644 var/ziproxy/error/* $pkgdir/var/lib/ziproxy/error
+ echo "ZIPROXY_ARGS=\"-c /etc/ziproxy/ziproxy.conf\"" >$pkgdir/etc/conf.d/ziproxy
+ install -Dm0644 $srcdir/ziproxy.logrotate $pkgdir/etc/logrotate.d/ziproxy
+ install -Dm0644 $srcdir/ziproxy.xinetd $pkgdir/etc/xinetd.d/ziproxy
+}
diff --git a/community/ziproxy/build-fix.patch b/community/ziproxy/build-fix.patch
new file mode 100644
index 000000000..fb23953b6
--- /dev/null
+++ b/community/ziproxy/build-fix.patch
@@ -0,0 +1,23 @@
+diff -wbBur ziproxy-3.3.0/src/image.c ziproxy-3.3.0.q/src/image.c
+--- ziproxy-3.3.0/src/image.c 2013-01-04 20:48:50.000000000 +0400
++++ ziproxy-3.3.0.q/src/image.c 2013-08-11 00:24:03.868670477 +0400
+@@ -93,6 +93,10 @@
+ #define MIN_INSIZE_TO_JPEG 600
+ #define MIN_INSIZE_TO_JP2K 800
+
++
++#define false 0
++#define true !!0
++
+ //Forwards. There are more utility functions, but they're used only once.
+ static raw_bitmap *new_raw_bitmap();
+
+@@ -905,7 +909,7 @@
+ desc.size=insize;
+ desc.x.pos=0;
+
+- if ((GifFile = DGifOpen((void*)&desc, &gif_mem_input)) == NULL)
++ if ((GifFile = DGifOpen((void*)&desc, &gif_mem_input, NULL)) == NULL)
+ return( IMG_RET_ERR_UNKNOWN + IMG_RET_FLG_WHILE_DECOMP);//more possible reasons
+
+ bmp = new_raw_bitmap();
diff --git a/community/ziproxy/ziproxy.install b/community/ziproxy/ziproxy.install
new file mode 100644
index 000000000..0f2e7a23f
--- /dev/null
+++ b/community/ziproxy/ziproxy.install
@@ -0,0 +1,11 @@
+post_install() {
+ mkdir -p /var/log/ziproxy && \
+ chown -R root:proxy /var/log/ziproxy && \
+ chmod -R ug+w /var/log/ziproxy
+}
+
+post_upgrade() {
+ mkdir -p /var/log/ziproxy && \
+ chown -R root:proxy /var/log/ziproxy && \
+ chmod -R ug+w /var/log/ziproxy
+}
diff --git a/community/ziproxy/ziproxy.logrotate b/community/ziproxy/ziproxy.logrotate
new file mode 100644
index 000000000..7cadf5e71
--- /dev/null
+++ b/community/ziproxy/ziproxy.logrotate
@@ -0,0 +1,13 @@
+/var/log/ziproxy/access.log {
+ su root proxy
+ weekly
+ missingok
+ rotate 10
+ compress
+ delaycompress
+ ifempty
+ nomail
+ postrotate
+ killall -HUP ziproxy 1>/dev/null 2>/dev/null || true
+ endscript
+}
diff --git a/community/ziproxy/ziproxy.xinetd b/community/ziproxy/ziproxy.xinetd
new file mode 100644
index 000000000..195b72454
--- /dev/null
+++ b/community/ziproxy/ziproxy.xinetd
@@ -0,0 +1,14 @@
+service ziproxy
+{
+ port = 3128
+ type = UNLISTED
+ disable = yes
+ socket_type = stream
+ wait = no
+ user = proxy
+ server = /usr/bin/ziproxy
+ server_args = -i
+ bind = 0.0.0.0
+ log_on_success += HOST DURATION
+ log_on_failure += HOST
+}