1# An example PKGBUILD script for Civetweb upstream, git version
2# Rename to PKGBUILD to build via makepkg
3_pkgname=civetweb
4pkgname=$_pkgname-git
5pkgver=v1.4.24.g73c40b6
6pkgrel=1
7pkgdesc="Small and quick-to-use web server; https/php/cgi support; MIT license - git development version"
8arch=('i686' 'x86_64')
9url="http://sourceforge.net/p/civetweb/"
10license=('MIT')
11groups=()
12depends=()
13makedepends=('git sed')
14optdepends=('php-cgi: for php support')
15provides=("$_pkgname")
16conflicts=("$_pkgname")
17backup=("etc/$_pkgname/$_pkgname.conf")
18source=("$_pkgname::git+https://github.com/civetweb/civetweb.git")
19md5sums=('SKIP')
20
21pkgver() {
22  cd "$srcdir/$_pkgname"
23  git describe --tags | sed 's|-|.|g'
24}
25
26build() {
27  cd "$srcdir/$_pkgname"
28  make build WITH_IPV6=1
29}
30
31package() {
32  cd "$srcdir/$_pkgname"
33  make install PREFIX="$pkgdir/usr" SYSCONFDIR="$pkgdir/etc/local/$_pkgname"
34
35  install -Dm644 "$srcdir/$_pkgname/distribution/arch/$_pkgname.service" "$pkgdir/usr/lib/systemd/system/$_pkgname.service"
36
37  sed -i "s/^document_root [^\n]*/document_root \/srv\/http/g" "$pkgdir/etc/local/$_pkgname/$_pkgname.conf"
38  sed -i "s/^# access_log_file/access_log_file \/var\/log\/$_pkgname\/access.log/g" "$pkgdir/etc/local/$_pkgname/$_pkgname.conf"
39  sed -i "s/^# error_log_file/access_log_file \/var\/log\/$_pkgname\/error.log/g" "$pkgdir/etc/local/$_pkgname/$_pkgname.conf"
40}
41
42# vim:set ts=2 sw=2 et:
43