[aur-general] check_logfiles PKGBUILD - newbe question

Eli Schwartz eschwartz93 at gmail.com
Thu Nov 3 21:44:21 UTC 2016


On 11/03/2016 04:47 PM, Jakub Skory wrote:
> It is worth to place it in AUR or I should just keep it for myself?

Apparently, you yourself consider it worthwhile for personal use,
therefore it is reasonable to think others might think so too.
Do you think other people might want to use this software?

There are plenty of things in the AUR which are only interesting to a
few people at best... that doesn't make them less valuable, one of the
strengths of Arch Linux is that whatever you need/want/use, someone has
probably published an AUR package to install it for you. If one other
person finds it useful, you have accomplished something by publishing it.
The only bad package is an unmaintained one. :)

I have commented below regarding general PKGBUILD good practices.

> # Maintainer: Jakub Skory <q84fh at q84fh.net>

For readability, a blank line can go between the maintainer line and the
main body of the PKGBUILD. :)

> pkgname=check_logfiles
> pkgver=3.7.5.2
> pkgrel=1
> pkgdesc="check_logfiles is used to scan the lines of a file for regular
> expressions."

Don't use the pkgname inside the pkgdesc, instead I suggest "scan the
lines of a file for regular expressions", or "nagios plugin to ..."

> arch=('i686' 'x86_64')

The package installs a single perl script -- since it does not contain
arch-dependent binaries, you should use the 'any' arch which indicates
that the built *.pkg.tar.xz can be installed on both 32-bit and 64-bit
systems.

> url="http://labs.consol.de/nagios/check_logfiles/"
> license=('GPL')
> depends=('perl')
> source=("https://labs.consol.de/assets/downloads/nagios/check_logfiles-3.7.5.2.tar.gz")

I strongly recommend you reuse the ${pkgname}-${pkgver} variables, for
reusability, best practices, and especially to avoid having to edit the
version in multiple places every time the PKGBUILD gets updated.
i.e. just like you did below...

> 
> build() {
> 	cd "$srcdir/$pkgname-$pkgver"
> 	./configure --libexecdir=/usr/lib/monitoring-plugins/
> 	make
> }
> 
> package() {
> 	cd "$srcdir/$pkgname-$pkgver"
> 	make DESTDIR="$pkgdir/" install
> }
> md5sums=('6b732721cd7dd1138e9c087c1cb0bd4e')

Personally, I would put the checksums up above, with the other metadata
variables/arrays. `updpkgsums` can update it anywhere in the file. :)

Also, there is nothing that md5 can do that sha256 cannot do a lot
better. Especially if you check the authenticity of the source yourself,
sha256sums can serve an additional validation purpose, in addition to
merely checking the file integrity

-- 
Eli Schwartz


More information about the aur-general mailing list