wok view php-auth-pam/receipt @ rev 25707
Up perl-net-pcap (0.21), qtermwidget (0.5.1), youtube-dl-gui (0.3.8)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jul 05 14:08:34 2024 +0000 (3 months ago) |
parents | 73f36875e5a7 |
children |
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="https://packages.debian.org/"
11 WGET_URL="http://archive.debian.org/debian/pool/main/p/$PACKAGE/$TARBALL"
13 DEPENDS="php-apache pam"
14 BUILD_DEPENDS="php-dev pam pam-dev autoconf automake sed coreutils-conditions"
16 # What is the latest version available today?
17 current_version()
18 {
19 wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
20 sed '/orig.tar.gz/!d;s|.*pam_||;s|.orig.*||;q'
21 }
23 # Rules to configure and make the package.
24 compile_rules()
25 {
26 phpize
27 sed -i 's/^function_entry/zend_&/;s/pval /zval /' pam_auth.c # php 5.4
29 sed -e 's|(\(\*[a-z]*)\)->value.str.val;|Z_STRVAL(*\1;|' \
30 -e 's|(\*status)->value.str.val|Z_STR(**status)|' \
31 -e 's|(\*status)->value.str.len|Z_STRLEN(**status)|' \
32 -e 's|(\*status)->type|Z_TYPE_INFO(**status)|' \
33 -i pam_auth.c # php 7.3
35 ./configure $CONFIGURE_ARGS \
36 --prefix=/usr &&
38 make && make INSTALL_ROOT=$DESTDIR install
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 mkdir -p $fs/usr/share/php
45 cp -a $install/usr/lib/php/extensions/*/*.so $fs/usr/share/php
46 }
48 # Post install/remove commands for Tazpkg.
49 post_install()
50 {
51 grep -q ^extension=pam_auth.so "$1/etc/php.ini" || \
52 sed -e 's|extension=bz2.so|extension=bz2.so\nextension=pam_auth.so|' -i "$1/etc/php.ini"
53 # Start Web server.
54 while read daemon file; do
55 [ -z "$1" ] || continue
56 if [ -z "$1" -a -f "/var/run/$file" ]; then
57 /etc/init.d/$daemon stop
58 sleep 2
59 fi
60 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
61 /etc/init.d/$daemon start
62 fi
63 done <<EOT
64 apache apache/httpd.pid
65 lighttpd lighttpd.pid
66 EOT
67 true
68 }
70 # Pre and post remove commands for Tazpkg.
71 pre_remove()
72 {
73 sed -i '/.*=pam_auth.so.*/d' /etc/php.ini
75 # Start Web server.
76 while read daemon file; do
77 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
78 /etc/init.d/$daemon stop
79 sleep 2
80 /etc/init.d/$daemon start
81 fi
82 done <<EOT
83 apache apache/httpd.pid
84 lighttpd lighttpd.pid
85 EOT
86 }