summaryrefslogtreecommitdiff
path: root/community/polipo
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2014-04-12 03:59:45 +0000
committerNicolás Reynolds <fauno@endefensadelsl.org>2014-04-12 03:59:45 +0000
commitd8679f0250762892ab1e1a6d71badc2e9d42a526 (patch)
tree2c5893ffb5a88532e043973210221d10ce07f808 /community/polipo
parent10cc2a54e50ad4aeffd7152937670c8673a096f9 (diff)
Sat Apr 12 03:57:05 UTC 2014
Diffstat (limited to 'community/polipo')
-rw-r--r--community/polipo/PKGBUILD27
-rw-r--r--community/polipo/polipo.conf.d4
-rw-r--r--community/polipo/polipo.install32
-rw-r--r--community/polipo/polipo.service6
4 files changed, 45 insertions, 24 deletions
diff --git a/community/polipo/PKGBUILD b/community/polipo/PKGBUILD
index 144e4fe19..9b1ebc1d6 100644
--- a/community/polipo/PKGBUILD
+++ b/community/polipo/PKGBUILD
@@ -1,13 +1,14 @@
-# $Id: PKGBUILD 90446 2013-05-12 13:12:12Z jelle $
+# $Id: PKGBUILD 109185 2014-04-11 06:07:08Z thestinger $
# Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de>
# Contributor: Jelle van der Waa <jelle vdwaa nl>
+# Contributor: Daniel Micay <danielmicay@gmail.com>
# Contributor: Thomas Holmquist <thomas@vorget.com>
# Contributor: Jan Boehringer <ja(a)bm-boehringer.de>
# Contributor: Alex Griffin <griffin.aj(a)gmail.com>
pkgname=polipo
pkgver=1.0.4.1
-pkgrel=10
+pkgrel=12
pkgdesc="A small and fast caching web proxy."
arch=('i686' 'x86_64')
url="http://www.pps.jussieu.fr/~jch/software/polipo/"
@@ -16,14 +17,12 @@ depends=('bash')
makedepends=('texinfo')
install=polipo.install
source=("http://freehaven.net/~chrisd/polipo/polipo-$pkgver.tar.gz"
- "polipo.conf.d" "polipo.service")
+ polipo.service)
md5sums=('bfc5c85289519658280e093a270d6703'
- '685aa0c6070dee11c701932d23afcc6a'
- '143ef45db99dc745b6c3a606847be9fe')
+ '3861a067f6cdd2b8afcee1de97678902')
build() {
cd "$srcdir/$pkgname-$pkgver"
-
make
}
@@ -34,19 +33,19 @@ package() {
INFODIR="$pkgdir/usr/share/info" \
LOCAL_ROOT="$pkgdir/usr/share/polipo/www" \
DISK_CACHE_ROOT="$pkgdir/var/cache/polipo" \
- install
-
+ install
# install config files
- install -Dm 644 config.sample $pkgdir/etc/polipo/config.sample
- install -Dm 644 forbidden.sample $pkgdir/etc/polipo/forbidden.sample
+ install -Dm 644 config.sample "$pkgdir/etc/polipo/config.sample"
+ install -Dm 644 forbidden.sample "$pkgdir/etc/polipo/forbidden.sample"
# install license
- install -Dm644 COPYING $pkgdir/usr/share/licenses/polipo/LICENSE
+ install -Dm644 COPYING "$pkgdir/usr/share/licenses/polipo/LICENSE"
+
+ # install systemd service
+ install -Dm 644 "$srcdir/polipo.service" "$pkgdir/usr/lib/systemd/system/polipo.service"
- # install systemd service / cron
- install -Dm 644 $srcdir/polipo.service $pkgdir/usr/lib/systemd/system/polipo.service
- install -Dm 644 $srcdir/polipo.conf.d $pkgdir/etc/conf.d/polipo.conf
+ install -dm 700 -o 185 -g 185 "$pkgdir/var/cache/polipo"
}
# vim:set ts=2 sw=2 et:
diff --git a/community/polipo/polipo.conf.d b/community/polipo/polipo.conf.d
deleted file mode 100644
index dc879d32b..000000000
--- a/community/polipo/polipo.conf.d
+++ /dev/null
@@ -1,4 +0,0 @@
-#
-# Parameters to be passed to polipo
-#
-POLIPO_ARGS="daemonise=true logFile=\"/var/log/polipo.log\""
diff --git a/community/polipo/polipo.install b/community/polipo/polipo.install
index bacc46377..03ed67ead 100644
--- a/community/polipo/polipo.install
+++ b/community/polipo/polipo.install
@@ -1,17 +1,37 @@
infodir=/usr/share/info
filelist=(polipo.info)
+create_polipo_user() {
+ getent group polipo &>/dev/null || groupadd -g 185 polipo >/dev/null
+ getent passwd polipo &>/dev/null || useradd -u 185 -g polipo \
+ -d /var/cache/polipo \
+ -c 'Caching web proxy' \
+ -s /bin/nologin polipo >/dev/null
+}
+
post_install() {
[ -x usr/bin/install-info ] || return 0
for file in ${filelist[@]}; do
install-info $infodir/$file $infodir/dir 2> /dev/null
done
- install -d /var/cache/polipo 2> /dev/null
- touch /var/log/polipo.log 2> /dev/null
- chown -R nobody:nobody /var/cache/polipo /var/log/polipo.log 2> /dev/null
+ create_polipo_user
}
post_upgrade() {
+ if [[ $(vercmp $2 1.0.4.1-11) -le 0 ]]; then
+ echo Stopping polipo service in order to modify the user/group.
+ systemctl stop polipo
+
+ # in case the user/group were already created as recommended by the wiki
+ userdel polipo &>/dev/null
+ groupdel polipo &>/dev/null
+
+ create_polipo_user
+ chown -R 185:185 /var/cache/polipo
+
+ echo You may now restart the polipo service.
+ fi
+
post_install $1
}
@@ -22,4 +42,10 @@ pre_remove() {
done
}
+post_remove() {
+ getent passwd polipo &>/dev/null && userdel polipo >/dev/null
+ getent group polipo &>/dev/null && groupdel polipo >/dev/null
+ true
+}
+
# vim:set ts=2 sw=2 et:
diff --git a/community/polipo/polipo.service b/community/polipo/polipo.service
index a4c0f6d94..185d6db36 100644
--- a/community/polipo/polipo.service
+++ b/community/polipo/polipo.service
@@ -3,9 +3,9 @@ Description=Polipo Proxy Server
After=network.target
[Service]
-Type=forking
-ExecStart=/usr/bin/polipo daemonise=true logFile="/var/log/polipo.log"
-User=nobody
+ExecStart=/usr/bin/polipo
+User=polipo
+PrivateDevices=yes
[Install]
WantedBy=multi-user.target