User:Jelly/nginx packaging guidelines

From ArchWiki

This document covers proposed standards and guidelines on writing PKGBUILDs for nginx modules.

General guidelines

Package naming

  • nginx modules should be named nginx-mod-modulename
Note: The package name should be entirely lowercase.

Package

All nginx modules have to be build with a full checkout of the nginx source code. Therefore Arch Linux packages a nginx-src package which can be used to build the module as per following snippet:

arch=('x86_64')
depends=('nginx')
makedepends=('nginx-src')
...

build() {
    cp -r /usr/src/nginx .

    cd nginx
    ./configure --with-compat --add-dynamic-module=../$_modname-$pkgver
    make modules
}

package() {
    cd nginx/objs
    for mod in *.so; do
        install -Dm755 $mod "$pkgdir"/usr/lib/nginx/modules/$mod
    done
}

Example packages