You are not logged in.

#1 2016-04-16 16:14:40

Tamakizu
Member
Registered: 2016-04-16
Posts: 4

I'm interested in maintaining Pen load balancer.

I've been considering maintaining a package in the AUR for a while, I'm normally a very silent user but after many years of Linux use I feel like it's time to give a little back.

As a first effort I was thinking of maintaining a PKGBUILD for Pen load balancer as I couldn't see it in the package list or AUR. So what do others think is it useful or will I be the only user?

For those thinking what the hell is Pen : http://siag.nu/pen/

Last edited by Tamakizu (2016-04-16 21:52:29)

Offline

#2 2016-04-16 18:35:16

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: I'm interested in maintaining Pen load balancer.

Why would someone choose this over haproxy?

You spelled the app wrongly in the title...

Offline

#3 2016-04-16 21:56:57

Tamakizu
Member
Registered: 2016-04-16
Posts: 4

Re: I'm interested in maintaining Pen load balancer.

>Why would someone choose this over haproxy?

That is fairly easy to answer, first it supports UDP and second it supports DR mode. It seems to me that it sits nicely between the funcionality of HAproxy, LVS and NGINX.

>You spelled the app wrongly in the title...

Darn, ya got me there...

Offline

#4 2016-04-17 22:26:52

Tamakizu
Member
Registered: 2016-04-16
Posts: 4

Re: I'm interested in maintaining Pen load balancer.

Well I've taken a stab at it, please let me know where I can improve things.

PKGBUILD is below but I pasted the whole thing on my Blog : http://compits.co.uk/blog/2016/04/17/pe … -pkgbuild/

Assuming what I've done is not complete junk I'll look into what steps I now need to take to get it on the AUR.

# $Id$
# Maintainer:  Aaron West

pkgname=pen
pkgver=0.33.0
pkgrel=1
pkgdesc='This is Pen, 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=('GPLv2')
depends=('geoip' 'openssl' )
backup=('etc/pen/conf/http.conf')
install=pen.install
source=('http://siag.nu/pub/pen/pen-0.33.0.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="$pkgdir"/usr/
  make
}

package() {
  cd pen-$pkgver
  make 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}/etc/tmpfiles.d/pen.conf
}

Offline

#5 2016-04-17 22:45:12

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: I'm interested in maintaining Pen load balancer.

$pkgdir is not usable in the build function. You generally set the prefix to /usr, then set a separate variable, like DESTDIR, for the make install.

Don't start the pkgdesc with the name of the program. We know it's pen, it's in the package name.

Make sure to quote all paths that include variables you don't control. You don't know if they contain spaces or not.

GPLv2 should just be GPL2.

You should probably be installing pen.conf to /usr/lib/tmpfiles.d/, /etc/tmpfiles.d/ is for the sysadmin to override it.

You should really use $pkgver in the source array. Right now you have to change the version in 2 places on each update, no reason for that.

You should generally not be chowning things in the post install scripts.

You should not be stopping the service in the post remove script.

You should not be deleting the user in the post remove script.

Your use of variables is inconsistent. Sometimes you use braces, sometimes you don't. Pick one and stick with it.

Last edited by Scimmia (2016-04-17 22:54:57)

Online

#6 2016-04-17 22:53:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: I'm interested in maintaining Pen load balancer.

I'd like to only add to the above points - all of which are completely accurate - that this is a great start to a first PKGBUILD.  If you're reading of the docs got you this far, I have no doubt you find the instructions for uploading it to the AUR (after the revisions have been made) and be a good maintainer.

So welcome to the forums, and thanks for contributing.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2016-04-17 22:54:08

Tamakizu
Member
Registered: 2016-04-16
Posts: 4

Re: I'm interested in maintaining Pen load balancer.

Thanks!

I'll work through these tips tomorrow and update.

Offline

#8 2016-04-17 22:56:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: I'm interested in maintaining Pen load balancer.

Yes, I agree with Tribly 100%, it's a fantastic start. Most of the tips are just clean-up kind of stuff.

Online

Board footer

Powered by FluxBB