rev |
line source |
pascal@11214
|
1 # SliTaz package receipt.
|
pascal@11214
|
2
|
pascal@11214
|
3 PACKAGE="php-auth-pam"
|
pascal@11214
|
4 VERSION="0.4"
|
pascal@11214
|
5 CATEGORY="development"
|
pascal@11214
|
6 SHORT_DESC="PHP extension for PAM"
|
pascal@11214
|
7 MAINTAINER="erjo@slitaz.org"
|
pascal@11214
|
8 DEPENDS="php-apache pam"
|
pascal@11214
|
9 BUILD_DEPENDS="php-dev pam pam-dev autoconf automake"
|
pascal@11214
|
10 TARBALL="${PACKAGE}_${VERSION}.orig.tar.gz"
|
pascal@11214
|
11 WEB_SITE="http://packages.debian.org/"
|
pascal@11214
|
12 WGET_URL="http://ftp.de.debian.org/debian/pool/main/p/php-auth-pam/$TARBALL"
|
pascal@11214
|
13
|
pascal@11214
|
14
|
pascal@11214
|
15 # Rules to configure and make the package.
|
pascal@11214
|
16 compile_rules()
|
pascal@11214
|
17 {
|
pascal@11214
|
18 test -d ${PACKAGE}-${VERSION} \
|
pascal@11214
|
19 || make ${PACKAGE}-${VERSION}.orig ${PACKAGE}-${VERSION}
|
pascal@11214
|
20 cd $src
|
pascal@11214
|
21 phpize
|
pascal@11214
|
22 patch -p1 < $stuff/php-auth-pam-Makefile.global0.4.u || exit 1
|
pascal@11214
|
23
|
pascal@11214
|
24 ./configure \
|
pascal@11214
|
25 --prefix=/usr &&
|
pascal@11214
|
26
|
pascal@11214
|
27 make && make DESTDIR=$DESTDIR install
|
pascal@11214
|
28 }
|
pascal@11214
|
29
|
pascal@11214
|
30 # Rules to gen a SliTaz package suitable for Tazpkg.
|
pascal@11214
|
31 genpkg_rules()
|
pascal@11214
|
32 {
|
pascal@11214
|
33 mkdir -p $fs/usr/share/php
|
pascal@11214
|
34 cp -a $_pkg/usr/lib/php/extensions/*/*.so $fs/usr/share/php
|
pascal@11214
|
35 }
|
pascal@11214
|
36
|
pascal@11214
|
37 post_install()
|
pascal@11214
|
38 {
|
pascal@11214
|
39 grep -q ^extension=pam_auth.so $1/etc/php.ini || \
|
pascal@11214
|
40 sed -e 's|extension=msql.so|extension=msql.so\nextension=pam_auth.so|' -i $1/etc/php.ini
|
pascal@11214
|
41 # Start Web server.
|
pascal@11214
|
42 while read daemon file; do
|
pascal@11214
|
43 [ -z "$1" ] || continue
|
pascal@11214
|
44 if [ -z "$1" -a -f "/var/run/$file" ]; then
|
pascal@11214
|
45 /etc/init.d/$daemon stop
|
pascal@11214
|
46 sleep 2
|
pascal@11214
|
47 fi
|
pascal@11214
|
48 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
|
pascal@11214
|
49 /etc/init.d/$daemon start
|
pascal@11214
|
50 fi
|
pascal@11214
|
51 done <<EOT
|
pascal@11214
|
52 apache apache/httpd.pid
|
pascal@11214
|
53 lighttpd lighttpd.pid
|
pascal@11214
|
54 EOT
|
pascal@11214
|
55 }
|
pascal@11214
|
56
|
pascal@11214
|
57 # Pre and post remove commands for Tazpkg.
|
pascal@11214
|
58 pre_remove()
|
pascal@11214
|
59 {
|
pascal@11214
|
60 sed -i '/.*=pam_auth.so.*/d' /etc/php.ini
|
pascal@11214
|
61
|
pascal@11214
|
62 # Start Web server.
|
pascal@11214
|
63 while read daemon file; do
|
pascal@11214
|
64 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
|
pascal@11214
|
65 /etc/init.d/$daemon stop
|
pascal@11214
|
66 sleep 2
|
pascal@11214
|
67 /etc/init.d/$daemon start
|
pascal@11214
|
68 fi
|
pascal@11214
|
69 done <<EOT
|
pascal@11214
|
70 apache apache/httpd.pid
|
pascal@11214
|
71 lighttpd lighttpd.pid
|
pascal@11214
|
72 EOT
|
pascal@11214
|
73 }
|
pascal@11214
|
74
|
pascal@11214
|
75
|
pascal@11214
|
76 clean_wok()
|
pascal@11214
|
77 {
|
pascal@11214
|
78 test -d ${PACKAGE}-${VERSION} && rm -rf ${PACKAGE}-${VERSION}
|
pascal@11214
|
79 }
|