From d41782ebd2416faf39268ec9a2c3242430390308 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 26 Nov 2012 01:53:53 -0800 Subject: Mon Nov 26 01:48:57 PST 2012 --- x86_64/polipo/PKGBUILD | 54 +++++++++++++++++++++++++++++++++ x86_64/polipo/polipo.conf.d | 4 +++ x86_64/polipo/polipo.install | 25 ++++++++++++++++ x86_64/polipo/polipo.rc.d | 71 ++++++++++++++++++++++++++++++++++++++++++++ x86_64/polipo/polipo.service | 10 +++++++ 5 files changed, 164 insertions(+) create mode 100644 x86_64/polipo/PKGBUILD create mode 100644 x86_64/polipo/polipo.conf.d create mode 100644 x86_64/polipo/polipo.install create mode 100644 x86_64/polipo/polipo.rc.d create mode 100644 x86_64/polipo/polipo.service (limited to 'x86_64') diff --git a/x86_64/polipo/PKGBUILD b/x86_64/polipo/PKGBUILD new file mode 100644 index 000000000..5611e1ec4 --- /dev/null +++ b/x86_64/polipo/PKGBUILD @@ -0,0 +1,54 @@ +# $Id: PKGBUILD 80565 2012-11-25 16:48:33Z ttoepper $ +# Maintainer: Thorsten Töpper +# Contributor: Jelle van der Waa +# Contributor: Thomas Holmquist +# Contributor: Jan Boehringer +# Contributor: Alex Griffin + +pkgname=polipo +pkgver=1.0.4.1 +pkgrel=8 +pkgdesc="A small and fast caching web proxy." +arch=('i686' 'x86_64') +url="http://www.pps.jussieu.fr/~jch/software/polipo/" +license=('GPL') +depends=('bash') +makedepends=('texinfo') +install=polipo.install +source=("http://freehaven.net/~chrisd/polipo/polipo-$pkgver.tar.gz" + "polipo.rc.d" "polipo.conf.d" "polipo.service") +md5sums=('bfc5c85289519658280e093a270d6703' + '7406aad26807fb3a4e5f7b01ecb97a59' + '685aa0c6070dee11c701932d23afcc6a' + 'a7cf48637a8ec8fe8d88754c399380c0') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + make PREFIX="$pkgdir/usr" \ + MANDIR="$pkgdir/usr/share/man" \ + INFODIR="$pkgdir/usr/share/info" \ + LOCAL_ROOT="$pkgdir/usr/share/polipo/www" \ + DISK_CACHE_ROOT="$pkgdir/var/cache/polipo" \ + 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 license + install -Dm644 COPYING $pkgdir/usr/share/licenses/polipo/LICENSE + + # install daemon scripts / cron + install -Dm 755 $srcdir/polipo.rc.d $pkgdir/etc/rc.d/polipo + 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 +} + +# vim:set ts=2 sw=2 et: diff --git a/x86_64/polipo/polipo.conf.d b/x86_64/polipo/polipo.conf.d new file mode 100644 index 000000000..dc879d32b --- /dev/null +++ b/x86_64/polipo/polipo.conf.d @@ -0,0 +1,4 @@ +# +# Parameters to be passed to polipo +# +POLIPO_ARGS="daemonise=true logFile=\"/var/log/polipo.log\"" diff --git a/x86_64/polipo/polipo.install b/x86_64/polipo/polipo.install new file mode 100644 index 000000000..bacc46377 --- /dev/null +++ b/x86_64/polipo/polipo.install @@ -0,0 +1,25 @@ +infodir=/usr/share/info +filelist=(polipo.info) + +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 +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file $infodir/dir 2> /dev/null + done +} + +# vim:set ts=2 sw=2 et: diff --git a/x86_64/polipo/polipo.rc.d b/x86_64/polipo/polipo.rc.d new file mode 100644 index 000000000..0333ded57 --- /dev/null +++ b/x86_64/polipo/polipo.rc.d @@ -0,0 +1,71 @@ +#!/bin/bash + +daemon_name=polipo + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +get_pid() { + pidof -o %PPID $daemon_name +} + +case "$1" in + start) + stat_busy "Starting $daemon_name daemon" + + PID=$(get_pid) + if [[ -z $PID ]]; then + [[ -f /run/$daemon_name.pid ]] && + rm -f /run/$daemon_name.pid + # RUN + su -c "/usr/bin/$daemon_name ${POLIPO_ARGS}" -s /bin/sh - nobody + # + if [[ $? -gt 0 ]]; then + stat_fail + exit 1 + else + echo $(get_pid) > /run/$daemon_name.pid + add_daemon $daemon_name + stat_done + fi + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping $daemon_name daemon" + PID=$(get_pid) + # KILL + [[ -n $PID ]] && kill $PID &> /dev/null + # + if [[ $? -gt 0 ]]; then + stat_fail + exit 1 + else + rm -f /run/$daemon_name.pid &> /dev/null + rm_daemon $daemon_name + stat_done + fi + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + ;; + + *) + echo "usage: $0 {start|stop|restart|status}" +esac + +exit 0 + +# vim:set ts=2 sw=2 et: diff --git a/x86_64/polipo/polipo.service b/x86_64/polipo/polipo.service new file mode 100644 index 000000000..59aeb9f3b --- /dev/null +++ b/x86_64/polipo/polipo.service @@ -0,0 +1,10 @@ +[Unit] +Description=Polipo Proxy Server + +[Service] +Type=forking +ExecStart=/usr/bin/polipo daemonise=true logFile="/var/log/polipo.log" +User=nobody + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3-54-g00ecf