summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 56e207e702944d26aed5d66d990fac9f21c8396c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Maintainer: Matteo Mattei <info@matteomattei.com>
# Maintainer: Amish <contact at via dot aur>

pkgname=php-pam
pkgver=2.2
pkgrel=2
pkgdesc="This extension provides PAM (Pluggable Authentication Modules) integration in PHP."
arch=('i686' 'x86_64')
url="https://github.com/amishmm/php-pam"
license=('PHP')
depends=('php>=7.2.0' 'pam')
makedepends=('autoconf')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/amishmm/${pkgname}/archive/v${pkgver}.tar.gz")
md5sums=('dc750d46f942846388e1aef17cd3a99e')
backup=('etc/pam.d/php')

build() {
  cd "${pkgname}-${pkgver}"
  phpize
  ./configure --prefix=/usr
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make INSTALL_ROOT="${pkgdir}" install

  echo -e "extension=pam.so;\npam.servicename=\"php\";\npam.force_servicename=0;" | \
    install -Dm644 /dev/stdin "${pkgdir}/etc/php/conf.d/pam.ini"

  # use archlinux's own system-remote-login as PAM service
  # because that is expected to be well tested for security
  # and all future modifications will also automatically apply
  # NOTE: content copied from /etc/pam.d/sshd
  install -Dm644 /dev/stdin "${pkgdir}/etc/pam.d/php" << 'EOF'
#%PAM-1.0
#auth     required  pam_securetty.so     #disable remote root
auth      include   system-remote-login
account   include   system-remote-login
password  include   system-remote-login
session   include   system-remote-login
EOF
}