wok view php-auth-pam/receipt @ rev 23062

php-auth-pam: update for php 7.3
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 08 13:54:20 2020 +0100 (2020-03-08)
parents 88fd80eaee1a
children 6e908e172c45
line source
1 # SliTaz package receipt.
3 PACKAGE="php-auth-pam"
4 VERSION="0.4"
5 CATEGORY="development"
6 SHORT_DESC="PHP extension for PAM"
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="BSD"
9 TARBALL="${PACKAGE}_${VERSION}.orig.tar.gz"
10 WEB_SITE="http://packages.debian.org/"
11 WGET_URL="http://ftp.de.debian.org/debian/pool/main/p/php-auth-pam/$TARBALL"
13 DEPENDS="php-apache pam"
14 BUILD_DEPENDS="php-dev pam pam-dev autoconf automake sed coreutils-conditions"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 test -d ${PACKAGE}-${VERSION} \
20 || make ${PACKAGE}-${VERSION}.orig ${PACKAGE}-${VERSION}
21 cd $src
22 phpize
23 patch -p1 < $stuff/php-auth-pam-Makefile.global0.4.u || exit 1
24 sed -i 's/^function_entry/zend_&/;s/pval /zval /' pam_auth.c # php 5.4
26 sed -e 's|(\(\*[a-z]*)\)->value.str.val;|Z_STRVAL(*\1;|' \
27 -e 's|(\*status)->value.str.val|Z_STR(**status)|' \
28 -e 's|(\*status)->value.str.len|Z_STRLEN(**status)|' \
29 -e 's|(\*status)->type|Z_TYPE_INFO(**status)|' \
30 -i pam_auth.c # php 7.3
32 ./configure $CONFIGURE_ARGS \
33 --prefix=/usr &&
35 make && make DESTDIR=$DESTDIR install
36 }
38 # Rules to gen a SliTaz package suitable for Tazpkg.
39 genpkg_rules()
40 {
41 mkdir -p $fs/usr/share/php
42 cp -a $install/usr/lib/php/extensions/*/*.so $fs/usr/share/php
43 }
45 post_install()
46 {
47 grep -q ^extension=pam_auth.so "$1/etc/php.ini" || \
48 sed -e 's|extension=bz2.so|extension=bz2.so\nextension=pam_auth.so|' -i "$1/etc/php.ini"
49 # Start Web server.
50 while read daemon file; do
51 [ -z "$1" ] || continue
52 if [ -z "$1" -a -f "/var/run/$file" ]; then
53 /etc/init.d/$daemon stop
54 sleep 2
55 fi
56 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
57 /etc/init.d/$daemon start
58 fi
59 done <<EOT
60 apache apache/httpd.pid
61 lighttpd lighttpd.pid
62 EOT
63 true
64 }
66 # Pre and post remove commands for Tazpkg.
67 pre_remove()
68 {
69 sed -i '/.*=pam_auth.so.*/d' /etc/php.ini
71 # Start Web server.
72 while read daemon file; do
73 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
74 /etc/init.d/$daemon stop
75 sleep 2
76 /etc/init.d/$daemon start
77 fi
78 done <<EOT
79 apache apache/httpd.pid
80 lighttpd lighttpd.pid
81 EOT
82 }
85 clean_wok()
86 {
87 test -d ${PACKAGE}-${VERSION} && rm -rf ${PACKAGE}-${VERSION}
88 }