testing/unit: build all modules and move them to subpackages

This commit is contained in:
Jakub Jirutka 2018-05-07 00:39:38 +02:00
parent eae3085afd
commit 831ba5bb1c

View File

@ -1,4 +1,5 @@
# Contributor: André Klitzing <aklitzing@gmail.com>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=unit
pkgver=1.1
@ -7,24 +8,37 @@ pkgdesc="NGINX Unit is a dynamic web application server"
url="https://unit.nginx.org/"
arch="all"
license="Apache-2.0"
depends=""
makedepends="python3-dev"
_phpver=7
makedepends="perl-dev php$_phpver-dev php$_phpver-embed python3-dev ruby-dev"
subpackages=""
source="https://unit.nginx.org/download/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"
for _mod in perl php$_phpver python3 ruby; do
subpackages="$subpackages $pkgname-$_mod:_module"
done
_modules_dir="/usr/lib/unit/modules"
build() {
cd "$builddir"
# Needed for building perl module.
export CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
./configure \
--prefix="/usr" \
--state="/var/lib/unit" \
--control="unix:/run/control.unit.sock" \
--pid="/run/unit.pid" \
--log="/var/log/unit.log" \
--modules="/usr/lib/unit/modules" \
--modules="$_modules_dir" \
--tests
./configure python \
--config=python3-config
./configure perl
./configure php --module=php$_phpver --config=php-config$_phpver
./configure python --config=python3-config
./configure ruby
make
make tests
}
@ -41,7 +55,16 @@ check() {
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
make unitd-install DESTDIR="$pkgdir"
}
_module() {
local modname=${subpkgname#$pkgname-}
pkgdesc="$modname module for NGINX Unit"
depends="$pkgname=$pkgver-r$pkgrel"
cd "$builddir"
make $modname-install DESTDIR="$subpkgdir"
}
sha512sums="89460e96d775df7f0c9d66011b59ca45ebe99e1e9e194f1800824ee1a3ae9c3f0207c9c749d34c250560ded6f1c3ad5b66fadcb3ffb2c62c5a6f5115944cea1f unit-1.1.tar.gz"