Pen 0.33.0 load balancer on Arch Linux PKGBUILD

I decided to take a first stab at making and maintaining my own Arch package and as Pen seemed to be missing in the package list and AUR it looked like a good candidate.


PKGBUILD :
# $Id$
# Maintainer:  Aaron West <awest@tamakizu.co.uk>

pkgname=pen
pkgver=0.33.0
pkgrel=1
pkgdesc='A highly scalable, highly available, robust load balancer for tcp and udp based protocols such as dns, http or smtp.'
arch=('i686' 'x86_64')
url='http://siag.nu/pen/'
license=('GPL2')
depends=('geoip' 'openssl')
backup=('etc/pen/conf/http.conf')
install=pen.install
source=("http://siag.nu/pub/pen/pen-${pkgver}.tar.gz"
        'pen-http.service'
        'http.conf'
        'pen.conf')
md5sums=('365f096781b72e285aae3eb34e58e184'
        'b5ffd7977eb6f98e6fc5a11a0c070370'
        '2b29437249160bda06f7d6a9e48ca4c9'
        '2479b1d49cb7d48ba9a90db8ce2dd13f')

build() {
  cd pen-${pkgver}
  ./configure --with-ssl=/etc/ssl/ --with-geoip --prefix=/usr
  make
}

package() {
  cd pen-${pkgver}
  make DESTDIR="${pkgdir}/" install
  install -D --mode=644 ${srcdir}/pen-http.service ${pkgdir}/usr/lib/systemd/system/pen-http.service
  install -D --mode=644 ${srcdir}/http.conf ${pkgdir}/etc/pen/conf/http.conf
  install -D --mode=644 ${srcdir}/pen.conf ${pkgdir}/usr/lib/tmpfiles.d/pen.conf
}

pen.install :
# Install file for Pen

post_install() {
        useradd -p $(openssl rand -base64 32) pen
        systemd-tmpfiles --create
}

pen.conf :
d /var/run/pen 0755 pen pen -

pen-http.service :
[Unit]
Description=Pen load balancer - Sample HTTP config.
After=network.target

[Service]
ExecStart=/usr/bin/pen -u pen -C /var/run/pen/http.ctl -F /etc/pen/conf/http.conf -p /var/run/pen/http.pid 80
Type=forking
PIDFile=/var/run/pen/http.pid
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always

[Install]
WantedBy=multi-user.target

http.conf :
http
server 0 address 10.0.0.10 port 80
debug 1

Comments (0)


Add a Comment





Allowed tags: <b><i><br>Add a new comment:



Get a free giffgaff Sim