rev |
line source |
pascal@1326
|
1 # SliTaz package receipt.
|
pascal@1326
|
2
|
pascal@1326
|
3 PACKAGE="php-gd"
|
Hans-G?nter@23426
|
4 VERSION="7.4.4"
|
pascal@1326
|
5 CATEGORY="development"
|
pascal@1326
|
6 SHORT_DESC="gd module for PHP web programming language."
|
pascal@1326
|
7 MAINTAINER="pascal.bellard@slitaz.org"
|
pascal@15198
|
8 LICENSE="BSD"
|
pascal@21278
|
9 WEB_SITE="https://www.php.net/"
|
Hans-G?nter@23426
|
10
|
Hans-G?nter@23426
|
11 DEPENDS="jpeg libpng libvpx php"
|
pascal@1326
|
12 WANTED="php"
|
pascal@1326
|
13
|
pascal@1326
|
14 # Rules to gen a SliTaz package suitable for Tazpkg.
|
pascal@1326
|
15 genpkg_rules()
|
pascal@1326
|
16 {
|
pascal@1326
|
17 mkdir -p $fs/usr/share/php
|
Hans-G?nter@23426
|
18 cp $(find $install | grep gd.so) $fs/usr/share/php/
|
pascal@1326
|
19 }
|
pascal@1326
|
20
|
pascal@1326
|
21 # Post and pre install commans to stop
|
pascal@1326
|
22 # and restart Web server if needed.
|
pascal@1326
|
23 pre_install()
|
pascal@1326
|
24 {
|
Hans-G?nter@23426
|
25 while read daemon file
|
Hans-G?nter@23426
|
26 do
|
Hans-G?nter@23426
|
27 if [ -z "$1" -a -f "/var/run/$file" ]
|
Hans-G?nter@23426
|
28 then
|
pascal@1326
|
29 /etc/init.d/$daemon stop
|
pascal@1326
|
30 fi
|
Hans-G?nter@23426
|
31 done <<EOT
|
pascal@1326
|
32 apache apache/httpd.pid
|
pascal@1326
|
33 lighttpd lighttpd.pid
|
pascal@1326
|
34 EOT
|
pascal@1326
|
35 }
|
pascal@1326
|
36
|
pascal@1326
|
37 post_install()
|
pascal@1326
|
38 {
|
Hans-G?nter@23426
|
39 grep -q ^extension=gd.so "$1/etc/php.ini" ||
|
Hans-G?nter@23426
|
40 sed -e 's|extension=bz2.so|extension=bz2.so\nextension=gd.so|' \
|
Hans-G?nter@23426
|
41 -i "$1/etc/php.ini"
|
Hans-G?nter@23426
|
42
|
pascal@1326
|
43 # Start Web server.
|
Hans-G?nter@23426
|
44 while read daemon file
|
Hans-G?nter@23426
|
45 do
|
pascal@1805
|
46 [ -z "$1" ] || continue
|
Hans-G?nter@23426
|
47 if [ -z "$1" -a -f "/var/run/$file" ]
|
Hans-G?nter@23426
|
48 then
|
pascal@1805
|
49 /etc/init.d/$daemon stop
|
pascal@1805
|
50 sleep 2
|
pascal@1805
|
51 fi
|
Hans-G?nter@23426
|
52 if [ -z "$1" -a -f /etc/init.d/$daemon ]
|
Hans-G?nter@23426
|
53 then
|
pascal@1326
|
54 /etc/init.d/$daemon start
|
pascal@1326
|
55 fi
|
Hans-G?nter@23426
|
56 done <<EOT
|
pascal@1326
|
57 apache apache/httpd.pid
|
pascal@1326
|
58 lighttpd lighttpd.pid
|
pascal@1326
|
59 EOT
|
pascal@1326
|
60 }
|
pascal@1326
|
61
|
pascal@1749
|
62 # Pre and post remove commands for Tazpkg.
|
pascal@1749
|
63 pre_remove()
|
pascal@1749
|
64 {
|
pascal@18730
|
65 sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
|
pascal@1749
|
66
|
pascal@1749
|
67 # Start Web server.
|
Hans-G?nter@23426
|
68 while read daemon file
|
Hans-G?nter@23426
|
69 do
|
Hans-G?nter@23426
|
70 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]
|
Hans-G?nter@23426
|
71 then
|
slaxemulator@14614
|
72 [ -z "$1" ] || continue
|
Hans-G?nter@23426
|
73 if [ -z "$1" -a -f "/var/run/$file" ]
|
Hans-G?nter@23426
|
74 then
|
slaxemulator@14614
|
75 /etc/init.d/$daemon stop
|
slaxemulator@14614
|
76 sleep 2
|
slaxemulator@14614
|
77 fi
|
Hans-G?nter@23426
|
78 if [ -z "$1" -a -f /etc/init.d/$daemon ]
|
Hans-G?nter@23426
|
79 then
|
slaxemulator@14614
|
80 /etc/init.d/$daemon start
|
slaxemulator@14614
|
81 fi
|
pascal@1749
|
82 fi
|
Hans-G?nter@23426
|
83 done <<EOT
|
pascal@1749
|
84 apache apache/httpd.pid
|
pascal@1749
|
85 lighttpd lighttpd.pid
|
pascal@1749
|
86 EOT
|
pascal@1749
|
87 }
|