initial import
This commit is contained in:
86
privoxy/PKGBUILD
Normal file
86
privoxy/PKGBUILD
Normal file
@@ -0,0 +1,86 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=privoxy
|
||||
pkgver=3.0.34
|
||||
_debver=$pkgver
|
||||
_debrel=1
|
||||
pkgrel=1
|
||||
pkgdesc="Web proxy with advanced filtering capabilities"
|
||||
arch=('i686' 'x86_64')
|
||||
url='https://www.privoxy.org/'
|
||||
license=('GPL-2' 'ISC')
|
||||
depends=('pcre' 'zlib')
|
||||
makedepends=('autoconf' 'quilt')
|
||||
install='privoxy.install'
|
||||
backup=('etc/privoxy/'{config,trust,match-all.action,{default,user}.{action,filter}}
|
||||
'etc/logrotate.d/privoxy')
|
||||
source=("https://downloads.sourceforge.net/ijbswa/${pkgname}-${pkgver}-stable-src.tar.gz"
|
||||
"https://deb.debian.org/debian/pool/main/p/$pkgname/${pkgname}_${_debver}-${_debrel}.debian.tar.xz"
|
||||
"$pkgname.logrotate.d"
|
||||
"$pkgname.initd"
|
||||
"$pkgname.run")
|
||||
sha512sums=('f963419ae2cb6dd72cd892fa043768d99a4118792833de2e666d6a800fbe9a7fcb0641f15e3211e0b01a74609c65aeb60af1051f1a19daa1048314599679b685'
|
||||
'7024eae35f3026c8c8fbe13a42968a26bd7847d0bce30ea9d6154ea995835936aa606cd5080c33a5f7f50c19cd9f47457e1c37e6b0368b649cf29f456ce2d82b'
|
||||
'ca2cb0f06b723386166a916404f021f05544f96a359d94bac6e13c35da06216dde9d873fe4211e6bc267927aefbed0d812db1eb7901781a0f9c3afbf69a87b81'
|
||||
'43e9cd8c11a309d975bdc8e0cc644c0738e7c135629b364b04d0c5f7eef400e65e87cb7fe3848117166c38745b809ed4b848259987bf8ef56403cab0978c7b6c'
|
||||
'18299bef7311ab5cfc5c76eb7ac0142d95d34d2ef6b8ac6e62b9fdb1420d830487489097915bfa1ea6b2d33b5fb7a7f75d8cf7344bbf3d0f52f3672c9ab4407a')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}-stable"
|
||||
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
# Doesn't apply
|
||||
rm -v debian/patches/14_config.patch || true
|
||||
rm -v debian/patches/34_system-docbook2man.patch || true
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}-stable"
|
||||
|
||||
autoheader
|
||||
autoconf
|
||||
./configure --prefix=/usr \
|
||||
--sysconfdir=/etc/privoxy \
|
||||
--enable-compression
|
||||
make
|
||||
sed -i '
|
||||
s+^confdir \.+confdir /etc/privoxy+
|
||||
s+^logdir \.+logdir /var/log/privoxy+
|
||||
s+^#\?user-manual .*+user-manual /usr/share/doc/privoxy/user-manual/+' config
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}-stable"
|
||||
|
||||
install -Dm755 "$srcdir/privoxy.run" "${pkgdir}/etc/sv/privoxy/run"
|
||||
install -Dm755 "$srcdir/privoxy.initd" "$pkgdir/etc/init.d/privoxy"
|
||||
install -Dm644 "$srcdir/privoxy.logrotate.d" "$pkgdir/etc/logrotate.d/privoxy"
|
||||
|
||||
install -Dm755 {,"$pkgdir"/usr/sbin/}privoxy
|
||||
install -Dm644 {,"$pkgdir"/usr/share/man/man8/}privoxy.8
|
||||
install -d -o42 -g42 "$pkgdir"/var/log/privoxy
|
||||
|
||||
install -d "$pkgdir"/etc/privoxy/
|
||||
install -m644 config trust *.{action,filter} "$pkgdir"/etc/privoxy/ # -m0660 upstream
|
||||
find templates -type f -exec install -Dm644 '{}' "$pkgdir"/etc/privoxy/'{}' \;
|
||||
|
||||
(d="$pkgdir"/usr/share/doc/privoxy
|
||||
cd doc/webserver
|
||||
install -Dm644 {privoxy-,"$d"/}index.html
|
||||
install -m644 p_doc.css ../../{AUTHORS,README,ChangeLog} "$d"/
|
||||
install -Dm644 {,"$d"/user-manual/}p_doc.css
|
||||
find user-manual developer-manual faq man-page \( -name '*.html' -o -name '*.jpg' \) \
|
||||
-exec install -Dm644 '{}' "$d"/'{}' \;)
|
||||
|
||||
install -Dm644 debian/copyright LICENSE -t $pkgdir/usr/share/licenses/$pkgname
|
||||
}
|
||||
34
privoxy/privoxy.initd
Normal file
34
privoxy/privoxy.initd
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 2021 Hyperbola Project
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
description="Privoxy service"
|
||||
|
||||
command_background="yes"
|
||||
pidfile="/var/run/privoxy.pid"
|
||||
conffile="/etc/privoxy/config"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start() {
|
||||
if [ ! -f "${conffile}" ]; then
|
||||
eerror "Configuration file ${conffile} not found!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ebegin "Starting privoxy"
|
||||
start-stop-daemon --start --quiet --exec /usr/sbin/privoxy \
|
||||
--pidfile "${pidfile}" \
|
||||
-- \
|
||||
--pidfile "${pidfile}" \
|
||||
--user privoxy.privoxy "${conffile}"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping privoxy"
|
||||
start-stop-daemon --stop --quiet --pidfile "${pidfile}"
|
||||
eend $?
|
||||
}
|
||||
33
privoxy/privoxy.install
Normal file
33
privoxy/privoxy.install
Normal file
@@ -0,0 +1,33 @@
|
||||
post_install() {
|
||||
if ! getent group privoxy &>/dev/null; then
|
||||
groupadd -g 42 privoxy >/dev/null
|
||||
fi
|
||||
if ! getent passwd privoxy &>/dev/null; then
|
||||
useradd -c "Privoxy" -u 42 -g privoxy -G adm -d /var/spool/privoxy -s /bin/nologin privoxy >/dev/null
|
||||
fi
|
||||
chown -R privoxy:privoxy /etc/privoxy /var/log/privoxy
|
||||
if [ ! -d /var/spool/privoxy ]; then
|
||||
install -dm0770 -o privoxy -g privoxy /var/spool/privoxy
|
||||
fi
|
||||
if ! groups privoxy | grep adm &>/dev/null; then
|
||||
gpasswd -a privoxy adm >/dev/null
|
||||
fi
|
||||
privoxy_shell=$(getent passwd privoxy | cut -d: -f7)
|
||||
if [ "$privoxy_shell" != '/bin/nologin' ]; then
|
||||
chsh -s /bin/nologin privoxy &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
if getent passwd privoxy &>/dev/null; then
|
||||
userdel privoxy >/dev/null
|
||||
fi
|
||||
if getent group privoxy &>/dev/null; then
|
||||
groupdel privoxy >/dev/null
|
||||
fi
|
||||
rm -rf var/spool/privoxy
|
||||
}
|
||||
9
privoxy/privoxy.logrotate.d
Normal file
9
privoxy/privoxy.logrotate.d
Normal file
@@ -0,0 +1,9 @@
|
||||
/var/log/privoxy/logfile {
|
||||
missingok
|
||||
create 660 root privoxy
|
||||
notifempty
|
||||
compress
|
||||
postrotate
|
||||
/bin/kill -HUP `cat /var/run/privoxy.pid 2>/dev/null` 2> /dev/null || true
|
||||
endscript
|
||||
}
|
||||
2
privoxy/privoxy.run
Normal file
2
privoxy/privoxy.run
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec chpst -U privoxy:privoxy /usr/sbin/privoxy --no-daemon /etc/privoxy/config 2>&1
|
||||
Reference in New Issue
Block a user